1 function y = get_tign(wrfinput,input_file,output_file,time,time_step,interval)
2 %function generating time of ignition matrix for fire spread reversal
3 %to be saved as a text file named 'output_file', based on the
4 %wrinput file: 'wrfinput', primeter input text file: 'input_file',
5 %and the 'time' defining the number of frame from wrfinput file
6 %closest to the fire perimeter file provided as 'input_file',
7 %'time_step' the number of frames in the wrfinput file,
8 %'interval' time interval in wrfinput in seconds 3600 = 1 hour
10 %get_tign('wrfout_d01_2013-08-13_00:00:00','UT-SLD-HU2S Patch Springs 8-12-2013 2123.txt','tign_08132013_0323.txt',8,48,1800)
17 display(strcat('wrfinput :',{' '}, wrfinput))
18 display(strcat('perimeter input file :',{' '}, input_file))
19 display(strcat('output file :',{' '}, output_file))
22 %wrfout{2}='wrfout_d01_2013-08-12_00:00:00';
23 %wrfout{3}='wrfout_d01_2013-08-13_00:00:00';
24 %wrfout{4}='wrfout_d01_2013-08-14_00:00:00';
25 %wrfout{5}='wrfout_d01_2013-08-15_00:00:00';
26 %wrfout{6}='wrfout_d01_2013-08-16_00:00:00';
28 input_type=2; % Type of the input, 1- data file; 0 - wrfout file; 2- fire_area - is given in input_file;
29 %input_file='perimeter.txt';
30 %input_file='Input_data_Patch_Springs_8-12-2013_2123.dat';
31 % File that contains perimeter data
32 % It is being used only when input_type=1;;
33 num_wrf=1; % The total number of wrfouts that are being used
34 %time_step=48; % The amount of time_steps in each wrfout
35 %interval=1800; % time step in wrfout in seconds (every 15 min=900 sec)
36 %time=48; % the number of the time step in the latest wrfout
37 % closest to the perimeter time from below
40 % read the fire map at perimeter time
41 [long,lat,fire_area]=read_file_perimeter(wrfout{num_wrf},wrfout{num_wrf}, time,input_type,input_file);
42 % now have data: long, lat,
43 % fire_area - (input_type=0)- burning or not burning (between 0 and 1, 0-1 OK)
44 % (input_type=1)- set of ordered points of the boundary 1st=last;
45 % bound(i,1)-horisontal; bound(i,1)-vertical coordinate
46 tign=perimeter_in(long,lat,fire_area,wrfout,time,interval,time_step,num_wrf, input_type);
48 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49 % The information below is not being used for the current problem
50 %data='data_perim.txt';
51 %data=''; % contained the coordinates of the fire perimeter from the shapefile
52 %wrfout='wrfout_d05_2012-09-12_21:15:01';
53 %wrfout='wrfout_d05_2012-09-09_00:00:00'; - for the earlies Baker's fire
55 % time =49 for Witch fire;
56 % time=100; for Baker's fire;
58 cmd_mv=['mv output_tign_test.txt ',output_file]