** Warning **

Issuing rollback() due to DESTROY without explicit disconnect() of DBD::mysql::db handle dbname=MITgcm at /usr/local/share/lxr/lib/LXR/Common.pm line 1224.

Last-Modified: Fri, 28 Nov 2024 06:11:57 GMT Content-Type: text/html; charset=utf-8 MITgcm/MITgcm/utils/matlab/cs_grid/latloncap/zmean.m
Back to home page

MITgcm

 
 

    


Warning, /utils/matlab/cs_grid/latloncap/zmean.m is written in an unsupported language. File is not indexed.

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
6a75a3b8ef Chri*0001 function bz =zmean(var,Zl)
                0002 % Sum a field in the vertical according to spacing Zl
                0003 % and divide by total spacing.
                0004 %
                0005 
                0006 bz=var(:,:,1).*0;
                0007 d=0.;
                0008 for k=1:size(var,3)
                0009  dd=(Zl(k)-Zl(k+1));
                0010  bz=bz+var(:,:,k).*dd;
                0011  d=d+dd;
                0012 end
                0013 bz=bz./d;
                0014 return 
                0015 end