[ecco-support] [EXTERNAL] Calculating transports with gcmfaces in Matlab

Zhang, Hong (US 398K) hong.zhang at jpl.nasa.gov
Tue Jun 11 17:00:48 EDT 2024



> On Jun 11, 2024, at 1:08 PM, Samar Khatiwala <samkat6 at gmail.com> wrote:
> 
> Hi Ou,
> 
> Thanks for replying.
> 
> Sorry, my notation wasn't good. My uTrans and vTrans are in fact UVELMASS and VVELMASS.
> 
> If I use your code I get the same T as I did (since you pre mask it by omitting 'hfac') but T itself looks nothing like what is shown in the tutorial. So my question was more to do with doing a cumsum on T. It is done within the python calc_section_stf but not in the Matlab calc_transport (apart from the cumsum they seem to be doing the same calculation) and I'm confused by the difference in behavior. If I do a cumsum on T after calling calc_transport I get something more like in the tutorial but that could just be accidental and not for the right reason. What then is the correct way to reproduce the tutorial results using Matlab?
> 
>   lonPairs=[-44 -5;-56 -45];
> latPairs=[60 56;51 60];
> names={'OSNAP East','OSNAP West'};
> gcmfaces_lines_transp(lonPairs,latPairs,names);
> T=calc_transports(uTrans,vTrans,mygrid.LINES_MASKS,{'dh','dz','hfac'});
> psi_moc=cumsum(T')/1e6;
>  
Hi Samar,
The transport cross a section should be the sum in vertical direction
(Or the max value in vertical direction for MOC?).
I guess your returned T has size of (2,50,312),
So for East part  it’s
Transport_OSANP_East=nansum(squeeze(T(1,:,:)))
and 
Transport_OSNAP_West=nansum(squeeze(T(2,:,:)))

Hope it makes sense
Hong




More information about the ecco-support mailing list