<div dir="ltr"><div dir="ltr">Hi Ou,<div><br></div><div>Thanks for replying.</div><div><br></div><div>Sorry, my notation wasn't good. My uTrans and vTrans are in fact UVELMASS and VVELMASS.</div></div><div><br></div>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?<div><br></div><div>Thanks,</div><div><br></div><div>Samar</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 10, 2024 at 5:09 PM Wang, Ou (US 329B) <<a href="mailto:ou.wang@jpl.nasa.gov">ou.wang@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"><div class="msg6348540906736887735">
<div lang="EN-US" style="overflow-wrap: break-word;">
<div class="m_6348540906736887735WordSection1">
<p class="MsoNormal"><span style="font-size:11pt">Samar,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">What are the two variables uTrans and vTrans in
</span><span style="font-size:11pt">T=calc_transports(uTrans,vTrans,mygrid.LINES_MASKS,{'dh','dz','hfac'});</span><span style="font-size:11pt">?
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">The names suggest they are transport, but they should be UVELMASS.*mygrid.mskW and VVELMASS.*mygrid.mskS.
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">You may want to replace</span><span style="font-size:11pt"> T=calc_transports(uTrans,vTrans,mygrid.LINES_MASKS,{'dh','dz','hfac'}) with the following:</span><span style="font-size:11pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">uTrans = </span><span style="font-size:11pt">UVELMASS.*mygrid.mskW;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">vTrans</span><span style="font-size:11pt"> = VVELMASS.*mygrid.mskS;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">T=calc_transports(uTrans,vTrans,mygrid.LINES_MASKS,{'dh','dz'});<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">Best regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">Ou Wang</span><span style="font-size:11pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<div id="m_6348540906736887735mail-editor-reference-message-container">
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(181,196,223);padding:3pt 0in 0in">
<p class="MsoNormal" style="margin-bottom:12pt"><b><span style="font-size:12pt;color:black">From:
</span></b><span style="font-size:12pt;color:black">ecco-support <<a href="mailto:ecco-support-bounces@mit.edu" target="_blank">ecco-support-bounces@mit.edu</a>> on behalf of Samar Khatiwala <<a href="mailto:samkat6@gmail.com" target="_blank">samkat6@gmail.com</a>><br>
<b>Date: </b>Monday, June 10, 2024 at 2:59</span><span style="font-size:12pt;font-family:Arial,sans-serif;color:black"> </span><span style="font-size:12pt;color:black">AM<br>
<b>To: </b>ECCO support list, wider membership <<a href="mailto:ecco-support@mit.edu" target="_blank">ecco-support@mit.edu</a>><br>
<b>Subject: </b>[EXTERNAL] [ecco-support] Calculating transports with gcmfaces in Matlab<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt">Hello,<u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-size:12pt"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt">I'm trying to reproduce the calculations for the overturning streamfunction described on <a href="https://urldefense.us/v3/__https:/ecco-v4-python-tutorial.readthedocs.io/ECCO_v4_Example_OSNAP.html__;!!PvBDto6Hs4WbVuu7!NGtdgDhELdz3kVixjJCZ0q9D_VYms1T7Hzzy8y1T4DYa0C8LDN7tENkuljBhQzluMQEaUo_MK2G514L6FD8$" target="_blank">https://ecco-v4-python-tutorial.readthedocs.io/ECCO_v4_Example_OSNAP.html</a>
with the Matlab version of gcmfaces. The OSNAP example described in the tutorial uses the python function calc_section_stf which returns 'psi_moc'. I can't quite figure out what the equivalent Matlab function is. The documentation refers to calc_overturn.m
and calc_transports.m, but the former returns transports for all (179) quasi-zonal lines, while the output of calc_transports is nowhere close to what is plotted in the tutorial. After looking through the python code the closest I've gotten is with: <u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-size:12pt"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt">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'});<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt">psi_moc=cumsum(T')/1e6;<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt">But I'm not confident this is correct. Can someone please tell me if this is right and if not what the correct way is?<u></u><u></u></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt">Thanks,<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt">Samar<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt"><u></u> <u></u></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
_______________________________________________<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>
</div></blockquote></div></div></div>