Skip to content

Commit

Permalink
fix divide by zero in wave_interface which allows for running in debu…
Browse files Browse the repository at this point in the history
…g mode for NEMS (#12)
  • Loading branch information
DeniseWorthen authored and JessicaMeixner-NOAA committed Jan 13, 2020
1 parent cb79e97 commit 8c23ae9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/user/MOM_wave_interface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,8 @@ subroutine get_StokesSL_LiFoxKemper(ustar, hbl, GV, US, UStokes_SL, LA)
real :: z0, z0i, r1, r2, r3, r4, tmp, lasl_sqr_i
real :: u10

UStokes_sl = 0.0
LA=1.e8
if (ustar > 0.0) then
! Computing u10 based on u_star and COARE 3.5 relationships
call ust_2_u10_coare3p5(US%Z_to_m*US%s_to_T*ustar*sqrt(GV%Rho0/1.225), u10, GV, US)
Expand Down Expand Up @@ -1069,10 +1071,7 @@ 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)LA = sqrt(US%Z_to_m*US%s_to_T*ustar / UStokes_sl)
endif

end subroutine Get_StokesSL_LiFoxKemper
Expand Down

0 comments on commit 8c23ae9

Please sign in to comment.