1 function fmc_change(m,f)
2 %perchentage change to add/subtract
3 % msk - locations where to add subtract
4 % f - string, path to a wrfinput or wrfrst file
9 %blur mask a little bit
10 %msk= imgaussfilt(msk,1/2);
11 %w = read_wrfout_tign(f);
13 s = nc2struct(f,{'FMC_GC'},{})
14 msk = ones(size(s.fmc_gc(:,:,1)));
15 fprintf('Fuel levels 1--> 1hr, 2-->10hr 3-->100hr 4-->1000hr 5-->live \n')
16 fprintf('Standard for now is [3,5]: 100hr, live fuels.\n')
17 f_time = input_num('Which fuel levels? All = -1',[3,5]);
19 moist = m*msk + s.fmc_gc;
22 for i = 1:length(f_time)
24 moist(:,:,f_time(i)) = m*msk + s.fmc_gc(:,:,f_time(i));
25 %small adjustment globally
26 moist(:,:,f_time(i)) = moist(:,:,f_time(i))+m/4;
30 rewrite_bak=[f,'.bak_before_fmc'];
31 if system(['cp ',f,' ',rewrite_bak])
32 fprintf('Error in copy \n')
34 fprintf('Copy ok. rewriting FMC_G \n')
35 ncreplace(f,'FMC_GC',moist)
36 %ncreplace(f,'FMC_G',moist)