Closed gustavo-marques closed 1 year ago
Patch coverage: 39.86%
and project coverage change: +1.02%
:tada:
Comparison is base (
47f737f
) 37.06% compared to head (eedb892
) 38.09%. Report is 1 commits behind head on dev/ncar.:exclamation: Current head eedb892 differs from pull request most recent head c57789f. Consider uploading reports for the commit c57789f to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@alperaltuntas, please merge https://github.com/NCAR/MOM6/pull/248 before this PR.
This PR adds all the changes needed to convert tracer diffusivities from 2D to 3D (adding vertical dimension). Code changes were needed in the following modules:
MOM_tracer_hor_diff
,MOM_neutral_diffusion
, andMOM_hor_bnd_diffusion
.The first step (36c1e266b38414b89a759b68952144123d8968dd) was to add a vertical dimension to the tracer diffusivities (
Kh_u
andKh_v
) and associated coefficients (coef_x
andcoef_y
). DiagnosticsKhTr_u
,KhTr_v
, andKhTr_h
were changed from 2D (lat/lon) to 3D (lat/lon/depth). To preserve old answers, the values of all modified arrays are depth independent by default. The option to apply the equivalent barotropic structure as the vertical structure of the tracer diffusivity is also introduced. This can be controlled via a new parameter:KHTR_USE_EBT_STRUCT
(default is false).Following up on the above commit, module
MOM_hor_bnd_diffusion
was modified to work with 3D tracer diffusivities (a588033727ea2e366d3893fe7670b1cda16cb03e). Parameterkhtr_u
(diffusivity times the time step) is now calculated at cell centers and then remapped onto the HBD vertical grid. All unit tests in this module were updated to conform with this change.Lastly, module
MOM_neutral_diffusion
was also modified to work with 3D tracer diffusivities (27518f750f83697c97b4caee718314856cae259f). When the diffusivities are depth dependent (KHTR_USE_EBT_STRUCT=True
), a new array (Coef_h
, with values at tracer points and vertical interfaces) with a four-point average betweenCoef_x
andCoef_y
is introduced. This array is then used to calculate zonal and meridional neutral fluxes via optional arguments and using an existing four-point average (vertical interfaces of two tracer cells) inside subroutine neutral_surface_flux. The same approach is already used when tapering the neutral diffusive fluxes. In this case, however, the unit of the output from neutral_surface_flux (Flx
) is modified because the flux of the tracer between pairs of neutral layers is multiplied by the average ofCoef_h
. To avoid double countingCoef_h
, the code block for updating the tracer concentration from divergence of neutral diffusive flux components also had to be modified for whenKHTR_USE_EBT_STRUCT=True
. Similarly for diagnosticstrans_x_2d
andtrans_y_2d
.By default (
KHTR_USE_EBT_STRUCT = False
) all answers are bitwise identical.Testing: pr_mom fails because
KhTr_u
,KhTr_v
, andKhTr_h
were changed from 2D (lat/lon) to 3D (lat/lon/depth).ocean.stats
remains bit-wise identical.