Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve slope calculation and fix slope limiting for redi mixing #5947

Conversation

vanroekel
Copy link
Contributor

@vanroekel vanroekel commented Sep 21, 2023

In current MPAS code, slopes are altered directly, e.g. when S > Scrit it is set to zero. Griffies et al 1998 (Appendix C) equates this to slope clipping. The correct approach is to taper the redi kappa coefficient for each individual flux instead. The cross terms ("term2" and "term 3") end up being identical as they are d/dz(kappa S grad phi) so tapering kappa or S are identical. However for the vertical it is d/dz(kappa |S|^2 d phi / dz) so tapering S is different from tapering kappa. Also term 1 (laplacian diffusion) was not being tapered with slopes creating a cross isopycnal flux in steeply sloping regions. These issues are fixed here.

In addition a new slope calculation from @dengwirda is introduced to prevent the slopes from getting very large when grad phi or d/dz(phi) get small. This function limits the slope to be between -1 and 1.

See initial discussion at E3SM-Ocean-Discussion#65.

[CC]

vanroekel and others added 4 commits September 21, 2023 16:36
This changes tapering on the redi terms to be fully on the slopes
themselves and fixes a bug where k33 slopes are tapered by the square
and not linearly.  A 'safe slope' calculation is also introduced to
bound slopes from -1 to 1.
the redi n2 based limiter options are removed from the namelist and the
term1 limiter name is changed to reference tapering not just the n2
based tapering for clarity
@vanroekel vanroekel added mpas-ocean CC PR is climate changing labels Sep 21, 2023
@vanroekel
Copy link
Contributor Author

@jonbob in addition to the new defaults in the registry I would suggest we change the default for config_Redi_min_layers_diag_terms to zero instead of 6. I think that capability is no longer needed with the new quasi monotone implementation. Let me know if you want me to push the new default to the registry.

@mark-petersen and/or @dengwirda what are your thoughts on removing the diagonal term disable config? I recall that was introduced to prevent extrema so I'm thinking we could remove that capability now, but it would be easier to keep it but set that value to zero

@xylar
Copy link
Contributor

xylar commented Sep 22, 2023

@vanroekel, could you give this PR a meaningful title when you have a chance?

@vanroekel vanroekel changed the title Vanroekel/ocean/change redi slopes and limiter Improve slope calculation and fix slope limiting for redi mixing Sep 22, 2023
@dengwirda
Copy link
Contributor

@vanroekel I agree re: updating the defaults to config_Redi_min_layers_diag_terms = 0, and added some discussion in #5945. I don't think there's a lot of computational cost associated with having config_Redi_min_layers_diag_terms in the code though, so no problem keeping it there for compatibility I'd say.

@mark-petersen
Copy link
Contributor

Removed some unused initializations of RediKappa Scaling. With that, the three ocean PRs can merge and pass the nightly test suite, as described in #5945 (comment).

@mark-petersen
Copy link
Contributor

On #5947 (comment), I would change the default to config_Redi_min_layers_diag_terms=0 but leave in the flag in case we need it for experimentation.

Copy link
Contributor

@mark-petersen mark-petersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, based on code review, discussion, and simulation results.

@rljacob rljacob added this to the v3.0alpha05 milestone Oct 12, 2023
jonbob added a commit that referenced this pull request Oct 24, 2023
…xt (PR #5947)

Improve slope calculation and fix slope limiting for redi mixing

In current MPAS code, slopes are altered directly, e.g. when S > Scrit
it is set to zero. Griffies et al 1998 (Appendix C) equates this to
slope clipping. The correct approach is to taper the redi kappa
coefficient for each individual flux instead. The cross terms ("term2"
and "term 3") end up being identical as they are d/dz(kappa S grad phi)
so tapering kappa or S are identical. However for the vertical it is
d/dz(kappa |S|^2 d phi / dz) so tapering S is different from tapering
kappa. Also term 1 (laplacian diffusion) was not being tapered with
slopes creating a cross isopycnal flux in steeply sloping regions.
These issues are fixed here.

In addition a new slope calculation from @dengwirda is introduced to
prevent the slopes from getting very large when grad phi or d/dz(phi)
get small. This function limits the slope to be between -1 and 1.

[NML]
[CC]
@jonbob
Copy link
Contributor

jonbob commented Oct 24, 2023

merged to next, along with PR #5945 and PR #5946. Passes sanity testing but DIFFs as expected

@jonbob jonbob merged commit 0b367fb into E3SM-Project:master Oct 26, 2023
2 checks passed
@jonbob
Copy link
Contributor

jonbob commented Oct 26, 2023

merged to master

@jonbob
Copy link
Contributor

jonbob commented Oct 26, 2023

expected DIFFs and NML DIFFs from the set of PRs are blessed

xylar added a commit to xylar/compass that referenced this pull request Dec 3, 2023
This merge updates the E3SM-Project submodule from [894b5b2](https://github.com/E3SM-Project/E3SM/tree/894b5b2) to [5d5f15c](https://github.com/E3SM-Project/E3SM/tree/5d5f15c).

This update includes the following MPAS-Ocean and MPAS-Frameworks PRs (check mark indicates bit-for-bit with previous PR in the list):
- [ ]  (ocn) E3SM-Project/E3SM#5945
- [ ]  (ocn) E3SM-Project/E3SM#5946
- [ ]  (ocn) E3SM-Project/E3SM#5947
- [ ]  (ocn) E3SM-Project/E3SM#5999
- [ ]  (ocn) E3SM-Project/E3SM#6037
- [ ]  (ocn) E3SM-Project/E3SM#5989
- [ ]  (ocn) E3SM-Project/E3SM#6035
- [ ]  (ocn) E3SM-Project/E3SM#6077
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CC PR is climate changing mpas-ocean
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants