1 function fmc_change(m,msk,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 fprintf('Fuel levels 1--> 1hr, 2-->10hr 3-->100hr 4-->1000hr 5-->live \n')
15 fprintf('Standard for now is [3,5]: 100hr, live fuels.\n')
16 f_time = input_num('Which fuel levels? All = -1',[3,5]);
18 moist = m*msk + s.fmc_gc;
21 for i = 1:length(f_time)
23 moist(:,:,f_time(i)) = m*msk + s.fmc_gc(:,:,f_time(i));
24 %small adjustment globally
25 moist(:,:,f_time(i)) = moist(:,:,f_time(i))+m/4;
29 rewrite_bak=[f,'.bak_before_fmc'];
30 if system(['cp ',f,' ',rewrite_bak])
31 fprintf('Error in copy \n')
33 fprintf('Copy ok. rewriting FMC_G \n')
34 ncreplace(f,'FMC_GC',moist)
35 %ncreplace(f,'FMC_G',moist)