[ecco-support] [EXTERNAL] Calculating transports with gcmfaces in Matlab
Samar Khatiwala
samkat6 at gmail.com
Wed Jun 12 05:04:32 EDT 2024
Hi Hong,
Thanks for the clarification. That's correct, my T has dimensions of 2 x 50
x (number of time slices). Just to be clear, I'm trying to reproduce the
figures in the tutorial so, as Ou notes, I think cumsum rather than sum is
what I need, specifically squeeze(max(cumsum(T,2),[],2)). (A sum produces
values of the wrong sign and magnitude.)
Ou: thanks, you're right I was double counting hfac.
Thank you both!
Best,
Samar
On Tue, Jun 11, 2024 at 10:01 PM Zhang, Hong (US 398K) <
hong.zhang at jpl.nasa.gov> wrote:
>
>
> > 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
>
>
> _______________________________________________
> ecco-support mailing list
> ecco-support at mit.edu
> https://mailman.mit.edu/mailman/listinfo/ecco-support
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mit.edu/pipermail/ecco-support/attachments/20240612/f80302ad/attachment.htm>
More information about the ecco-support
mailing list