adding interpolation to fire wind height
[wrf-fire-matlab.git] / femwind / plot_init_from_wrf.m
blob415d0ba4a3154b921b974bae3466b007cab48e07
1 p=nc2struct(f,{'HT_FMW','U0_FMW','V0_FMW','W0_FMW','FXLONG','FXLAT','ZSF',...
2     'UNIT_FXLAT','UNIT_FXLONG','XLONG','XLAT'},{'DX','DY'},60)
3 [m,n]=size(p.xlat);
4 [fm,fn]=size(p.fxlat);
5 fdx=p.dx*(m/fm);
6 fdy=p.dy*(n/fn);
7 n=size(p.u0_fmw);
8 CX{1}=zeros(n);
9 CX{2}=zeros(n);
10 CX{3}=zeros(n);
11 x = fdx*([1:n(1)]-0.5);
12 y = fdy*([1:n(2)]-0.5);
13 [xx,yy]=ndgrid(x,y);
14 for k=1:n(3)
15     CX{1}(:,:,k)=xx;
16     CX{2}(:,:,k)=yy;
17     CX{3}(:,:,k)=p.zsf+p.ht_fmw(k);
18 end
19 W={p.u0_fmw,p.v0_fmw,p.w0_fmw};
20 plot_wind_3d(CX,W,[],[],20)