mom-ocean / MOM5

The Modular Ocean Model
https://mom-ocean.github.io/
GNU Lesser General Public License v3.0
82 stars 96 forks source link

Clean up/generalise tracer-binning of tendency diagnostics #278

Open rmholmes opened 5 years ago

rmholmes commented 5 years ago

This issue is to highlight the need to clean up the rebinning routines that create the tendency diagnostics ***_on_nrho (and for example, the transports ***_trans_on_nrho). Currently for my temperature-binned heat budget diagnostics there is a hack in the code to set neutral density to temperature to bin these diagnostics. The problems with this are myriad: 1) It's a hack, 2) netcdf meta-data can be incorrect, 3) we can only bin according to one variable in any given run (there are some interesting science questions that could be addressed if we could bin in T & S at the same time).

One way to do this would be to generalise the diagnose_3d_rho and rebin_onto_rho routines to be able to bin onto a tracer chosen at the function call (e.g. pot. density, temperature, salinity), rather than just to whatever neutralrho is. We could then introduce new tendency diagnostics corresponding to each tracer (e.g. ***_on_pden, ***_on_temp, ***_on_salt), that call these functions with the appropriate tracer.

One problem with the above approach is that it introduces a large number of new diagnostics and lots of new code.

rmholmes commented 5 years ago

Another related minor side-issue is to do with the transports, which can be binned according to different variables at the same time (e.g. ty_trans_rho vs. ty_trans_nrho). In ocean_density there are variables potrho_min, potrho_max, neutralrho_min, neutralrho_max and layer_nk that set the discrete grids for potential density and neutral density. One should be able to use a different layer_nk for potential vs. neutral density. I have changes to implement this in my fork (https://github.com/rmholmes/MOM5/commit/74039ac4f1019a26adb8771e4066a1ad8f516b85), but it would require changes to everyones input.nml

rmholmes commented 5 years ago

Another additional change added to the wish list here: The ability to bin according to a tracer grid with unequal tracer bin sizes. This would be important for salinity where most of the ocean is within the range 30-40psu (requiring fine bin sizes), but there are regions where the salinity is much lower (which could be covered by low-resolution bins).