[ecco-support] [EXTERNAL] Calculating transports with gcmfaces in Matlab
Wang, Ou (US 329B)
ou.wang at jpl.nasa.gov
Tue Jun 11 17:08:10 EDT 2024
Hi Samar,
Thank you for your clarification. Also, thanks to Hong for answering the question. Just want to add more to Hong’s answer.
Calling cumsum after call_transpports is necessary for the Matlab code to calculate the steam function. T from calc_transport is the transport for each vertical level. Cumsum gives the transport between a reference level (e.g., the ocean surface) and a specific vertical level, which is the stream function we normally talk about.
Also, if UVELMASS and VVELMASS are used as input arguments, ‘hfac’ should not be specified when calling calc_transports. This is because UVELMASS and VVELMMASS already contain the hFac effect. Specifying ‘hfac’ again when calling calc_transports is double counting.
Best,
Ou Wang
From: ecco-support <ecco-support-bounces at mit.edu> on behalf of Samar Khatiwala <samkat6 at gmail.com>
Date: Tuesday, June 11, 2024 at 1:09 PM
To: ECCO support list, wider membership <ecco-support at mit.edu>
Subject: Re: [ecco-support] [EXTERNAL] Calculating transports with gcmfaces in Matlab
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?
Thanks,
Samar
On Mon, Jun 10, 2024 at 5:09 PM Wang, Ou (US 329B) <ou.wang at jpl.nasa.gov<mailto:ou.wang at jpl.nasa.gov>> wrote:
Samar,
What are the two variables uTrans and vTrans in T=calc_transports(uTrans,vTrans,mygrid.LINES_MASKS,{'dh','dz','hfac'});?
The names suggest they are transport, but they should be UVELMASS.*mygrid.mskW and VVELMASS.*mygrid.mskS.
You may want to replace T=calc_transports(uTrans,vTrans,mygrid.LINES_MASKS,{'dh','dz','hfac'}) with the following:
uTrans = UVELMASS.*mygrid.mskW;
vTrans = VVELMASS.*mygrid.mskS;
T=calc_transports(uTrans,vTrans,mygrid.LINES_MASKS,{'dh','dz'});
Best regards,
Ou Wang
From: ecco-support <ecco-support-bounces at mit.edu<mailto:ecco-support-bounces at mit.edu>> on behalf of Samar Khatiwala <samkat6 at gmail.com<mailto:samkat6 at gmail.com>>
Date: Monday, June 10, 2024 at 2:59 AM
To: ECCO support list, wider membership <ecco-support at mit.edu<mailto:ecco-support at mit.edu>>
Subject: [EXTERNAL] [ecco-support] Calculating transports with gcmfaces in Matlab
Hello,
I'm trying to reproduce the calculations for the overturning streamfunction described on https://ecco-v4-python-tutorial.readthedocs.io/ECCO_v4_Example_OSNAP.html<https://urldefense.us/v3/__https:/ecco-v4-python-tutorial.readthedocs.io/ECCO_v4_Example_OSNAP.html__;!!PvBDto6Hs4WbVuu7!NGtdgDhELdz3kVixjJCZ0q9D_VYms1T7Hzzy8y1T4DYa0C8LDN7tENkuljBhQzluMQEaUo_MK2G514L6FD8$> 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:
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;
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?
Thanks,
Samar
_______________________________________________
ecco-support mailing list
ecco-support at mit.edu<mailto:ecco-support at mit.edu>
https://mailman.mit.edu/mailman/listinfo/ecco-support<https://urldefense.us/v3/__https:/mailman.mit.edu/mailman/listinfo/ecco-support__;!!PvBDto6Hs4WbVuu7!K9p7yEcuqlAxwLHVJokOErYxhIo9343y7SoVSOZCDu9C8T6NZMxz5hZS_d1udw3xsHrFU-xybqeKNq5njtw$>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mit.edu/pipermail/ecco-support/attachments/20240611/8c804059/attachment-0001.htm>
More information about the ecco-support
mailing list