Back to home page

MITgcm

 
 

    


Warning, /utils/matlab/cs_grid/latloncap/vel2latlon.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 [u_ll, v_ll] = vel2latlon( ca, sa, uvec, vvec )
                0002 % Project two orthogonal components onto another at angle phi
                0003 % where sa=sin(phi) and ca=cos(phi).
                0004 
                0005 for k = 1:size(uvec,3)
                0006   uvec_bari   = ( uvec(1:end-1,:,k) + uvec(2:end,:,k) )*0.5;
                0007   vvec_barj   = ( vvec(:,1:end-1,k) + vvec(:,2:end,k) )*0.5;
                0008   u_ll(:,:,k) = ca.*uvec_bari - sa.*vvec_barj;
                0009   v_ll(:,:,k) = ca.*vvec_barj + sa.*uvec_bari;
                0010 end
                0011 return
                0012 end