Skip to content

Commit 6630441

Browse files
claireyungHallberg-NOAA
authored andcommitted
Address comments from Bob by adding scaling to dimensional numbers, replacing Boussinesq rho in nonBoussinesq code, and removing white space to follow 2-space indenting.
1 parent 29dd0b2 commit 6630441

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

src/core/MOM_PressureForce_FV.F90

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ subroutine PressureForce_FV_nonBouss(h, tv, PFu, PFv, G, GV, US, CS, ALE_CSp, p_
280280
dp_neglect = GV%g_Earth*GV%H_to_RZ * GV%H_subroundoff
281281
alpha_ref = 1.0 / CS%Rho0
282282
I_gEarth = 1.0 / GV%g_Earth
283-
p_nonvanished = GV%g_Earth*CS%Rho0*CS%h_nonvanished
283+
p_nonvanished = GV%g_Earth*GV%H_to_RZ*CS%h_nonvanished
284284

285285
if ((CS%id_MassWt_u > 0) .or. (CS%id_MassWt_v > 0)) then
286286
MassWt_u(:,:,:) = 0.0 ; MassWt_v(:,:,:) = 0.0
@@ -985,6 +985,7 @@ subroutine PressureForce_FV_Bouss(h, tv, PFu, PFv, G, GV, US, CS, ALE_CSp, p_atm
985985
real :: I_g_rho ! The inverse of the density times the gravitational acceleration [Z T2 L-2 R-1 ~> m Pa-1]
986986
real :: rho_ref ! The reference density [R ~> kg m-3].
987987
real :: dz_neglect ! A minimal thickness [Z ~> m], like e.
988+
real :: dz_nonvanished ! A small thickness considered to be vanished for mass weighting [Z ~> m]
988989
real :: H_to_RL2_T2 ! A factor to convert from thickness units (H) to pressure
989990
! units [R L2 T-2 H-1 ~> Pa m-1 or Pa m2 kg-1].
990991
real :: T5(5) ! Temperatures and salinities at five quadrature points [C ~> degC]
@@ -1025,6 +1026,7 @@ subroutine PressureForce_FV_Bouss(h, tv, PFu, PFv, G, GV, US, CS, ALE_CSp, p_atm
10251026

10261027
h_neglect = GV%H_subroundoff
10271028
dz_neglect = GV%dZ_subroundoff
1029+
dz_nonvanished = GV%H_to_Z*CS%h_nonvanished
10281030
I_Rho0 = 1.0 / GV%Rho0
10291031
G_Rho0 = GV%g_Earth / GV%Rho0
10301032
GxRho = GV%g_Earth * GV%Rho0
@@ -1180,21 +1182,21 @@ subroutine PressureForce_FV_Bouss(h, tv, PFu, PFv, G, GV, US, CS, ALE_CSp, p_atm
11801182
intx_dpa(:,:,k), inty_dpa(:,:,k), &
11811183
MassWghtInterp=CS%MassWghtInterp, &
11821184
use_inaccurate_form=CS%use_inaccurate_pgf_rho_anom, Z_0p=Z_0p, &
1183-
MassWghtInterpVanOnly=CS%MassWghtInterpVanOnly, h_nv=CS%h_nonvanished)
1185+
MassWghtInterpVanOnly=CS%MassWghtInterpVanOnly, h_nv=dz_nonvanished)
11841186
elseif ( CS%Recon_Scheme == 2 ) then
11851187
call int_density_dz_generic_ppm(k, tv, T_t, T_b, S_t, S_b, e, &
11861188
rho_ref, CS%Rho0, GV%g_Earth, dz_neglect, G%bathyT, &
11871189
G%HI, GV, tv%eqn_of_state, US, CS%use_stanley_pgf, dpa(:,:,k), intz_dpa(:,:,k), &
11881190
intx_dpa(:,:,k), inty_dpa(:,:,k), &
11891191
MassWghtInterp=CS%MassWghtInterp, Z_0p=Z_0p, &
1190-
MassWghtInterpVanOnly=CS%MassWghtInterpVanOnly, h_nv=CS%h_nonvanished)
1192+
MassWghtInterpVanOnly=CS%MassWghtInterpVanOnly, h_nv=dz_nonvanished)
11911193
endif
11921194
else
11931195
call int_density_dz(tv_tmp%T(:,:,k), tv_tmp%S(:,:,k), e(:,:,K), e(:,:,K+1), &
11941196
rho_ref, CS%Rho0, GV%g_Earth, G%HI, tv%eqn_of_state, US, dpa(:,:,k), &
11951197
intz_dpa(:,:,k), intx_dpa(:,:,k), inty_dpa(:,:,k), G%bathyT, e(:,:,1), dz_neglect, &
11961198
CS%MassWghtInterp, Z_0p=Z_0p, &
1197-
MassWghtInterpVanOnly=CS%MassWghtInterpVanOnly, h_nv=CS%h_nonvanished)
1199+
MassWghtInterpVanOnly=CS%MassWghtInterpVanOnly, h_nv=dz_nonvanished)
11981200
endif
11991201
if (GV%Z_to_H /= 1.0) then
12001202
!$OMP parallel do default(shared)

