Plotting ocean variables in density coordinates (using xhistogram)

Hi Julius, thanks for the questions.

Small teams that communicate with each other when they are stuck is probably the most efficient way to go, so assuming we get the number of people who are signed up for this project, we probably should split up a bit. (also even for I large team, wrapping fortran code to work here may be a multi-day project and not the best use of time for those most interested in exploring the science)

I am thinking we will wrap some adapted portion of layers_fluxcalc.F in the MITgcm code. I will lead/co-lead a group to do this. If we have people who want to move ahead with xhistogram then they can split off and I am happy to spend time with them getting the technicalities working - that group would also be more linked to Water Masses of the Future.

Perhaps overkill, but maybe a good foundation for this here. It seems to me that this more relevant when considering snapshots or short averages?

1 Like

Also regarding the lingo: They define regridding as the step of finding the new depth levels based on another coordinate and remapping as the step to transform the scalar values from the original to target grid in a conservative manner.
I think that helps tightening up some of the discussion.

Though Ryan is right, it probably wonā€™t matter much to use EOS-10 instead of the model specific EOS, it might matter for some cases, especially in investigating deep water masses. I suspect it would be best to use native EOSs where possible. They will also be faster, since they are generally simpler, though this is probably not the primary computational bottleneckā€¦

I would propose that a side project of this overall project could be to create a library of ocean model EOSs that could be used where appropriate. An easy approach would be to take the native FORTRAN or C files and compile them with f2py. A better approach would be to translate into native python that would take numpy (or xarray) arrays. Still probably not that much work.

[edit] I see I wrote too soon, and this was also proposed above by @dhruvbalwada:

Equation of state: Not all CMIP6 models use the same equation of state. I propose that we collate any python packages for finding density from temperature and salinity in CMIP6 models, and write a small package that takes an input of the variables needed to find density and an arbitrary variable that the user wants to transform into density space. The package would pass the required info to xhistogram and return that variable in density space.

I think this is a good idea. I would love it if you or someone else could lead this. Can you clarify where you think this FORTRAN /C code can be found? This was what put me off from doing this. We can talk further in the #vertical-coordinates slack channel.

You can find the EOS in the source files for the various models. E.g., for ROMS, or as a matlab script.

There seem to be quite a few options coded up in MOM6, so this might be one-stop shopping.

There are not that many simplified EOSs so I expect that coding up a few will handle most ocean models.