MOM5 icon indicating copy to clipboard operation
MOM5 copied to clipboard

Tendency diagnostics for separate components of vertical diffusivity

Open rmholmes opened this issue 6 years ago • 4 comments

Hi everyone,

As part of my diathermal work I added diagnostics to separately diagnose the diffusivities and tracer tendencies due to the different vertical diffusivity components (e.g. KPP shear, BL, convection etc and the tidal components wave, leewave, drag). Fabio has also been using these, and added similar code for diff_cbt_back. The changes including Fabio's are in the diagnose_kppdiff_comps branch of my fork, also see the commit message here for more info.

Would there be any interest in adding these changes to the main MOM5 repo? Perhaps not, given the chatter on bringing in cvmix on the Langmuir pull request #229 ?

In any case, I thought I'd put this marker here in case anyone is looking for something like this in the future.

If this does end up getting used, I'd like someone who knows more about memory usage to check my changes - I'm worried that passing arrays into ocean_vert_kpp_mom4p1 for each separate diffusivity component (even if the diagnostics aren't on) may be using unnecessary memory. I've had no problems with my MOM025-SIS and ACCESS-OM2 runs, but I haven't tried at 1/10th-degree yet.

rmholmes avatar Aug 07 '18 01:08 rmholmes

I've had a quick look at that commit and I reckon you would be better served by creating a derived type containing all the (allocatable) components that you want. It would clean up the interfaces and you won't have to worry about changing things every time you add a new diagnostic.

russfiedler avatar Aug 07 '18 02:08 russfiedler

Ok thanks for the suggestion Russ.

rmholmes avatar Aug 07 '18 03:08 rmholmes

I am a huge fan of these new diagnostics. Although we may be developing a new kpp_cvmix module in the near future, your code (when cleaned as per Russ's suggestion) could serve as a great framework/example for implementing similar diagnostics elsewhere.

As per Russ's suggestion, if you have a derived type for the new diags, you could (presumably) write the code so to allocate the diagnostic arrays only when needed when enabling diagnostics that you turn on.

I thus recommend pursuing a clean-up and full documentation (i.e., good comments) of your code so that future analysts can understand the code and implement elsewhere if they wish.

StephenGriffies avatar Aug 07 '18 09:08 StephenGriffies

Ok thank you Steve. I will give this a go.

rmholmes avatar Aug 08 '18 00:08 rmholmes