From fa6df87d9bca25dd6d99ab9fa89df9f8ea2a3cfc Mon Sep 17 00:00:00 2001 From: Gustavo Marques Date: Wed, 23 Oct 2024 14:29:25 -0600 Subject: [PATCH] Avoid kbl > GV%ke in StokesMOST The calculation of kbl in StokesMOST could be > GV%ke. This patch avoids this issue. --- src/parameterizations/vertical/MOM_CVMix_KPP.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parameterizations/vertical/MOM_CVMix_KPP.F90 b/src/parameterizations/vertical/MOM_CVMix_KPP.F90 index f0ef355374..75d994fb6b 100644 --- a/src/parameterizations/vertical/MOM_CVMix_KPP.F90 +++ b/src/parameterizations/vertical/MOM_CVMix_KPP.F90 @@ -1376,7 +1376,7 @@ subroutine KPP_compute_BLD(CS, G, GV, US, h, Temp, Salt, u, v, tv, uStar, buoyFl CS%OBLdepth(i,j) = US%m_to_Z * KPP_OBL_depth if (CS%StokesMOST) then - kbl = nint(CS%kOBL(i,j)) + kbl = min(nint(CS%kOBL(i,j)), GV%ke) SLdepth_0d = CS%surf_layer_ext*CS%OBLdepth(i,j) surfBuoyFlux = surfBuoyFlux2(kbl) ! find ksfc for cell where "surface layer" sits