From 3534d1c1b20a8b947a5985dd31f455fe77ab252f Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Thu, 6 Feb 2020 15:23:02 -0700 Subject: [PATCH] Rework faulty logic to be clearer --- src/shared/cvmix_kpp.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/shared/cvmix_kpp.F90 b/src/shared/cvmix_kpp.F90 index f7f0dd061..9c06b35f6 100644 --- a/src/shared/cvmix_kpp.F90 +++ b/src/shared/cvmix_kpp.F90 @@ -1469,11 +1469,11 @@ subroutine cvmix_kpp_compute_OBL_depth_low(Ri_bulk, zw_iface, OBL_depth, & ! Column is stable if surf_buoy > 0 lstable = (surf_buoy.gt.cvmix_zero) - if (Coriolis.eq.cvmix_zero .and. .not. lstable) then !should not apply in unstable conditions - ! Rather than divide by zero, set Ekman depth to ocean bottom - Ekman = abs(zt_cntr(nlev)) - else + if (Coriolis.ne.cvmix_zero .and. lstable) then Ekman = 0.7_cvmix_r8*surf_fric/abs(Coriolis) + else + ! Rather than divide by zero (or if column is unstable), set Ekman depth to ocean bottom + Ekman = abs(zt_cntr(nlev)) end if OBL_limit = min(OBL_limit, Ekman) end if