Enforce tracer diffusivity minimum (KHTR_MIN) at all depths#415
Merged
Conversation
Enforce the minimum tracer diffusivity throughout the entire water column when using a vertically varying diffusivity structure (KHTR_USE_EBT_STRUCT=True). Parameter, FULL_DEPTH_KHTR_MIN (default: .false.), controls whether KHTR_MIN is applied as a lower bound at all depths. When FULL_DEPTH_KHTR_MIN=True, KHTR_MIN is enforced at every depth level for Coef_x, Coef_y, Kh_u, Kh_v, and Kh_h. When FULL_DEPTH_KHTR_MIN=False (default), the previous behavior is retained: the vertical structure uses VarMix%ebt_struct instead of VarMix%khtr_struct for Coef_x/Coef_y, and KHTR_MIN is only enforced at the surface. Motivation: When using vertically varying tracer diffusivity (KHTR_USE_EBT_STRUCT=True), KHTR_MIN was previously enforced only in the surface layer. This could result in very weak or near-zero diffusivity in the ocean interior. The new option allows users to enforce a minimum diffusivity throughout the water column. FULL_DEPTH_KHTR_MIN is only read and applied when both KHTR_USE_EBT_STRUCT=True and KHTR_MIN > 0.
alperaltuntas
approved these changes
Apr 2, 2026
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.
This PR enforces the minimum tracer diffusivity throughout the entire water column when using a vertically varying diffusivity structure (
KHTR_USE_EBT_STRUCT=True). The previous implementation missed updating the neutral diffusion part and the diagnosticsKhTr_uandKhTr_v.Parameter
FULL_DEPTH_KHTR_MIN(default = False) controls whetherKHTR_MINis applied as a lower bound at all depths. WhenFULL_DEPTH_KHTR_MIN=True,KHTR_MINis enforced at every depth level forCoef_x,Coef_y,Kh_u,Kh_v, andKh_h. WhenFULL_DEPTH_KHTR_MIN=False(default), the previous behavior is retained: the vertical structure uses VarMix%ebt_struct instead of VarMix%khtr_struct for Coef_x/Coef_y, andKHTR_MINis only enforced at the surface.Motivation:
When using vertically varying tracer diffusivity (
KHTR_USE_EBT_STRUCT=True),KHTR_MINwas previously enforced only in the surface layer. This could result in very weak or near-zero diffusivity in the ocean interior. The new option allows users to enforce a minimum diffusivity throughout the water column.FULL_DEPTH_KHTR_MINis only read and applied when bothKHTR_USE_EBT_STRUCT=TrueandKHTR_MIN > 0.Changes answer for pr_mom, but passes other tests:
/glade/derecho/scratch/gmarques/cesm.tests/pr_mom/cesm3_0_alpha08g--khtr_min.intel/cs.status.20260312_154108_figy5w