Home > omviz > w100.m

w100

PURPOSE ^

W100 calculates bottom velocity at 1 m above bottom from ECOM.cdf files

SYNOPSIS ^

function [w,x,y]=w100(cdf,itime);

DESCRIPTION ^

 W100 calculates bottom velocity at 1 m above bottom from ECOM.cdf files
     Method: law-of-the-wall profile is assumed, with z0 determined
     from the stored values of CD, or if CD was not stored, assumes
     z0=0.003 m

  Usage: [w,x,y]=w100(cdf,itime);

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [w,x,y]=w100(cdf,itime);
0002 % W100 calculates bottom velocity at 1 m above bottom from ECOM.cdf files
0003 %     Method: law-of-the-wall profile is assumed, with z0 determined
0004 %     from the stored values of CD, or if CD was not stored, assumes
0005 %     z0=0.003 m
0006 %
0007 %  Usage: [w,x,y]=w100(cdf,itime);
0008 %
0009 [sigma]=mcvgt(cdf,'sigma');
0010 n=length(sigma);
0011 w=ksliceuv(cdf,itime,n-1);
0012 [depth,x,y]=kslice(cdf,'depth');
0013 zr=depth*.5*(sigma(n-1)-sigma(n));
0014 
0015 % check to see if variable cd exists
0016 ncid=ncmex('open',cdf);
0017 [varid,rcode]=ncmex('varid',ncid,'cd');
0018 ncmex('close',ncid);
0019 
0020 % if cd doesn't exist or is all zeros, assume z0=0.003
0021 if(rcode~=0),
0022    z0=0.003; 
0023    cd=z0tocd(z0,zr);
0024 else  
0025    cd=kslice(cdf,'cd',itime);
0026    if(max(cd(:))==0),
0027        z0=.003;
0028        cd=z0tocd(z0,zr);
0029    else
0030        z0 = cdtoz0(cd,zr);
0031    end
0032 end
0033 ustar = sqrt(cd).*abs(w);
0034 ur = (ustar/0.4).*log(ones(size(zr))./z0);
0035 w=w.*(ur)./(abs(w)+eps);
0036 ind=find(depth==-99999.);
0037 w(ind)=w(ind)*nan;

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