Skip to content

Commit

Permalink
Merge branch 'recover'
Browse files Browse the repository at this point in the history
Conflicts:
	other/Matlab/vis3d/wrfout2frame3d.m
  • Loading branch information
janmandel committed Aug 7, 2010
2 parents a914e20 + 0d492e9 commit 39df82b
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 2 deletions.
5 changes: 3 additions & 2 deletions other/Matlab/vis3d/frame3d.m
Expand Up @@ -44,7 +44,8 @@ function frame3d(swind,amin,amax,astep,qstep,qs,...
% surface wind arrows
if swind,
ii=dmin(1):qstep(1):dmax(1);jj=dmin(2):qstep(2):dmax(2);
hq=quiver3(fxlong(ii,jj),fxlat(ii,jj),zsf(ii,jj),xscale*uf(ii,jj),yscale*vf(ii,jj),zeros(size(vf(ii,jj))),qs);
hq=quiver3(fxlong(ii,jj),fxlat(ii,jj),zsf(ii,jj),...
xscale*uf(ii,jj),yscale*vf(ii,jj),zeros(size(vf(ii,jj))),qs);
set(hq,'Color','black')
end

Expand All @@ -64,7 +65,7 @@ function frame3d(swind,amin,amax,astep,qstep,qs,...
% atmosphere wind arrows
ia=amin(1):astep(1):amax(1);
ja=amin(2):astep(2):amax(2);
colors={'white','red','green','blue','black'};
colors={'red','green','blue','black'};
for k=amin(3):astep(3):amax(3),
q1=u(ia,ja,k)*xscale;
q2=v(ia,ja,k)*yscale;
Expand Down
48 changes: 48 additions & 0 deletions other/Matlab/vis3d/wrfout2frame3d.m
@@ -0,0 +1,48 @@
% function wrfout2frame3d(file,steps)
disp('1. file=''wrfout file''')
disp('2. steps=[1:20] % time steps to display')
disp('3. wrfout2frame3d')

fxlong =ncread(file,'FXLONG');
fxlat =ncread(file,'FXLAT');
xlong =ncread(file,'XLONG');
xlat =ncread(file,'XLAT');
zsf =ncread(file,'ZSF');
fgrnhfx=ncread(file,'FGRNHFX');
uf =ncread(file,'UF');
vf =ncread(file,'VF');
u =ncread(file,'U');
v =ncread(file,'V');
w =ncread(file,'W');
ph =ncread(file,'PH');
phb =ncread(file,'PHB');
hgt =ncread(file,'HGT');
itimestep=ncread(file,'ITIMESTEP');


% note the variables are read here without the WRF permutation of dimensions

amin=[15,15,1]; % the atm grid part to show
amax=[30,30,2];
amin=[10,10,1]; % the atm grid part to show
amax=[30,30,1];

qstep=[20,20]; % quiver step for wind on the surface fire grid
astep=[2,2,1]; % quiver step for wind on the atmosphere grid
qs=1; % scaling for quiver arrows, 0=default
swind=0; % do not display surface wind

%-------------------------------------------------

a=avifile('fire.avi');
for k=steps,
frame3d(swind,amin,amax,astep,qstep,qs,...
fxlong(:,:,k),fxlat(:,:,k),xlong(:,:,k),xlat(:,:,k),...
zsf(:,:,k),fgrnhfx(:,:,k),uf(:,:,k),vf(:,:,k),...
u(:,:,:,k),v(:,:,:,k),w(:,:,:,k),...
ph(:,:,:,k),phb(:,:,:,k),hgt(:,:,k))
title(['Timestep ',num2str(itimestep(k))])
F=getframe(gcf);
a=addframe(a,F);
end
a=close(a);

0 comments on commit 39df82b

Please sign in to comment.