Skip to content

Commit

Permalink
Document variable units in core modules
Browse files Browse the repository at this point in the history
  Revised or extended comments to correct or more clearly document the units of
49 internal variables in modules in the core directory.  All answers are bitwise
identical.
  • Loading branch information
Hallberg-NOAA authored and marshallward committed Oct 21, 2022
1 parent d66f03c commit cd2852a
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 58 deletions.
17 changes: 9 additions & 8 deletions src/core/MOM_CoriolisAdv.F90
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ module MOM_CoriolisAdv
real :: F_eff_max_blend !< The factor by which the maximum effective Coriolis
!! acceleration from any point can be increased when
!! blending different discretizations with the
!! ARAKAWA_LAMB_BLEND Coriolis scheme. This must be
!! greater than 2.0, and is 4.0 by default.
!! ARAKAWA_LAMB_BLEND Coriolis scheme [nondim].
!! This must be greater than 2.0, and is 4.0 by default.
real :: wt_lin_blend !< A weighting value beyond which the blending between
!! Sadourny and Arakawa & Hsu goes linearly to 0.
!! Sadourny and Arakawa & Hsu goes linearly to 0 [nondim].
!! This must be between 1 and 1e-15, often 1/8.
logical :: no_slip !< If true, no slip boundary conditions are used.
!! Otherwise free slip boundary conditions are assumed.
Expand Down Expand Up @@ -173,9 +173,10 @@ subroutine CorAdCalc(u, v, h, uh, vh, CAu, CAv, OBC, AD, G, GV, US, CS, pbv, Wav
! KEy = d/dy KE.
vh_center ! Transport based on arithmetic mean h at v-points [H L2 T-1 ~> m3 s-1 or kg s-1]
real, dimension(SZI_(G),SZJ_(G)) :: &
uh_min, uh_max, & ! The smallest and largest estimates of the volume
vh_min, vh_max, & ! fluxes through the faces (i.e. u*h*dy & v*h*dx)
! [H L2 T-1 ~> m3 s-1 or kg s-1].
uh_min, uh_max, & ! The smallest and largest estimates of the zonal volume fluxes through
! the faces (i.e. u*h*dy) [H L2 T-1 ~> m3 s-1 or kg s-1]
vh_min, vh_max, & ! The smallest and largest estimates of the meridional volume fluxes through
! the faces (i.e. v*h*dx) [H L2 T-1 ~> m3 s-1 or kg s-1]
ep_u, ep_v ! Additional pseudo-Coriolis terms in the Arakawa and Lamb
! discretization [H-1 T-1 ~> m-1 s-1 or m2 kg-1 s-1].
real, dimension(SZIB_(G),SZJB_(G)) :: &
Expand All @@ -195,8 +196,8 @@ subroutine CorAdCalc(u, v, h, uh, vh, CAu, CAv, OBC, AD, G, GV, US, CS, pbv, Wav
real :: max_fv, max_fu ! The maximum or minimum of the neighboring Coriolis
real :: min_fv, min_fu ! accelerations [L T-2 ~> m s-2], i.e. max(min)_fu(v)q.

real, parameter :: C1_12=1.0/12.0 ! C1_12 = 1/12
real, parameter :: C1_24=1.0/24.0 ! C1_24 = 1/24
real, parameter :: C1_12 = 1.0 / 12.0 ! C1_12 = 1/12 [nondim]
real, parameter :: C1_24 = 1.0 / 24.0 ! C1_24 = 1/24 [nondim]
real :: max_Ihq, min_Ihq ! The maximum and minimum of the nearby Ihq [H-1 ~> m-1 or m2 kg-1].
real :: hArea_q ! The sum of area times thickness of the cells
! surrounding a q point [H L2 ~> m3 or kg].
Expand Down
20 changes: 10 additions & 10 deletions src/core/MOM_PressureForce_FV.F90
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ subroutine PressureForce_FV_nonBouss(h, tv, PFu, PFv, G, GV, US, CS, ALE_CSp, p_
S_tmp ! Temporary array of salinities where layers that are lighter
! than the mixed layer have the mixed layer's properties [S ~> ppt].
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)) :: &
S_t, & ! Top and bottom edge values for linear reconstructions
S_b, & ! of salinity within each layer [S ~> ppt].
T_t, & ! Top and bottom edge values for linear reconstructions
T_b ! of temperature within each layer [C ~> degC].
S_t, S_b, & ! Top and bottom edge values for linear reconstructions
! of salinity within each layer [S ~> ppt].
T_t, T_b ! Top and bottom edge values for linear reconstructions
! of temperature within each layer [C ~> degC].
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)) :: &
dza, & ! The change in geopotential anomaly between the top and bottom
! of a layer [L2 T-2 ~> m2 s-2].
Expand Down Expand Up @@ -155,7 +155,7 @@ subroutine PressureForce_FV_nonBouss(h, tv, PFu, PFv, G, GV, US, CS, ALE_CSp, p_
real :: H_to_RL2_T2 ! A factor to convert from thickness units (H) to pressure
! units [R L2 T-2 H-1 ~> Pa m-1 or Pa m2 kg-1].
! real :: oneatm ! 1 standard atmosphere of pressure in [R L2 T-2 ~> Pa]
real, parameter :: C1_6 = 1.0/6.0
real, parameter :: C1_6 = 1.0/6.0 ! [nondim]
integer :: is, ie, js, je, Isq, Ieq, Jsq, Jeq, nz, nkmb
integer, dimension(2) :: EOSdom ! The i-computational domain for the equation of state
integer :: i, j, k
Expand Down Expand Up @@ -472,10 +472,10 @@ subroutine PressureForce_FV_Bouss(h, tv, PFu, PFv, G, GV, US, CS, ALE_CSp, p_atm
S_tmp ! Temporary array of salinities where layers that are lighter
! than the mixed layer have the mixed layer's properties [S ~> ppt].
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)) :: &
S_t, & ! Top and bottom edge values for linear reconstructions
S_b, & ! of salinity within each layer [S ~> ppt].
T_t, & ! Top and bottom edge values for linear reconstructions
T_b ! of temperature within each layer [C ~> degC].
S_t, S_b, & ! Top and bottom edge values for linear reconstructions
! of salinity within each layer [S ~> ppt].
T_t, T_b ! Top and bottom edge values for linear reconstructions
! of temperature within each layer [C ~> degC].
real, dimension(SZI_(G),SZJ_(G),SZK_(G)) :: &
rho_pgf, rho_stanley_pgf ! Density [kg m-3] from EOS with and without SGS T variance
! in Stanley parameterization.
Expand All @@ -497,7 +497,7 @@ subroutine PressureForce_FV_Bouss(h, tv, PFu, PFv, G, GV, US, CS, ALE_CSp, p_atm
logical :: use_ALE ! If true, use an ALE pressure reconstruction.
logical :: use_EOS ! If true, density is calculated from T & S using an equation of state.
type(thermo_var_ptrs) :: tv_tmp! A structure of temporary T & S.
real, parameter :: C1_6 = 1.0/6.0
real, parameter :: C1_6 = 1.0/6.0 ! [nondim]
integer, dimension(2) :: EOSdom ! The i-computational domain for the equation of state
integer :: is, ie, js, je, Isq, Ieq, Jsq, Jeq, nz, nkmb
integer :: i, j, k
Expand Down
5 changes: 3 additions & 2 deletions src/core/MOM_PressureForce_Montgomery.F90
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ subroutine PressureForce_Mont_nonBouss(h, tv, PFu, PFv, G, GV, US, CS, p_atm, pb

real :: I_gEarth ! The inverse of g_Earth [T2 Z L-2 ~> s2 m-1]
! real :: dalpha
real :: Pa_to_H ! A factor to convert from R L2 T-2 to the thickness units (H).
real :: Pa_to_H ! A factor to convert from R L2 T-2 to the thickness units (H)
! [H T2 R-1 L-2 ~> m2 s2 kg-1 or s2 m-1].
real :: alpha_Lay(SZK_(GV)) ! The specific volume of each layer [R-1 ~> m3 kg-1].
real :: dalpha_int(SZK_(GV)+1) ! The change in specific volume across each
! interface [R-1 ~> m3 kg-1].
Expand Down Expand Up @@ -380,7 +381,7 @@ subroutine PressureForce_Mont_Bouss(h, tv, PFu, PFv, G, GV, US, CS, p_atm, pbce,
M, & ! The Montgomery potential, M = (p/rho + gz) [L2 T-2 ~> m2 s-2].
rho_star ! In-situ density divided by the derivative with depth of the
! corrected e times (G_Earth/Rho0) [L2 Z-1 T-2 ~> m s-2].
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)+1) :: e ! Interface height in m.
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)+1) :: e ! Interface height [Z ~> m].
! e may be adjusted (with a nonlinear equation of state) so that
! its derivative compensates for the adiabatic compressibility
! in seawater, but e will still be close to the interface depth.
Expand Down
6 changes: 3 additions & 3 deletions src/core/MOM_barotropic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ subroutine btstep(U_in, V_in, eta_in, dt, bc_accel_u, bc_accel_v, forces, pbce,
real :: I_sum_wt_accel ! The inverse of the sum of the raw weights used to find average accelerations [nondim]
real :: I_sum_wt_trans ! The inverse of the sum of the raw weights used to find average transports [nondim]
real :: dt_filt ! The half-width of the barotropic filter [T ~> s].
real :: trans_wt1, trans_wt2 ! The weights used to compute ubt_trans and vbt_trans
real :: trans_wt1, trans_wt2 ! The weights used to compute ubt_trans and vbt_trans [nondim]
integer :: nfilter

logical :: apply_OBCs, apply_OBC_flather, apply_OBC_open
Expand Down Expand Up @@ -2889,7 +2889,7 @@ subroutine apply_velocity_OBCs(OBC, ubt, vbt, uhbt, vhbt, ubt_trans, vbt_trans,
integer, intent(in) :: halo !< The extra halo size to use here.
real, intent(in) :: dtbt !< The time step [T ~> s].
real, intent(in) :: bebt !< The fractional weighting of the future velocity
!! in determining the transport.
!! in determining the transport [nondim]
logical, intent(in) :: use_BT_cont !< If true, use the BT_cont_types to calculate
!! transports.
logical, intent(in) :: integral_BT_cont !< If true, update the barotropic continuity
Expand Down Expand Up @@ -4299,7 +4299,7 @@ subroutine barotropic_init(u, v, h, eta, Time, G, GV, US, param_file, diag, CS,
real :: mean_SL ! The mean sea level that is used along with the bathymetry to estimate the
! geometry when LINEARIZED_BT_CORIOLIS is true or BT_NONLIN_STRESS is false [Z ~> m].
real :: det_de ! The partial derivative due to self-attraction and loading of the reference
! geopotential with the sea surface height when tides are enabled.
! geopotential with the sea surface height when tides are enabled [nondim].
! This is typically ~0.09 or less.
real, allocatable :: lin_drag_h(:,:) ! A spatially varying linear drag coefficient at tracer points
! that acts on the barotropic flow [Z T-1 ~> m s-1].
Expand Down
4 changes: 2 additions & 2 deletions src/core/MOM_continuity.F90
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ subroutine continuity(u, v, hin, h, uh, vh, dt, G, GV, US, CS, OBC, pbv, uhbt, v
real, dimension(SZIB_(G),SZJ_(G),SZK_(GV)), &
optional, intent(in) :: visc_rem_u !< Both the fraction of
!! zonal momentum that remains after a time-step of viscosity, and the fraction of a time-step's
!! worth of a barotropic acceleration that a layer experiences after viscosity is applied.
!! worth of a barotropic acceleration that a layer experiences after viscosity is applied [nondim].
!! Non-dimensional between 0 (at the bottom) and 1 (far above the bottom).
real, dimension(SZI_(G),SZJB_(G),SZK_(GV)), &
optional, intent(in) :: visc_rem_v !< Both the fraction of
!! meridional momentum that remains after a time-step of viscosity, and the fraction of a time-step's
!! worth of a barotropic acceleration that a layer experiences after viscosity is applied.
!! worth of a barotropic acceleration that a layer experiences after viscosity is applied [nondim].
!! Non-dimensional between 0 (at the bottom) and 1 (far above the bottom).
real, dimension(SZIB_(G),SZJ_(G),SZK_(GV)), &
optional, intent(out) :: u_cor !< The zonal velocities that
Expand Down
Loading

0 comments on commit cd2852a

Please sign in to comment.