Skip to content

Enforce tracer diffusivity minimum (KHTR_MIN) at all depths#415

Merged
alperaltuntas merged 2 commits into
NCAR:dev/ncarfrom
gustavo-marques:khtr_min
Apr 2, 2026
Merged

Enforce tracer diffusivity minimum (KHTR_MIN) at all depths#415
alperaltuntas merged 2 commits into
NCAR:dev/ncarfrom
gustavo-marques:khtr_min

Conversation

@gustavo-marques
Copy link
Copy Markdown
Collaborator

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 diagnostics KhTr_u and KhTr_v.

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.

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

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 alperaltuntas merged commit e6fdf98 into NCAR:dev/ncar Apr 2, 2026
52 checks passed
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