src/core/MOM_density_integrals.F90

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ subroutine int_density_dz_generic_pcm(T, S, z_t, z_b, rho_ref, rho_0, G_e, HI, &
282282
hWght = max(hWght, z_b(i+1,j)-SSH(i,j), z_b(i,j)-SSH(i+1,j))
283283
! If both sides are nonvanished, then set it back to zero.
284284
if (((z_t(i,j) - z_b(i,j)) > h_nonvanished) .and. ((z_t(i+1,j) - z_b(i+1,j)) > h_nonvanished)) then
285-
hWght = massWeightNVonlyToggle * hWght
285+
hWght = massWeightNVonlyToggle * hWght
286286
endif
287287
if (hWght > 0.) then
288288
hL = (z_t(i,j) - z_b(i,j)) + dz_neglect
@@ -354,7 +354,7 @@ subroutine int_density_dz_generic_pcm(T, S, z_t, z_b, rho_ref, rho_0, G_e, HI, &
354354
hWght = max(hWght, z_b(i,j+1)-SSH(i,j), z_b(i,j)-SSH(i,j+1))
355355
! If both sides are nonvanished, then set it back to zero.
356356
if (((z_t(i,j) - z_b(i,j)) > h_nonvanished) .and. ((z_t(i,j+1) - z_b(i,j+1)) > h_nonvanished)) then
357-
hWght = massWeightNVonlyToggle * hWght
357+
hWght = massWeightNVonlyToggle * hWght
358358
endif
359359
if (hWght > 0.) then
360360
hL = (z_t(i,j) - z_b(i,j)) + dz_neglect
@@ -666,7 +666,7 @@ subroutine int_density_dz_generic_plm(k, tv, T_t, T_b, S_t, S_b, e, rho_ref, &
666666
hWght = max(hWght, hWghtTop)
667667
! If both sides are nonvanished, then set it back to zero.
668668
if (((e(i,j,K) - e(i,j,K+1)) > h_nonvanished) .and. ((e(i+1,j,K) - e(i+1,j,K+1)) > h_nonvanished)) then
669-
hWght = massWeightNVonlyToggle * hWght
669+
hWght = massWeightNVonlyToggle * hWght
670670
endif
671671
if (hWght > 0.) then
672672
hL = (e(i,j,K) - e(i,j,K+1)) + dz_subroundoff
@@ -777,7 +777,7 @@ subroutine int_density_dz_generic_plm(k, tv, T_t, T_b, S_t, S_b, e, rho_ref, &
777777
hWght = max(hWght, hWghtTop)
778778
! If both sides are nonvanished, then set it back to zero.
779779
if (((e(i,j,K) - e(i,j,K+1)) > h_nonvanished) .and. ((e(i,j+1,K) - e(i,j+1,K+1)) > h_nonvanished)) then
780-
hWght = massWeightNVonlyToggle * hWght
780+
hWght = massWeightNVonlyToggle * hWght
781781
endif
782782

783783
if (hWght > 0.) then
@@ -1108,7 +1108,7 @@ subroutine int_density_dz_generic_ppm(k, tv, T_t, T_b, S_t, S_b, e, &
11081108
hWght = max(hWght, hWghtTop)
11091109
! If both sides are nonvanished, then set it back to zero.
11101110
if (((e(i,j,K) - e(i,j,K+1)) > h_nonvanished) .and. ((e(i+1,j,K) - e(i+1,j,K+1)) > h_nonvanished)) then
1111-
hWght = massWeightNVonlyToggle * hWght
1111+
hWght = massWeightNVonlyToggle * hWght
11121112
endif
11131113
if (hWght > 0.) then
11141114
hL = (e(i,j,K) - e(i,j,K+1)) + dz_subroundoff
@@ -1220,7 +1220,7 @@ subroutine int_density_dz_generic_ppm(k, tv, T_t, T_b, S_t, S_b, e, &
12201220
hWght = max(hWght, hWghtTop)
12211221
! If both sides are nonvanished, then set it back to zero.
12221222
if (((e(i,j,K) - e(i,j,K+1)) > h_nonvanished) .and. ((e(i,j+1,K) - e(i,j+1,K+1)) > h_nonvanished)) then
1223-
hWght = massWeightNVonlyToggle * hWght
1223+
hWght = massWeightNVonlyToggle * hWght
12241224
endif
12251225
if (hWght > 0.) then
12261226
hL = (e(i,j,K) - e(i,j,K+1)) + dz_subroundoff
@@ -1551,7 +1551,7 @@ subroutine int_spec_vol_dp_generic_pcm(T, S, p_t, p_b, alpha_ref, HI, EOS, US, d
15511551
hWght = max(hWght, P_surf(i,j)-p_b(i+1,j), P_surf(i+1,j)-p_b(i,j))
15521552
! If both sides are nonvanished, then set it back to zero.
15531553
if (((p_b(i,j) - p_t(i,j)) > p_nonvanished) .and. ((p_b(i+1,j) - p_t(i+1,j)) > p_nonvanished)) then
1554-
hWght = massWeightNVonlyToggle * hWght
1554+
hWght = massWeightNVonlyToggle * hWght
15551555
endif
15561556

15571557
if (hWght > 0.) then
@@ -1616,7 +1616,7 @@ subroutine int_spec_vol_dp_generic_pcm(T, S, p_t, p_b, alpha_ref, HI, EOS, US, d
16161616
hWght = max(hWght, P_surf(i,j)-p_b(i,j+1), P_surf(i,j+1)-p_b(i,j))
16171617
! If both sides are nonvanished, then set it back to zero.
16181618
if (((p_b(i,j) - p_t(i,j)) > p_nonvanished) .and. ((p_b(i,j+1) - p_t(i,j+1)) > p_nonvanished)) then
1619-
hWght = massWeightNVonlyToggle * hWght
1619+
hWght = massWeightNVonlyToggle * hWght
16201620
endif
16211621
if (hWght > 0.) then
16221622
hL = (p_b(i,j) - p_t(i,j)) + dP_neglect
@@ -1836,7 +1836,7 @@ subroutine int_spec_vol_dp_generic_plm(T_t, T_b, S_t, S_b, p_t, p_b, alpha_ref,
18361836
hWght = max(hWght, P_surf(i,j)-p_b(i+1,j), P_surf(i+1,j)-p_b(i,j))
18371837
! If both sides are nonvanished, then set it back to zero.
18381838
if (((p_b(i,j) - p_t(i,j)) > p_nonvanished) .and. ((p_b(i+1,j) - p_t(i+1,j)) > p_nonvanished)) then
1839-
hWght = massWeightNVonlyToggle * hWght
1839+
hWght = massWeightNVonlyToggle * hWght
18401840
endif
18411841
if (hWght > 0.) then
18421842
hL = (p_b(i,j) - p_t(i,j)) + dP_neglect
@@ -1906,7 +1906,7 @@ subroutine int_spec_vol_dp_generic_plm(T_t, T_b, S_t, S_b, p_t, p_b, alpha_ref,
19061906
hWght = max(hWght, P_surf(i,j)-p_b(i,j+1), P_surf(i,j+1)-p_b(i,j))
19071907
! If both sides are nonvanished, then set it back to zero.
19081908
if (((p_b(i,j) - p_t(i,j)) > p_nonvanished) .and. ((p_b(i,j+1) - p_t(i,j+1)) > p_nonvanished)) then
1909-
hWght = massWeightNVonlyToggle * hWght
1909+
hWght = massWeightNVonlyToggle * hWght
19101910
endif
19111911
if (hWght > 0.) then
19121912
hL = (p_b(i,j) - p_t(i,j)) + dP_neglect

0 commit comments

Comments
 (0)