NOAA-GFDL / MOM6

Modular Ocean Model
Other
25 stars 58 forks source link

Added diagnostics separating resolved and parameterized tracer advection (requesting feedback) #689

Open pittwolfe opened 3 months ago

pittwolfe commented 3 months ago

I've added diagnostics that report tracer advection due to resolved (Tr_ad[x/y]_resolved) and parameterized (Tr_ad[x/y]_param) transport separately. The modifications "work" in the sense that existing answers are unchanged in the (limited) set of tests I've done and the output doesn't look obviously wrong. I'm hoping to get some feedback on my approach before I get into more aggressive testing in case I need to refactor everything.

The modifications are in the GM_tracer_diags branch of my MOM6 fork.

My approach is:

Some possibly safer approaches that avoid modifying the core advection routines:

  1. Add new routines to calculate advection for the resolved and parameterized transport. Downside: would require updating all the advection routines any time one of them is changed.
  2. Call unmodified advect_tracer with fake versions of the tracer registry and diagnostics control structures. The relevant tracers would be copied into the fake tracer registry, avoiding updates to the prognostic tracer fields. The fake diagnostics control structure would make sure that the correct diagnostics are updated. Downside: seemed harder to code because I don't fully understand the inner workings of the tracer registry.

I'd be willing to pursue option 2, but if the current approach is considered good enough I won't bother.

Thanks in advance for any feedback.

gustavo-marques commented 3 months ago

@pittwolfe, thank you very much for adding this capability!

I went through your code, and I do not have major suggestions. A minor suggestion is to change flux_type_ to something else that does not end with _ (suggestion: flux_type_ctrl). Are the new diagnostics available when no parameterization is used?

Once this is ready for more aggressive testing, I will happily test it in CESM.

pittwolfe commented 3 months ago

@gustavo-marques: Changed flux_type_ to flux_type_ctrl.

The diagnostics are available when no parameterization is used, although no calculations are done unless the diagnostics are requested in diag_table. If no parameterizations are active, the parameterized flux ought to be zero (need to verify), which is a reasonable behavior.

pittwolfe commented 2 months ago

@gustavo-marques I've done a bit more testing and everything seems to be working. You're welcome to test it in CESM.

The version of MOM6 used by CESM (we've been using CESM2.3beta16) is sufficiently different that I had to manually transfer the code modifications. The version in the repository GM_tracer_diags_20210709 is in sync with MOM6 tag NCAR_20210709, which is the version used in CESM2.3beta16.

The version in GM_tracer_diags is just a few commits behind NOAA-GFDL/MOM6.