1 % function check_uah_vah
3 %filename='wrfrst_d01_0001-01-01_00:01:00'; % wrfrst, not wrfout
6 % to validate computation of uah,vah
8 % run wrf with fire_print_file=1
9 % start matlab in em_fire
10 % cd to the run directory
13 height=20*0.3048; % 6ft
18 p=nc2struct(filename,{'U_2','V_2','PH_2','PHB','HGT','Z0','UAH','VAH',...
19 'XLONG','XLAT'},{'DX','DY'},1);
20 z0=p.z0; u=p.u_2; v=p.v_2; ph= p.ph_2; phb=p.phb; uahw=p.uah; vahw=p.vah;
22 z0=read_array_m('z0',id);
23 u=read_array_m('u_2',id);
24 v=read_array_m('v_2',id);
25 ph=read_array_m('ph_2',id);
27 u=u_2(:,:,1:k-1,:); % vertically staggered
29 phb=read_array_m('phb',id);
30 uahw=read_array_m('uah',id);
31 vahw=read_array_m('vah',id);
34 altw=(ph_2+phb)/9.81; % geopotential altitude at w-points
36 % [uah,vah]=uah_vah(z0,u_2,v_2,altw,height);
37 uah_vah % want all in base workspace to dissect