/[MITgcm]/MITgcm_contrib/gag_subduction_scripts/get_mldvel.m
ViewVC logotype

Contents of /MITgcm_contrib/gag_subduction_scripts/get_mldvel.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Wed Apr 21 21:12:13 2004 UTC (20 years ago) by gebbie
Branch: MAIN
CVS Tags: HEAD
Added some diagnostics for Eulerian maps, and some utilities.

1 function [ustar,vstar,wstar] = get_mldvel(u,v,w,delZ,h)
2 %function [ustar,vstar,wstar] = get_mldvel(u,v,w,delZ,h)
3 %
4 % Get velocity at a surface h = h(x,y).
5 % Velocity remains on the C-grid with depths "depth".
6 %
7 % Started: D. Jamous, 1996, FORTRAN diags.
8 %
9 % Translated: G. Gebbie, MIT-WHOI, November 2003.
10
11 [nx,ny,nz]=size(u);
12
13 ustar = zeros(nx,ny);
14 vstar = zeros(nx,ny);
15 wstar = zeros(nx,ny);
16
17 zbot = cumsum(delZ);
18
19 depth = get_depths(delZ);
20
21 for i=2:nx-1
22 for j=2:ny-1
23 ustar(i,j) = interp1( depth, sq(u(i,j,:)),(h(i,j)+h(i-1,j))./2,'linear');
24 vstar(i,j) = interp1( depth, sq(v(i,j,:)),(h(i,j)+h(i,j-1))./2,'linear');
25 end
26 end
27 for i=1:nx-1
28 for j=1:ny-1
29 wstar(i,j) = interp1( sq(zbot(1:23)), sq(w(i,j,:)), h(i,j), 'linear');
30 end
31 end
32
33 ustar(isnan(ustar))= 0;
34 vstar(isnan(vstar))= 0;
35 wstar(isnan(wstar))= 0;

  ViewVC Help
Powered by ViewVC 1.1.22