1,2c1,2 < function [inflush,outflush]=xzflush(cdf,tstep,xind,yind); < %function [inflush,outflush]=xzflush(cdf,tstep,xind,yind); --- > function [inflush,outflush]=yzflush(cdf,tstep,xind,yind); > %function [inflush,outflush]=yzflush(cdf,tstep,xind,yind); 4c4 < % flux normal to the line i=xind --- > % flux normal to the line y=yind 7c7,8 < yind=1:68; --- > yind=xind; > xind=1:68; 9c10 < ny=length(yind); --- > nx=length(xind); 14c15 < u=mcvgt(cdf,'u',[tstep-1 0 yind(1)-1 xind-1],[1 nz ny 1]); --- > v=mcvgt(cdf,'v',[tstep-1 0 yind(1)-1 xind-1],[1 nz 1 nx]); 17,19c18,20 < sigma=(sigma'*ones(1,length(yind))); < d=mcvgt(cdf,'depth',[yind(1)-1 xind-1],[ny 2]); % get h2 at i=48,49 < d=mean(d'); %average h2 at elev points to get h2 at u points --- > sigma=(sigma'*ones(1,length(xind))); > d=mcvgt(cdf,'depth',[yind(1)-1 xind-1],[2 nx]); % > d=mean(d); %average depth at elev points to get depth at u points 23c24,25 < uflux=u.*sigma.*d2; --- > keyboard > vflux=v.*sigma.*d2; 27,31c29,34 < %uflux=uflux-m2flux; < h2=mcvgt(cdf,'h2',[yind(1)-1 xind-1],[ny 2]); % get h2 at i=48,49 < h2=mean(h2'); %average h2 at elev points to get h2 at u points < % multiply by h2 to get total flux < flux=uflux.*(ones(nz,1)*h2); % make sure we don't need to flip h2 --- > %vflux=vflux-v2flux; > % > h1=mcvgt(cdf,'h1',[yind(1)-1 xind-1],[2 nx]); % get h1 > h1=mean(h1); %average h1 at elev points to get h1 at v points > % multiply by h1 to get total flux > flux=vflux.*(ones(nz,1)*h1); % make sure we don't need to flip h1 34c37 < iout=find(flux>0); % flux out of bay --- > iout=find(flux>0); % flux in direction of increasing j index 36c39 < iin=find(flux<0); % flux in to bay --- > iin=find(flux<0); % flux in direction of decreasing j index 40c43 < din=sum(in); --- > din=sum(in); % southward flux 42,43c45,46 < y=cumsum(h2)/1000; < plot(y,[dout' -din' -(d*100)']); --- > x=cumsum(h1)/1000; > plot(x,[dout' -din' -(d*100)']); % increasing j flux, - decreasing j, depth 46c49 < xlabel(['distance along i=' int2str(xind) '(km)']) --- > xlabel(['distance along j=' int2str(yind) '(km)'])