From 14ad1ff99c5bbe5db7fec9e1d3ff38e14a90cf2d Mon Sep 17 00:00:00 2001 From: Patrick Scholz Date: Thu, 25 Jun 2026 14:11:18 +0200 Subject: [PATCH] Fix double diffusion density ratio using vertical gradients instead of absolute T/S ddmix computed alphaDT and betaDS from single-level absolute tracer values, making Rrho a ratio of absolute T and S rather than of their vertical density gradients. This triggered salt-fingering and diffusive-convection mixing continuously across virtually the entire ocean whenever double_diffusion=.true., regardless of actual stratification stability. Replace with the gradient form (T(nz-1)-T(nz), S(nz-1)-S(nz)) so that the scheme activates only at interfaces where the destabilising gradient exceeds the stabilising one, as the physics requires. Note: double diffusion is off by default (double_diffusion=.false.), so this bug has no effect on standard production runs. --- src/oce_ale_mixing_kpp.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/oce_ale_mixing_kpp.F90 b/src/oce_ale_mixing_kpp.F90 index c7204cd46..4a5976bc5 100755 --- a/src/oce_ale_mixing_kpp.F90 +++ b/src/oce_ale_mixing_kpp.F90 @@ -875,8 +875,8 @@ subroutine ddmix(diffK, tracers, partit, mesh) nzmin = ulevels_nod2D(node) nzmax = nlevels_nod2D(node) DO nz=nzmin+1,nzmax-1 - alphaDT = sw_alpha(nz-1,node) * tracers%data(1)%values(nz-1,node) - betaDS = sw_beta (nz-1,node) * tracers%data(2)%values(nz-1,node) + alphaDT = sw_alpha(nz-1,node) * (tracers%data(1)%values(nz-1,node) - tracers%data(1)%values(nz,node)) + betaDS = sw_beta (nz-1,node) * (tracers%data(2)%values(nz-1,node) - tracers%data(2)%values(nz,node)) IF (alphaDT > betaDS .and. betaDS > 0.0_WP) THEN