Home > omviz > pomdemo.m

pomdemo

PURPOSE ^

POMDEMO an m-file to show a few examples of extracting data

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 POMDEMO an m-file to show a few examples of extracting data
 from POM.CDF, a Blumberg-Mellor type netCDF model output.

 Rich Signell (rsignell@usgs.gov)  3-22-95

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % POMDEMO an m-file to show a few examples of extracting data
0002 % from POM.CDF, a Blumberg-Mellor type netCDF model output.
0003 %
0004 % Rich Signell (rsignell@usgs.gov)  3-22-95
0005 
0006 %check version
0007 v=version;if(str2int(v(1))<5),disp('You need at least Matlab 5!'),return,end
0008 
0009 % Specify full path to the Blumberg/Mellor model netCDF file
0010 %
0011 cdf='pom.cdf';
0012 % Extract elevation and depth-averaged velocity from the 2nd
0013 % time step using KSLICE and DEPAVEUV
0014 %
0015 tind=2;
0016 var='elev';
0017 %
0018 [elev,x,y]=kslice(cdf,var,tind);
0019 jd1=ecomtime(cdf,tind);
0020 [w,x,y]=depaveuv(cdf,tind);
0021 %
0022 % plot the elevation slice using PSLICE
0023 %  and overlay the velocity vectors.
0024 figure(1)
0025 %
0026 pslice(x/1000,y/1000,elev);...    % convert x,y to km
0027 psliceuv(x/1000,y/1000,w,2,3000,'white');...
0028 date_str=greg2str(gregorian(jd1));...
0029 title(['Slice of ' var '  : ' date_str]);...
0030 xlabel('km');ylabel('km');
0031 
0032 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0033 figure(2);
0034 % extract a vertical E/W section (j slice) of V velocity component
0035 %       from the 2nd time step
0036 
0037 tind=2
0038 jindex=5
0039 var='v';
0040 [v,x,z]=jslice(cdf,var,tind,jindex);
0041 
0042 % contour the vertical section using contourf
0043 contourf(x,z,v);
0044 colormap(jet);...
0045 title(['Slice of ' var ' at j = ' int2str(jindex) ', tstep = ' int2str(tind)]);
0046 ylabel('Depth (m)');xlabel('Distance from Western Boundary (km)')
0047

Generated on Thu 01-Dec-2005 08:50:35 by m2html © 2003