fixing memory bounds in module_ndt_w_assembly.f90
[wrf-fire-matlab.git] / perimeter_new / main_function_jm.m
blobbb27c5d07707fd8abef2ecde8025078ceb149075
1 %clear
2 clc
3 %addpath ../netcdf
4 %addpath ../util1_jan
5 %addpath ..
6 %addpath Output
7 disp('If you get missing netcdf functions please run startup.m in this directory, other/Matlab/perimeter_new.')
8 disp('Note: you need to cd to the directory first and then run startup.')
9 if ~exist('saved_data','var'),
10      global saved_data
11      saved_data=0;
12 end
15 %wrfout{1}='/share_home/akochans/WRF341F/wrf-fire/WRFV3/test/em_utfire_1d_med_4km_nofire/wrfout_d01_2013-08-11_00:00:00';
16 % wrfout{2}='/share_home/akochans/WRF341F/wrf-fire/WRFV3/test/em_utfire_1d_med_4km_nofire/wrfout_d01_2013-08-12_00:00:00';
17 % wrfout{1}='/share_home/akochans/WRF341F/wrf-fire/WRFV3/test/em_utfire_1d_med_4km_nofire/wrfout_d01_2013-08-13_00:00:00';
18 % wrfout{4}='/share_home/akochans/WRF341F/wrf-fire/WRFV3/test/em_utfire_1d_med_4km_nofire/wrfout_d01_2013-08-14_00:00:00';
19 % wrfout{5}='/share_home/akochans/WRF341F/wrf-fire/WRFV3/test/em_utfire_1d_med_4km_nofire/wrfout_d01_2013-08-15_00:00:00';
20 % wrfout{6}='/share_home/akochans/WRF341F/wrf-fire/WRFV3/test/em_utfire_1d_med_4km_nofire/wrfout_d01_2013-08-16_00:00:00';
21 % wrfout{7}='/share_home/akochans/WRF341F/wrf-fire/WRFV3/test/em_utfire_1d_med_4km_nofire/wrfout_d01_2013-08-17_00:00:00';
22 % wrfout{8}='/share_home/akochans/WRF341F/wrf-fire/WRFV3/test/em_utfire_1d_med_4km_nofire/wrfout_d01_2013-08-18_00:00:00';
23 % wrfout{9}='/share_home/akochans/WRF341F/wrf-fire/WRFV3/test/em_utfire_1d_med_4km_nofire/wrfout_d01_2013-08-19_00:00:00';
25 wrfout{1}='wrfout_d01_2013-08-11_00:00:00';
26 wrfout{2}='wrfout_d01_2013-08-12_00:00:00';
27 wrfout{3}='wrfout_d01_2013-08-13_00:00:00';
28 wrfout{4}='wrfout_d01_2013-08-14_00:00:00';
29 wrfout{5}='wrfout_d01_2013-08-15_00:00:00';
30 wrfout{6}='wrfout_d01_2013-08-16_00:00:00';
31 wrfout{7}='wrfout_d01_2013-08-17_00:00:00';
32 wrfout{8}='wrfout_d01_2013-08-18_00:00:00';
33 wrfout{9}='wrfout_d01_2013-08-19_00:00:00';
36 input_type=2;     % Type of the input, 1- data file; 0 - wrfout file; 2- fire_area - is given in input_file;
37 input_file='perimeter.txt';
38 %input_file='Input_data_Patch_Springs_8-12-2013_2123.dat';    
39 % File that contains perimeter data
40                   % It is being used only when input_type=1;;  
41 num_wrf=3;        % The total number of wrfouts that are being used
42 frames=48;      % The amount of frames in each wrfout
43 frame_interval=1800;  % frame interval in wrfout in seconds (every 15 min=900 sec)
44 last_frame=27;           % the number of the frame in the latest wrfout 
45 last_frame_time=(frames*(num_wrf-1)+last_frame)*frame_interval
47 % read the fire map at perimeter time
48     [long,lat,fire_perimeter,timestep_end]=read_file_perimeter_jm(wrfout{num_wrf},wrfout{num_wrf}, last_frame,input_type,input_file);
50 % now have data: long, lat, 
51 % fire_area - (input_type=0)- burning or not burning (between 0 and 1, 0-1 OK)
52 %             (input_type=1)- 2set of ordered points of the boundary 1st=last;
53 %                  bound(i,1)-horisontal; bound(i,1)-vertical coordinate
54 tign=perimeter_in_jm(long,lat,fire_perimeter,wrfout,last_frame,frame_interval,frames,num_wrf, input_type);
55 figure(4);mesh(long,lat,tign)
56 xlabel('long (m)')
57 ylabel('lat (m)')
59 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
60 % The information below is not being used for the current problem
61 %data='data_perim.txt';
62 %data='';            % contained the coordinates of the fire perimeter from the shapefile
63 %wrfout='wrfout_d05_2012-09-12_21:15:01';
64 %wrfout='wrfout_d05_2012-09-09_00:00:00'; - for the earlies Baker's fire
65 %time=281;
66 % time =49 for Witch fire;
67 % time=100; for Baker's fire;