Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts: other/Matlab/vis3d/wrfout2frame3d.m
- Loading branch information
Showing
2 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |