[MITgcm-support] Processing and visualising cubed sphere output

Martin Losch Martin.Losch at awi.de
Wed Oct 9 11:43:40 EDT 2024


Hi Flynn,

there are no more translations of matlab scripts that I know of other than what you find in tools/python/MITgcmutils

tools/python/MITgcmutils are (auto-)documented here: https://mitgcm.readthedocs.io/en/latest/utilities/utilities.html#utilities
( There’s an update in the pipeline, somehow stuck in the PR phase (https://github.com/MITgcm/MITgcm/pull/727), but you could still use that. )
The plotting routines for scalar fields are meant to work with rdmds output, most of them are related to the llc grid and may not be super useful for cubed sphere grids (although llc-grids are very similar)

If you dare to use xmitgcm (which seems to be the preferred way of reading not only large data sets), there’s also xgcm: https://xgcm.readthedocs.io/en/latest/ where there is some support for vector quantities. Initially, I found this to be difficult, but not unsurmountable for llc-grids. For cs-grids you’ll need to change the face_connections, but that should work then. E.g., for the grid class there’s method interp_2d_vector

Re-orientation, after interpolation to C-points, needs to be done with the grid fields AngleCS, AngleSN (cos/sin of grid north with geographical north), e.g. westward velocity = uVel*AngleCS - vVel*AngleSN (or with a plus, I never know).

Martin

> On 9. Oct 2024, at 15:49, Takaya Uchida <tu22 at fsu.edu> wrote:
> 
> Hi Flynn,
> 
> It seems that xmitgcm now supports cube-sphere grids: https://github.com/MITgcm/xmitgcm/pull/98
> I’ve personally never worked with cube-spheres but it might be worth a try.
> 
> Best,
> Takaya
> 
> 
> 
>> On Oct 9, 2024, at 8:06 AM, Flynn Ames <f.ames at pgr.reading.ac.uk> wrote:
>> 
>> Dear MITgcm community,
>> 
>> Hello - I've been attempting to use the cubed sphere topology in the MITgcm. I've managed to successfully run the model and produce output. However, I am having trouble processing the output for visualisation, namely with the velocity outputs. 
>> 
>> To cut to the chase, I was wondering if anyone could help with the following questions:
>> What are the steps to be taken to process outputs for ocean velocity (e.g., zonal, meridional components) so that they can be visualised?
>> Do translations for the existing MATLAB MITgcmutils cubed sphere library exist for Python?
>> 
>> As I understand it, velocity outputs need to first be re-orientated, because as outputted, they are orientated relative to the cube face that they are on. I have tried using the function 'rotate_uv2uvEN' (from MITgcmutils) for this. However, I find the function requires the velocity arrays to be a different shape than that outputted by the model. I'm therefore unsure if there are some preprocessing steps I need to take before this? Or if I have the wrong idea entirely?
>> 
>> Secondly, I noticed that the python library for cubed sphere (in MITgcmutils) has one function which is to plot a field (which in contrast to the MATLAB function I tried, did accept the velocity arrays in the shape outputted by the model). I'm curious to ask if any further python translations exist for the rest of the cubed sphere library? 
>> 
>> If any more information is required about my setup/intentions, I can definitely provide it!
>> 
>> Thanks in advance!
>> Flynn
>> _______________________________________________
>> MITgcm-support mailing list
>> MITgcm-support at mitgcm.org <mailto:MITgcm-support at mitgcm.org>
>> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support
> 
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20241009/929b19fb/attachment.html>


More information about the MITgcm-support mailing list