Skip to content

Commit

Permalink
Calculates bottomFac2 IF CS%MEKE_GEOMETRIC=True
Browse files Browse the repository at this point in the history
In this commit, bottomFac2 is calculated when CS%MEKE_GEOMETRIC is
set to true. Previously, bottomFac2 was calculated in MEKE_lengthScales_0d
but something else on that subroutine was returning Nan so we decided to
pull out just the bottomFac2 calculation from that.
  • Loading branch information
gustavo-marques committed Sep 23, 2019
1 parent a4f9550 commit bb46c38
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/parameterizations/lateral/MOM_MEKE.F90
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,8 @@ subroutine MEKE_equilibrium(CS, MEKE, G, GV, US, SN_u, SN_v, drag_rate_visc, I_m
real, parameter :: tolerance = 1.e-12 ! Width of EKE bracket [m2 s-2].
logical :: useSecant, debugIteration

real :: Lgrid, Ldeform, Lfrict

is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec

debugIteration = .false.
Expand Down Expand Up @@ -750,9 +752,18 @@ subroutine MEKE_equilibrium(CS, MEKE, G, GV, US, SN_u, SN_v, drag_rate_visc, I_m
endif
if (CS%MEKE_equilibrium_alt) then
if (CS%MEKE_GEOMETRIC) then
Lgrid = sqrt(G%areaT(i,j)) ! Grid scale
Ldeform =Lgrid * MIN(1.0,MEKE%Rd_dx_h(i,j)) ! Deformation scale
Lfrict = (US%Z_to_m * G%bathyT(i,j)) / CS%cdrag ! Frictional arrest scale
! gamma_b^2 is the ratio of bottom eddy energy to mean column eddy energy
! used in calculating bottom drag
bottomFac2 = CS%MEKE_CD_SCALE**2
if (Lfrict*CS%MEKE_Cb>0.) bottomFac2 = bottomFac2 + 1./( 1. + CS%MEKE_Cb*(Ldeform/Lfrict) )**0.8
bottomFac2 = max(bottomFac2, CS%MEKE_min_gamma)
! Equation 1 of Jansen et al. (2015), balancing the GEOMETRIC GM coefficient against
! bottom drag (Equations 3 and 12)
MEKE%MEKE(i,j) = (CS%MEKE_GEOMETRIC_alpha * MIN(SN,1.0e-7))**2 / ((I_H * CS%cdrag)**2 * (bottomFac2**3))
! TODO: create a run time parameter for limitting SN.
MEKE%MEKE(i,j) = (CS%MEKE_GEOMETRIC_alpha * MIN(SN,1.e-5) * US%Z_to_m*G%bathyT(i,j))**2 / (CS%cdrag**2 * bottomFac2**3)
else
MEKE%MEKE(i,j) = (US%Z_to_m*G%bathyT(i,j)*SN / (8*CS%cdrag))**2
endif
Expand Down

0 comments on commit bb46c38

Please sign in to comment.