hdrake / xwmb

xWMB is a Python package that provides a efficient and lazy computation of Water Mass Budgets in arbitrary sub-domains of C-grid ocean models.
7 stars 2 forks source link

Compute horizontal mass transport convergence directly from volume integral rather than surface integral #10

Open hdrake opened 1 year ago

hdrake commented 1 year ago

@klindsay28 pointed out that his proposed changes in https://github.com/NCAR/MOM6/pull/215, which fix existing inconsistencies between state differences and time-integrated budgets when they are posted to diagnostics grids, do not extend to mass/tracer fluxes, which are defined by both of the adjacent layer thicknesses and it is thus less clear which thickness to use to consistently re-map them.

This will affect our calculations of the convergent horizontal mass transport, which we are currently computed using surface integrals of the flux. A more self-consistent approach would be to more directly use volume-integrals the convergent mass flux diagnostics (i.e. dhdt_dynamics), although we will of course lose spatial information about where these fluxes occur along the region's boundary.

Probably the more consistent volume integrals should be made the default. However, I think we should support the not-exactly-correct (but still likely scientifically valuable) surface integral calculations via an optional keyword argument.

One benefit is that this will probably actually speed up water mass budget calculations in most cases because finding the indices and masks for the surface integrals (w/ sectionate) seems to currently be the performance bottle-neck.