Skip to content

Diagnostic fixes to KE_adv, KPP_OBLdepth_original#957

Merged
adcroft merged 3 commits into
mom-ocean:dev/gfdlfrom
marshallward:diag_keadv_oblorig
Jul 22, 2019
Merged

Diagnostic fixes to KE_adv, KPP_OBLdepth_original#957
adcroft merged 3 commits into
mom-ocean:dev/gfdlfrom
marshallward:diag_keadv_oblorig

Conversation

@marshallward
Copy link
Copy Markdown
Collaborator

Fixes to two diagnostics:

  • Safer reproducibility of +/-0.0 for KE_adv
  • Conditional registration of KPP_OBLdepth_original

Details in commit logs.

The KE_adv diagnostic is a sum of values multiplied by -1, which will
assign a -0.0 value for zero-initialized states.  This can lead to
reproducibility problems for symmetric and nonsymmetric grids, since
many intermediate calculations rely on masking of the u field and do not
apply masks to subsequent steps.

This can occur when a MPP domain is bordered by land, where calculations
on the S and W boundaries of a symmetric grids are computed as if they
are unmasked, and would be assigned a -0.0 value.  For nonsymmetric
grids, these values were never computed and would retain a +0.0 value.

We resolve this by re-initalizing the KE_u and KE_v fields, since they
are re-used as buffers for several diagnostics, and exclude masked
points from the calculation.  This ensures +0.0 values in any land
boundaries across symmetric grids.

If the masking is applied to other fields using `KE_u` and `KE_v`, then
we may be able to remove the re-initialization step.

While +/-0.0 are arithmetically identical in all cases, this fix will
preserve bitwise reproducibility and is a step towards phasing out the
`abs()` operation in the checksums.
The diagnostic KPP_OBLdepth_original requires a nonzero CS%n_smooth
value, but it is currently possible to register this diagnostic even
when this parameter is unset.

This patch only registers the diagnostic when n_smooth is defined.
@marshallward
Copy link
Copy Markdown
Collaborator Author

marshallward commented Jul 22, 2019

GitLab testing: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/pipelines/8518


Internal testing has passed.

@adcroft adcroft merged commit 5358bca into mom-ocean:dev/gfdl Jul 22, 2019
@marshallward marshallward deleted the diag_keadv_oblorig branch July 25, 2019 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants