Skip to content

Commit

Permalink
Minor cleanup related to pressure rescaling
Browse files Browse the repository at this point in the history
  Minor refactoring of variables related to pressure rescaling and some cleanup
of comments.  All answers are bitwise identical.
  • Loading branch information
Hallberg-NOAA committed Apr 15, 2020
1 parent b84b2d3 commit da12012
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/core/MOM_dynamics_split_RK2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, Time_local, dt, forces, p_s
! u_old_rad_OBC and v_old_rad_OBC are the starting velocities, which are
! saved for use in the Flather open boundary condition code [L T-1 ~> m s-1].

real :: Pa_to_eta ! A factor that converts pressures to the units of eta.
real :: pres_to_eta ! A factor that converts pressures to the units of eta
! [H T2 R-1 L-2 ~> m Pa-1 or kg m-2 Pa-1]
real, pointer, dimension(:,:) :: &
p_surf => NULL(), eta_PF_start => NULL(), &
taux_bot => NULL(), tauy_bot => NULL(), &
Expand Down Expand Up @@ -412,11 +413,10 @@ subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, Time_local, dt, forces, p_s
call PressureForce(h, tv, CS%PFu, CS%PFv, G, GV, US, CS%PressureForce_CSp, &
CS%ALE_CSp, p_surf, CS%pbce, CS%eta_PF)
if (dyn_p_surf) then
Pa_to_eta = US%RL2_T2_to_Pa / GV%H_to_Pa
pres_to_eta = 1.0 / (GV%g_Earth * GV%H_to_RZ)
!$OMP parallel do default(shared)
do j=Jsq,Jeq+1 ; do i=Isq,Ieq+1
eta_PF_start(i,j) = CS%eta_PF(i,j) - Pa_to_eta * &
(p_surf_begin(i,j) - p_surf_end(i,j))
eta_PF_start(i,j) = CS%eta_PF(i,j) - pres_to_eta * (p_surf_begin(i,j) - p_surf_end(i,j))
enddo ; enddo
endif
call cpu_clock_end(id_clock_pres)
Expand Down
4 changes: 2 additions & 2 deletions src/parameterizations/vertical/MOM_energetic_PBL.F90
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ subroutine ePBL_column(h, u, v, T0, S0, dSV_dT, dSV_dS, TKE_forcing, B_flux, abs
real :: h_neglect ! A thickness that is so small it is usually lost
! in roundoff and can be neglected [H ~> m or kg m-2].
real :: dMass ! The mass per unit area within a layer [Z R ~> kg m-2].
real :: dPres ! The hydrostatic pressure change across a layer [R Z2 T-2 ~> kg m-1 s-2 = Pa = J m-3].
real :: dPres ! The hydrostatic pressure change across a layer [R Z2 T-2 ~> Pa = J m-3].
real :: dMKE_max ! The maximum amount of mean kinetic energy that could be
! converted to turbulent kinetic energy if the velocity in
! the layer below an interface were homogenized with all of
Expand Down Expand Up @@ -805,7 +805,7 @@ subroutine ePBL_column(h, u, v, T0, S0, dSV_dT, dSV_dS, TKE_forcing, B_flux, abs
pres_Z(1) = 0.0
do k=1,nz
dMass = GV%H_to_RZ * h(k)
dPres = US%L_to_Z**2 * GV%g_Earth * dMass ! Equivalent to GV%H_to_Pa * h(k) with rescaling
dPres = US%L_to_Z**2 * GV%g_Earth * dMass
dT_to_dPE(k) = (dMass * (pres_Z(K) + 0.5*dPres)) * dSV_dT(k)
dS_to_dPE(k) = (dMass * (pres_Z(K) + 0.5*dPres)) * dSV_dS(k)
dT_to_dColHt(k) = dMass * dSV_dT(k)
Expand Down

0 comments on commit da12012

Please sign in to comment.