From 7951a843612a76ec57d818bf190429c3c53fddfc Mon Sep 17 00:00:00 2001 From: "denise.worthen" Date: Tue, 31 Dec 2019 19:31:38 +0000 Subject: [PATCH] fix divide by zero --- src/user/MOM_wave_interface.F90 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/user/MOM_wave_interface.F90 b/src/user/MOM_wave_interface.F90 index 0da6285f37..042df7c02f 100644 --- a/src/user/MOM_wave_interface.F90 +++ b/src/user/MOM_wave_interface.F90 @@ -1069,10 +1069,14 @@ subroutine get_StokesSL_LiFoxKemper(ustar, hbl, GV, US, UStokes_SL, LA) sqrt( 2.0 * PI *kstar * z0) * & erfc( sqrt( 2.0 * kstar * z0 ) ) UStokes_sl = UStokes * (0.715 + r1 + r2 + r3 + r4) - LA = sqrt(US%Z_to_m*US%s_to_T*ustar / UStokes_sl) - else - UStokes_sl = 0.0 - LA=1.e8 + if(UStokes_sl .ne. 0.0)then + LA = sqrt(US%Z_to_m*US%s_to_T*ustar / UStokes_sl) + else + LA=1.e8 + endif + !else + ! UStokes_sl = 0.0 + ! LA=1.e8 endif end subroutine Get_StokesSL_LiFoxKemper