Skip to content

Commit

Permalink
Do full denominator check to avoid possible divide-by-zero. #194
Browse files Browse the repository at this point in the history
  • Loading branch information
nichannah committed Jul 17, 2015
1 parent 31ebcba commit 5f9a61f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/parameterizations/vertical/MOM_set_diffusivity.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1653,10 +1653,10 @@ subroutine add_LOTW_BBL_diffusivity(h, u, v, tv, fluxes, visc, j, N2_int, G, CS,

! Diffusivity using law of the wall, limited by rotation, at height z, in m2/s.
! This calculation is at the upper interface of the layer
if (D_minus_z /= 0.) then
Kd_wall = ( ( von_karm * ustar2 ) * ( z * D_minus_z ) )/( ustar_D + absf * ( z * D_minus_z ) )
else
if ( ustar_D + absf * ( z * D_minus_z ) == 0.) then
Kd_wall = 0.
else
Kd_wall = ( ( von_karm * ustar2 ) * ( z * D_minus_z ) )/( ustar_D + absf * ( z * D_minus_z ) )
endif

! TKE associated with Kd_wall, in m3 s-2.
Expand Down

0 comments on commit 5f9a61f

Please sign in to comment.