<div dir="ltr"><div>Hi Hong,</div><div><br></div><div>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.) </div><div><br></div><div>Ou: thanks, you're right I was double counting hfac.</div><div><br></div><div>Thank you both!</div><div><br></div><div>Best,</div><div><br>Samar</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 11, 2024 at 10:01 PM Zhang, Hong (US 398K) <<a href="mailto:hong.zhang@jpl.nasa.gov">hong.zhang@jpl.nasa.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
> On Jun 11, 2024, at 1:08 PM, Samar Khatiwala <<a href="mailto:samkat6@gmail.com" target="_blank">samkat6@gmail.com</a>> wrote:<br>
> <br>
> Hi Ou,<br>
> <br>
> Thanks for replying.<br>
> <br>
> Sorry, my notation wasn't good. My uTrans and vTrans are in fact UVELMASS and VVELMASS.<br>
> <br>
> 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?<br>
> <br>
> lonPairs=[-44 -5;-56 -45];<br>
> latPairs=[60 56;51 60];<br>
> names={'OSNAP East','OSNAP West'};<br>
> gcmfaces_lines_transp(lonPairs,latPairs,names);<br>
> T=calc_transports(uTrans,vTrans,mygrid.LINES_MASKS,{'dh','dz','hfac'});<br>
> psi_moc=cumsum(T')/1e6;<br>
> <br>
Hi Samar,<br>
The transport cross a section should be the sum in vertical direction<br>
(Or the max value in vertical direction for MOC?).<br>
I guess your returned T has size of (2,50,312),<br>
So for East part it’s<br>
Transport_OSANP_East=nansum(squeeze(T(1,:,:)))<br>
and <br>
Transport_OSNAP_West=nansum(squeeze(T(2,:,:)))<br>
<br>
Hope it makes sense<br>
Hong<br>
<br>
<br>
_______________________________________________<br>
ecco-support mailing list<br>
<a href="mailto:ecco-support@mit.edu" target="_blank">ecco-support@mit.edu</a><br>
<a href="https://mailman.mit.edu/mailman/listinfo/ecco-support" rel="noreferrer" target="_blank">https://mailman.mit.edu/mailman/listinfo/ecco-support</a><br>
</blockquote></div></div>