Bugfix: Pure pot. density coord diags w/ one layer#948
Merged
Conversation
For experiments with a single layer (e.g. unit_tests), the "pure potential density coordinate" diagnostics (h_Rlay, uh_Rlay, ...) would apply an interpolation to extend values into the mixed layers. However, most of this subroutine assumes at least two layers, including some "nz / 2" divisions which reduce to zero, and memory accesses to levels greater than nz. Overall, this calculation does not make much sense when there is one layer, for both physical and computational reasons. Normally the `nkmb` parameter is changed from zero to `nz` when not in isopycnal mode, applying the interpolation across the entire column, which avoids the interpolating loops and simply transfers the layered values to the diagnostic. We resolve this issue by only apply "nkmb = z" when there is more than one layer, and transfer values regardless of the mode.
Collaborator
Author
|
GitLab test running here: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/pipelines/8454 It includes a merge of the latest dev/gfdl update. |
Hallberg-NOAA
pushed a commit
to Hallberg-NOAA/MOM6
that referenced
this pull request
Aug 6, 2025
* (*) Add option for minmod limiter for RayTracing This PR adds a minmod limiter option for the advection of the internal tides energy, which becomes the new default. The current positive definite scheme is kept as an option but has shown to create ripples at the grid scale. * change adv_limiter options from string to integer --------- Co-authored-by: Raphael Dussin <Raphael.Dussin@noaa.gov>
herrwang0
pushed a commit
to herrwang0/MOM6
that referenced
this pull request
Aug 27, 2025
* (*) Add option for minmod limiter for RayTracing This PR adds a minmod limiter option for the advection of the internal tides energy, which becomes the new default. The current positive definite scheme is kept as an option but has shown to create ripples at the grid scale. * change adv_limiter options from string to integer --------- Co-authored-by: Raphael Dussin <Raphael.Dussin@noaa.gov>
Hallberg-NOAA
pushed a commit
to Hallberg-NOAA/MOM6
that referenced
this pull request
Aug 29, 2025
* (*) Add option for minmod limiter for RayTracing This PR adds a minmod limiter option for the advection of the internal tides energy, which becomes the new default. The current positive definite scheme is kept as an option but has shown to create ripples at the grid scale. * change adv_limiter options from string to integer --------- Co-authored-by: Raphael Dussin <Raphael.Dussin@noaa.gov>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For experiments with a single layer (e.g. unit_tests), the "pure
potential density coordinate" diagnostics (h_Rlay, uh_Rlay, ...) would
apply an interpolation to extend values into the mixed layers. However,
most of this subroutine assumes at least two layers, including some "nz
/ 2" divisions which reduce to zero, and memory accesses to levels greater
than nz.
Overall, this calculation does not make much sense when there is one
layer, for both physical and computational reasons.
Normally the
nkmbparameter is changed from zero tonzwhen not inisopycnal mode, applying the interpolation across the entire column,
which avoids the interpolating loops and simply transfers the layered
values to the diagnostic.
We resolve this issue by only apply
nkmb = nzwhen there is more thanone layer, and transfer values regardless of the mode.