Skip to content

Commit bb91495

Browse files
committed
+Add alternate gravity variable GV%g_Earth_Z_T2
Added the new gravitational acceleration element GV%g_Earth_Z_T2 to the verticalGrid_type as a copy of GV%g_Earth that uses dimensional rescaling of [Z T-2 ~> m s-2] instead of [L2 Z-1 T-2 ~> m s-2]. GV%g_Earth_Z_T2 is more convenient for single-column energy calculations, but the two will only differ by an integer power of two when dimensional rescaling is applied. In addition, the apparently unused element GV%mks_g_Earth was commented out, and it will be eliminated in several months if there are no concerns raised by MOM6 users whose code is not on any of the primary development branches of MOM6. Explicitly rescaled versions of GV%g_Earth were replaced by GV%g_Earth_Z_T2 in 38 places in 14 files, leading to the elimination of 38 US%L_to_Z**2 dimensional rescaling factors. Another US%L_to_Z**2 rescaling factor was eliminated from the code in ePBL_column by folding it into MKE_to_TKE_effic. All answers are bitwise identical, but there are changes to the contents of a transparent type.
1 parent 54feb6f commit bb91495

15 files changed

+48
-45
lines changed

src/core/MOM_verticalGrid.F90

+4-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ module MOM_verticalGrid
2626
! Commonly used parameters
2727
integer :: ke !< The number of layers/levels in the vertical
2828
real :: max_depth !< The maximum depth of the ocean [Z ~> m].
29-
real :: mks_g_Earth !< The gravitational acceleration in unscaled MKS units [m s-2].
29+
! real :: mks_g_Earth !< The gravitational acceleration in unscaled MKS units [m s-2]. This might not be used.
3030
real :: g_Earth !< The gravitational acceleration [L2 Z-1 T-2 ~> m s-2].
31+
real :: g_Earth_Z_T2 !< The gravitational acceleration in alternatively rescaled units [Z T-2 ~> m s-2]
3132
real :: Rho0 !< The density used in the Boussinesq approximation or nominal
3233
!! density used to convert depths into mass units [R ~> kg m-3].
3334

@@ -173,7 +174,8 @@ subroutine verticalGridInit( param_file, GV, US )
173174
"units of thickness into m.", units="m H-1", default=1.0)
174175
GV%H_to_m = GV%H_to_m * H_rescale_factor
175176
endif
176-
GV%mks_g_Earth = US%L_T_to_m_s**2*US%m_to_Z * GV%g_Earth
177+
! This is not used: GV%mks_g_Earth = US%L_T_to_m_s**2*US%m_to_Z * GV%g_Earth
178+
GV%g_Earth_Z_T2 = US%L_to_Z**2 * GV%g_Earth ! This would result from scale=US%m_to_Z*US%T_to_s**2.
177179
#ifdef STATIC_MEMORY_
178180
! Here NK_ is a macro, while nk is a variable.
179181
call get_param(param_file, mdl, "NK", nk, &

src/diagnostics/MOM_diagnose_MLD.F90

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ subroutine diagnoseMLDbyDensityDifference(id_MLD, h, tv, densityDiff, G, GV, US,
9393
endif
9494
endif
9595

96-
gE_rho0 = (US%L_to_Z**2 * GV%g_Earth) / GV%H_to_RZ
96+
gE_rho0 = GV%g_Earth_Z_T2 / GV%H_to_RZ
9797

9898
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke
9999

@@ -322,7 +322,7 @@ subroutine diagnoseMLDbyEnergy(id_MLD, h, tv, G, GV, US, Mixing_Energy, diagPtr)
322322
PE_Threshold_fraction = 1.e-4 !Fixed threshold of 0.01%, could be runtime.
323323

324324
do iM=1,3
325-
PE_threshold(iM) = Mixing_Energy(iM) / (US%L_to_Z**2*GV%g_Earth)
325+
PE_threshold(iM) = Mixing_Energy(iM) / GV%g_Earth_Z_T2
326326
enddo
327327

328328
MLD(:,:,:) = 0.0

src/parameterizations/vertical/MOM_CVMix_KPP.F90

+4-4
Original file line numberDiff line numberDiff line change
@@ -1031,11 +1031,11 @@ subroutine KPP_compute_BLD(CS, G, GV, US, h, Temp, Salt, u, v, tv, uStar, buoyFl
10311031
call cpu_clock_begin(id_clock_KPP_compute_BLD)
10321032

10331033
! some constants
1034-
GoRho = US%Z_to_m*US%s_to_T**2 * (US%L_to_Z**2 * GV%g_Earth / GV%Rho0)
1034+
GoRho = US%Z_to_m*US%s_to_T**2 * (GV%g_Earth_Z_T2 / GV%Rho0)
10351035
if (GV%Boussinesq) then
1036-
GoRho_Z_L2 = US%L_to_Z**2 * GV%Z_to_H * GV%g_Earth / GV%Rho0
1036+
GoRho_Z_L2 = GV%Z_to_H * GV%g_Earth_Z_T2 / GV%Rho0
10371037
else
1038-
GoRho_Z_L2 = US%L_to_Z**2 * GV%g_Earth * GV%RZ_to_H
1038+
GoRho_Z_L2 = GV%g_Earth_Z_T2 * GV%RZ_to_H
10391039
endif
10401040
buoy_scale = US%L_to_m**2*US%s_to_T**3
10411041

@@ -1191,7 +1191,7 @@ subroutine KPP_compute_BLD(CS, G, GV, US, h, Temp, Salt, u, v, tv, uStar, buoyFl
11911191
if (GV%Boussinesq .or. GV%semi_Boussinesq) then
11921192
deltaBuoy(k) = GoRho*(rho_1D(kk+2) - rho_1D(kk+1))
11931193
else
1194-
deltaBuoy(k) = (US%Z_to_m*US%s_to_T**2) * (US%L_to_Z**2 * GV%g_Earth) * &
1194+
deltaBuoy(k) = (US%Z_to_m*US%s_to_T**2) * GV%g_Earth_Z_T2 * &
11951195
( (rho_1D(kk+2) - rho_1D(kk+1)) / (0.5 * (rho_1D(kk+2) + rho_1D(kk+1))) )
11961196
endif
11971197
N2_1d(k) = (GoRho_Z_L2 * (rho_1D(kk+2) - rho_1D(kk+3)) ) / &

src/parameterizations/vertical/MOM_CVMix_conv.F90

+2-2
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ subroutine calculate_CVMix_conv(h, tv, G, GV, US, CS, hbl, Kd, Kv, Kd_aux)
181181
integer :: i, j, k
182182

183183
if (GV%Boussinesq) then
184-
g_o_rho0 = (US%L_to_Z**2*US%s_to_T**2*GV%Z_to_H) * GV%g_Earth / GV%Rho0
184+
g_o_rho0 = (US%s_to_T**2*GV%Z_to_H) * GV%g_Earth_Z_T2 / GV%Rho0
185185
else
186-
g_o_rho0 = (US%L_to_Z**2*US%s_to_T**2*GV%RZ_to_H) * GV%g_Earth
186+
g_o_rho0 = (US%s_to_T**2*GV%RZ_to_H) * GV%g_Earth_Z_T2
187187
endif
188188

189189
! initialize dummy variables

src/parameterizations/vertical/MOM_CVMix_shear.F90

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ subroutine calculate_CVMix_shear(u_H, v_H, h, tv, kd, kv, G, GV, US, CS )
9494
real :: epsln !< Threshold to identify vanished layers [H ~> m or kg m-2]
9595

9696
! some constants
97-
GoRho = US%L_to_Z**2 * GV%g_Earth / GV%Rho0
97+
GoRho = GV%g_Earth_Z_T2 / GV%Rho0
9898
epsln = 1.e-10 * GV%m_to_H
9999

100100
do j = G%jsc, G%jec
@@ -141,7 +141,7 @@ subroutine calculate_CVMix_shear(u_H, v_H, h, tv, kd, kv, G, GV, US, CS )
141141
if (GV%Boussinesq .or. GV%semi_Boussinesq) then
142142
dRho = GoRho * (rho_1D(kk+1) - rho_1D(kk+2))
143143
else
144-
dRho = (US%L_to_Z**2 * GV%g_Earth) * (rho_1D(kk+1) - rho_1D(kk+2)) / (0.5*(rho_1D(kk+1) + rho_1D(kk+2)))
144+
dRho = GV%g_Earth_Z_T2 * (rho_1D(kk+1) - rho_1D(kk+2)) / (0.5*(rho_1D(kk+1) + rho_1D(kk+2)))
145145
endif
146146
dz_int = 0.5*(dz(i,km1) + dz(i,k)) + GV%dZ_subroundoff
147147
N2 = DRHO / dz_int

src/parameterizations/vertical/MOM_diabatic_aux.F90

+6-6
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ subroutine applyBoundaryFluxesInOut(CS, G, GV, US, dt, fluxes, optics, nsw, h, t
805805
calculate_buoyancy = present(SkinBuoyFlux)
806806
if (calculate_buoyancy) SkinBuoyFlux(:,:) = 0.0
807807
if (present(cTKE)) cTKE(:,:,:) = 0.0
808-
g_Hconv2 = (US%L_to_Z**2*GV%g_Earth * GV%H_to_RZ) * GV%H_to_RZ
808+
g_Hconv2 = (GV%g_Earth_Z_T2 * GV%H_to_RZ) * GV%H_to_RZ
809809
EOSdom(:) = EOS_domain(G%HI)
810810

811811
! Only apply forcing if fluxes%sw is associated.
@@ -816,7 +816,7 @@ subroutine applyBoundaryFluxesInOut(CS, G, GV, US, dt, fluxes, optics, nsw, h, t
816816

817817
if (calculate_buoyancy) then
818818
SurfPressure(:) = 0.0
819-
GoRho = US%L_to_Z**2*GV%g_Earth / GV%Rho0
819+
GoRho = GV%g_Earth_Z_T2 / GV%Rho0
820820
endif
821821

822822
if (CS%do_brine_plume .and. .not.present(MLD_h)) then
@@ -1040,11 +1040,11 @@ subroutine applyBoundaryFluxesInOut(CS, G, GV, US, dt, fluxes, optics, nsw, h, t
10401040
! drho_ds = The derivative of density with salt at the ambient surface salinity.
10411041
! Sriver = 0 (i.e. rivers are assumed to be pure freshwater)
10421042
if (GV%Boussinesq) then
1043-
RivermixConst = -0.5*(CS%rivermix_depth*dt) * ( US%L_to_Z**2*GV%g_Earth ) * GV%Rho0
1043+
RivermixConst = -0.5*(CS%rivermix_depth*dt) * GV%g_Earth_Z_T2 * GV%Rho0
10441044
elseif (allocated(tv%SpV_avg)) then
1045-
RivermixConst = -0.5*(CS%rivermix_depth*dt) * ( US%L_to_Z**2*GV%g_Earth ) / tv%SpV_avg(i,j,1)
1045+
RivermixConst = -0.5*(CS%rivermix_depth*dt) * GV%g_Earth_Z_T2 / tv%SpV_avg(i,j,1)
10461046
else
1047-
RivermixConst = -0.5*(CS%rivermix_depth*dt) * GV%Rho0 * ( US%L_to_Z**2*GV%g_Earth )
1047+
RivermixConst = -0.5*(CS%rivermix_depth*dt) * GV%Rho0 * GV%g_Earth_Z_T2
10481048
endif
10491049
cTKE(i,j,k) = cTKE(i,j,k) + max(0.0, RivermixConst*dSV_dS(i,j,1) * &
10501050
(fluxes%lrunoff(i,j) + fluxes%frunoff(i,j)) * tv%S(i,j,1))
@@ -1293,7 +1293,7 @@ subroutine applyBoundaryFluxesInOut(CS, G, GV, US, dt, fluxes, optics, nsw, h, t
12931293
if (associated(tv%p_surf)) then ; do i=is,ie ; SurfPressure(i) = tv%p_surf(i,j) ; enddo ; endif
12941294

12951295
if ((.not.GV%Boussinesq) .and. (.not.GV%semi_Boussinesq)) then
1296-
g_conv = GV%g_Earth * GV%H_to_RZ * US%L_to_Z**2
1296+
g_conv = GV%g_Earth_Z_T2 * GV%H_to_RZ
12971297

12981298
! Specific volume derivatives
12991299
call calculate_specific_vol_derivs(T2d(:,1), tv%S(:,j,1), SurfPressure, dSpV_dT, dSpV_dS, &

src/parameterizations/vertical/MOM_diapyc_energy_req.F90

+2-2
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ subroutine diapyc_energy_req_calc(h_in, dz_in, T_in, S_in, Kd, energy_Kd, dt, tv
851851
do K=2,nz
852852
call calculate_density(0.5*(T0(k-1) + T0(k)), 0.5*(S0(k-1) + S0(k)), &
853853
pres(K), rho_here, tv%eqn_of_state)
854-
N2(K) = ((US%L_to_Z**2*GV%g_Earth) * rho_here / (0.5*(dz_tr(k-1) + dz_tr(k)))) * &
854+
N2(K) = (GV%g_Earth_Z_T2 * rho_here / (0.5*(dz_tr(k-1) + dz_tr(k)))) * &
855855
( 0.5*(dSV_dT(k-1) + dSV_dT(k)) * (T0(k-1) - T0(k)) + &
856856
0.5*(dSV_dS(k-1) + dSV_dS(k)) * (S0(k-1) - S0(k)) )
857857
enddo
@@ -862,7 +862,7 @@ subroutine diapyc_energy_req_calc(h_in, dz_in, T_in, S_in, Kd, energy_Kd, dt, tv
862862
do K=2,nz
863863
call calculate_density(0.5*(Tf(k-1) + Tf(k)), 0.5*(Sf(k-1) + Sf(k)), &
864864
pres(K), rho_here, tv%eqn_of_state)
865-
N2(K) = ((US%L_to_Z**2*GV%g_Earth) * rho_here / (0.5*(dz_tr(k-1) + dz_tr(k)))) * &
865+
N2(K) = (GV%g_Earth_Z_T2 * rho_here / (0.5*(dz_tr(k-1) + dz_tr(k)))) * &
866866
( 0.5*(dSV_dT(k-1) + dSV_dT(k)) * (Tf(k-1) - Tf(k)) + &
867867
0.5*(dSV_dS(k-1) + dSV_dS(k)) * (Sf(k-1) - Sf(k)) )
868868
enddo

src/parameterizations/vertical/MOM_energetic_PBL.F90

+7-6
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ module MOM_energetic_PBL
6969
!! 2 is more KPP like.
7070
real :: MKE_to_TKE_effic !< The efficiency with which mean kinetic energy released by
7171
!! mechanically forced entrainment of the mixed layer is converted to
72-
!! TKE [nondim].
72+
!! TKE, times conversion factors between the natural units of mean
73+
!! kinetic energy and those used for TKE [Z2 L-2 ~> nondim].
7374
logical :: direct_calc !< If true and there is no conversion from mean kinetic energy to ePBL
7475
!! turbulent kinetic energy, use a direct calculation of the
7576
!! diffusivity that is supported by a given energy input instead of the
@@ -1116,7 +1117,7 @@ subroutine ePBL_column(h, dz, u, v, T0, S0, dSV_dT, dSV_dS, SpV_dt, TKE_forcing,
11161117
pres_Z(1) = 0.0
11171118
do k=1,nz
11181119
dMass = GV%H_to_RZ * h(k)
1119-
dPres = US%L_to_Z**2 * GV%g_Earth * dMass
1120+
dPres = GV%g_Earth_Z_T2 * dMass
11201121
dT_to_dPE(k) = (dMass * (pres_Z(K) + 0.5*dPres)) * dSV_dT(k)
11211122
dS_to_dPE(k) = (dMass * (pres_Z(K) + 0.5*dPres)) * dSV_dS(k)
11221123
dT_to_dColHt(k) = dMass * dSV_dT(k)
@@ -1419,7 +1420,7 @@ subroutine ePBL_column(h, dz, u, v, T0, S0, dSV_dT, dSV_dS, SpV_dt, TKE_forcing,
14191420
if ((CS%MKE_to_TKE_effic > 0.0) .and. (htot*h(k) > 0.0)) then
14201421
! This is the energy that would be available from homogenizing the
14211422
! velocities between layer k and the layers above.
1422-
dMKE_max = (US%L_to_Z**2*GV%H_to_RZ * CS%MKE_to_TKE_effic) * 0.5 * &
1423+
dMKE_max = (GV%H_to_RZ * CS%MKE_to_TKE_effic) * 0.5 * &
14231424
(h(k) / ((htot + h(k))*htot)) * &
14241425
(((uhtot-u(k)*htot)**2) + ((vhtot-v(k)*htot)**2))
14251426
! A fraction (1-exp(Kddt_h*MKE2_Hharm)) of this energy would be
@@ -2120,7 +2121,7 @@ subroutine ePBL_BBL_column(h, dz, u, v, T0, S0, dSV_dT, dSV_dS, SpV_dt, absf, &
21202121
pres_Z(1) = 0.0
21212122
do k=1,nz
21222123
dMass = GV%H_to_RZ * h(k)
2123-
dPres = US%L_to_Z**2 * GV%g_Earth * dMass
2124+
dPres = GV%g_Earth_Z_T2 * dMass
21242125
dT_to_dPE(k) = (dMass * (pres_Z(K) + 0.5*dPres)) * dSV_dT(k)
21252126
dS_to_dPE(k) = (dMass * (pres_Z(K) + 0.5*dPres)) * dSV_dS(k)
21262127
dT_to_dColHt(k) = dMass * dSV_dT(k)
@@ -2327,7 +2328,7 @@ subroutine ePBL_BBL_column(h, dz, u, v, T0, S0, dSV_dT, dSV_dS, SpV_dt, absf, &
23272328
! if ((CS%MKE_to_TKE_effic > 0.0) .and. (htot*h(k-1) > 0.0)) then
23282329
! ! This is the energy that would be available from homogenizing the
23292330
! ! velocities between layer k-1 and the layers below.
2330-
! dMKE_max = (US%L_to_Z**2*GV%H_to_RZ * CS%MKE_to_TKE_effic) * 0.5 * &
2331+
! dMKE_max = (GV%H_to_RZ * CS%MKE_to_TKE_effic) * 0.5 * &
23312332
! (h(k-1) / ((htot + h(k-1))*htot)) * &
23322333
! ((uhtot-u(k-1)*htot)**2 + (vhtot-v(k-1)*htot)**2)
23332334
! ! A fraction (1-exp(Kddt_h*MKE2_Hharm)) of this energy would be
@@ -3453,7 +3454,7 @@ subroutine energetic_PBL_init(Time, G, GV, US, param_file, diag, CS)
34533454
"The efficiency with which mean kinetic energy released "//&
34543455
"by mechanically forced entrainment of the mixed layer "//&
34553456
"is converted to turbulent kinetic energy.", &
3456-
units="nondim", default=0.0)
3457+
units="nondim", default=0.0, scale=US%L_to_Z**2)
34573458
call get_param(param_file, mdl, "TKE_DECAY", CS%TKE_decay, &
34583459
"TKE_DECAY relates the vertical rate of decay of the TKE available "//&
34593460
"for mechanical entrainment to the natural Ekman depth.", &

src/parameterizations/vertical/MOM_entrain_diffusive.F90

+2-2
Original file line numberDiff line numberDiff line change
@@ -841,9 +841,9 @@ subroutine entrainment_diffusive(h, tv, fluxes, dt, G, GV, US, CS, ea, eb, &
841841

842842
if (CS%id_diff_work > 0) then
843843
if (GV%Boussinesq .or. .not.associated(tv%eqn_of_state)) then
844-
g_2dt = 0.5 * GV%H_to_Z**2 * US%L_to_Z**2 * (GV%g_Earth / dt)
844+
g_2dt = 0.5 * GV%H_to_Z**2 * (GV%g_Earth_Z_T2 / dt)
845845
else
846-
g_2dt = 0.5 * GV%H_to_RZ**2 * US%L_to_Z**2 * (GV%g_Earth / dt)
846+
g_2dt = 0.5 * GV%H_to_RZ**2 * (GV%g_Earth_Z_T2 / dt)
847847
endif
848848
do i=is,ie ; diff_work(i,j,1) = 0.0 ; diff_work(i,j,nz+1) = 0.0 ; enddo
849849
if (associated(tv%eqn_of_state)) then

src/parameterizations/vertical/MOM_internal_tide_input.F90

+1-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ subroutine find_N2_bottom(G, GV, US, tv, fluxes, h, T_f, S_f, h2, N2_bot, Rho_bo
249249
integer :: i, j, k, is, ie, js, je, nz
250250

251251
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke
252-
G_Rho0 = (US%L_to_Z**2*GV%g_Earth) / GV%H_to_RZ
252+
G_Rho0 = GV%g_Earth_Z_T2 / GV%H_to_RZ
253253
EOSdom(:) = EOS_domain(G%HI)
254254

255255
! Find the (limited) density jump across each interface.

src/parameterizations/vertical/MOM_kappa_shear.F90

+6-6
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ subroutine kappa_shear_column(kappa, tke, dt, nzc, f2, surface_pres, hlay, dz_la
766766

767767
Ri_crit = CS%Rino_crit
768768
gR0 = GV%H_to_RZ * GV%g_Earth
769-
g_R0 = (US%L_to_Z**2 * GV%g_Earth) / GV%Rho0
769+
g_R0 = GV%g_Earth_Z_T2 / GV%Rho0
770770
k0dt = dt*CS%kappa_0
771771

772772
I_lz_rescale_sqr = 1.0; if (CS%lz_rescale > 0) I_lz_rescale_sqr = 1/(CS%lz_rescale*CS%lz_rescale)
@@ -901,19 +901,19 @@ subroutine kappa_shear_column(kappa, tke, dt, nzc, f2, surface_pres, hlay, dz_la
901901
tv%eqn_of_state, (/2,nzc/) )
902902
call calculate_density(T_int, Sal_int, pressure, rho_int, tv%eqn_of_state, (/2,nzc/) )
903903
do K=2,nzc
904-
dbuoy_dT(K) = (US%L_to_Z**2 * GV%g_Earth) * (rho_int(K) * dSpV_dT(K))
905-
dbuoy_dS(K) = (US%L_to_Z**2 * GV%g_Earth) * (rho_int(K) * dSpV_dS(K))
904+
dbuoy_dT(K) = GV%g_Earth_Z_T2 * (rho_int(K) * dSpV_dT(K))
905+
dbuoy_dS(K) = GV%g_Earth_Z_T2 * (rho_int(K) * dSpV_dS(K))
906906
enddo
907907
endif
908908
elseif (GV%Boussinesq .or. GV%semi_Boussinesq) then
909909
do K=1,nzc+1 ; dbuoy_dT(K) = -g_R0 ; dbuoy_dS(K) = 0.0 ; enddo
910910
else
911911
do K=1,nzc+1 ; dbuoy_dS(K) = 0.0 ; enddo
912-
dbuoy_dT(1) = -(US%L_to_Z**2 * GV%g_Earth) / GV%Rlay(1)
912+
dbuoy_dT(1) = -GV%g_Earth_Z_T2 / GV%Rlay(1)
913913
do K=2,nzc
914-
dbuoy_dT(K) = -(US%L_to_Z**2 * GV%g_Earth) / (0.5*(GV%Rlay(k-1) + GV%Rlay(k)))
914+
dbuoy_dT(K) = -GV%g_Earth_Z_T2 / (0.5*(GV%Rlay(k-1) + GV%Rlay(k)))
915915
enddo
916-
dbuoy_dT(nzc+1) = -(US%L_to_Z**2 * GV%g_Earth) / GV%Rlay(nzc)
916+
dbuoy_dT(nzc+1) = -GV%g_Earth_Z_T2 / GV%Rlay(nzc)
917917
endif
918918

919919
! N2_debug(1) = 0.0 ; N2_debug(nzc+1) = 0.0

src/parameterizations/vertical/MOM_opacity.F90

+2-2
Original file line numberDiff line numberDiff line change
@@ -649,9 +649,9 @@ subroutine absorbRemainingSW(G, GV, US, h, opacity_band, nsw, optics, j, dt, H_l
649649
TKE_calc = (present(TKE) .and. present(dSV_dT))
650650

651651
if (optics%answer_date < 20190101) then
652-
g_Hconv2 = (US%L_to_Z**2*GV%g_Earth * GV%H_to_RZ) * GV%H_to_RZ
652+
g_Hconv2 = (GV%g_Earth_Z_T2 * GV%H_to_RZ) * GV%H_to_RZ
653653
else
654-
g_Hconv2 = US%L_to_Z**2*GV%g_Earth * GV%H_to_RZ**2
654+
g_Hconv2 = GV%g_Earth_Z_T2 * GV%H_to_RZ**2
655655
endif
656656

657657
h_heat(:) = 0.0

src/parameterizations/vertical/MOM_set_diffusivity.F90

+5-5
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ subroutine find_TKE_to_Kd(h, tv, dRho_int, N2_lay, j, dt, G, GV, US, CS, &
864864
! entraining all fluid in the layers above or below [H ~> m or kg m-2]
865865
real :: dRho_lay ! density change across a layer [R ~> kg m-3]
866866
real :: Omega2 ! rotation rate squared [T-2 ~> s-2]
867-
real :: grav ! Gravitational acceleration [Z T-1 ~> m s-2]
867+
real :: grav ! Gravitational acceleration [Z T-2 ~> m s-2]
868868
real :: G_Rho0 ! Gravitational acceleration divided by Boussinesq reference density
869869
! [Z R-1 T-2 ~> m4 s-2 kg-1]
870870
real :: G_IRho0 ! Alternate calculation of G_Rho0 with thickness rescaling factors
@@ -881,7 +881,7 @@ subroutine find_TKE_to_Kd(h, tv, dRho_int, N2_lay, j, dt, G, GV, US, CS, &
881881
I_dt = 1.0 / dt
882882
Omega2 = CS%omega**2
883883
dz_neglect = GV%dZ_subroundoff
884-
grav = (US%L_to_Z**2 * GV%g_Earth)
884+
grav = GV%g_Earth_Z_T2
885885
G_Rho0 = grav / GV%Rho0
886886
if (CS%answer_date < 20190101) then
887887
G_IRho0 = grav * GV%H_to_Z**2 * GV%RZ_to_H
@@ -1012,7 +1012,7 @@ subroutine find_TKE_to_Kd(h, tv, dRho_int, N2_lay, j, dt, G, GV, US, CS, &
10121012
! maxTKE is found by determining the kappa that gives maxEnt.
10131013
! kappa_max = I_dt * dRho_int(i,K+1) * maxEnt(i,k) * &
10141014
! G_IRho0*(h(i,j,k) + dh_max) / (G_Rho0*dRho_lay)
1015-
! maxTKE(i,k) = (GV%g_Earth*US%L_to_Z**2) * dRho_lay * kappa_max
1015+
! maxTKE(i,k) = GV%g_Earth_Z_T2 * dRho_lay * kappa_max
10161016
! dRho_int should already be non-negative, so the max is redundant?
10171017
dh_max = maxEnt(i,k) * (1.0 + dsp1_ds(i,k))
10181018
dRho_lay = 0.5 * max(dRho_int(i,K) + dRho_int(i,K+1), 0.0)
@@ -1094,7 +1094,7 @@ subroutine find_N2(h, tv, T_f, S_f, fluxes, j, G, GV, US, CS, dRho_int, &
10941094
integer :: i, k, is, ie, nz
10951095

10961096
is = G%isc ; ie = G%iec ; nz = GV%ke
1097-
G_Rho0 = (US%L_to_Z**2 * GV%g_Earth) / GV%H_to_RZ
1097+
G_Rho0 = GV%g_Earth_Z_T2 / GV%H_to_RZ
10981098
H_neglect = GV%H_subroundoff
10991099

11001100
! Find the (limited) density jump across each interface.
@@ -1385,7 +1385,7 @@ subroutine add_drag_diffusivity(h, u, v, tv, fluxes, visc, j, TKE_to_Kd, maxTKE,
13851385
TKE_Ray = 0.0 ; Rayleigh_drag = .false.
13861386
if (allocated(visc%Ray_u) .and. allocated(visc%Ray_v)) Rayleigh_drag = .true.
13871387

1388-
R0_g = GV%H_to_RZ / (US%L_to_Z**2 * GV%g_Earth)
1388+
R0_g = GV%H_to_RZ / GV%g_Earth_Z_T2
13891389

13901390
do K=2,nz ; Rint(K) = 0.5*(GV%Rlay(k-1)+GV%Rlay(k)) ; enddo
13911391

src/parameterizations/vertical/MOM_set_viscosity.F90

+2-2
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ subroutine set_viscous_BBL(u, v, h, tv, visc, G, GV, US, CS, pbv)
313313
h_neglect = GV%H_subroundoff
314314
dz_neglect = GV%dZ_subroundoff
315315

316-
Rho0x400_G = 400.0*(GV%H_to_RZ / (US%L_to_Z**2 * GV%g_Earth))
316+
Rho0x400_G = 400.0*(GV%H_to_RZ / GV%g_Earth_Z_T2)
317317

318318
if (.not.CS%initialized) call MOM_error(FATAL,"MOM_set_viscosity(BBL): "//&
319319
"Module must be initialized before it is used.")
@@ -2045,7 +2045,7 @@ subroutine set_viscous_ML(u, v, h, tv, forces, visc, dt, G, GV, US, CS)
20452045
if (.not.(CS%dynamic_viscous_ML .or. associated(forces%frac_shelf_u) .or. &
20462046
associated(forces%frac_shelf_v)) ) return
20472047

2048-
Rho0x400_G = 400.0*(GV%H_to_RZ / (US%L_to_Z**2 * GV%g_Earth))
2048+
Rho0x400_G = 400.0*(GV%H_to_RZ / GV%g_Earth_Z_T2)
20492049
cdrag_sqrt = sqrt(CS%cdrag)
20502050
cdrag_sqrt_H = cdrag_sqrt * US%L_to_m * GV%m_to_H
20512051
cdrag_sqrt_H_RL = cdrag_sqrt * US%L_to_Z * GV%RZ_to_H

src/user/MOM_wave_interface.F90

+1-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ subroutine MOM_wave_interface_init(time, G, GV, US, param_file, CS, diag)
315315
CS%diag => diag
316316
CS%Time => Time
317317

318-
CS%g_Earth = US%L_to_Z**2*GV%g_Earth
318+
CS%g_Earth = GV%g_Earth_Z_T2
319319
CS%I_g_Earth = 1.0 / CS%g_Earth
320320

321321
! Add any initializations needed here

0 commit comments

Comments
 (0)