Skip to content

Commit

Permalink
Use square-bracket syntax in unit documentation
Browse files Browse the repository at this point in the history
  Changed comments indicating the units of variables in some of the user
directory modules to use square brackets, following the newly proposed MOM6
syntax convetion.  This has been verified to give correct output via dOxygen.
Only comments have been changed and all answers are bitwise identical.
  • Loading branch information
Hallberg-NOAA committed Dec 19, 2018
1 parent c2d6ff1 commit 0e2066d
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 54 deletions.
22 changes: 11 additions & 11 deletions src/user/Idealized_Hurricane.F90
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ module Idealized_hurricane
type, public :: idealized_hurricane_CS ; private

! Parameters used to compute Holland radial wind profile
real :: rho_a !< Mean air density [kg/m3]
real :: rho_a !< Mean air density [kg m-3]
real :: pressure_ambient !< Pressure at surface of ambient air [Pa]
real :: pressure_central !< Pressure at surface at hurricane center [Pa]
real :: rad_max_wind !< Radius of maximum winds [m]
real :: max_windspeed !< Maximum wind speeds [m/s]
real :: hurr_translation_spd !< Hurricane translation speed [m/s]
real :: hurr_translation_dir !< Hurricane translation speed [m/s]
real :: gustiness !< Gustiness (optional, used in u*) [m/s]
real :: Rho0 !< A reference ocean density [kg/m3]
real :: max_windspeed !< Maximum wind speeds [m s-1]
real :: hurr_translation_spd !< Hurricane translation speed [m s-1]
real :: hurr_translation_dir !< Hurricane translation speed [m s-1]
real :: gustiness !< Gustiness (optional, used in u*) [m s-1]
real :: Rho0 !< A reference ocean density [kg m-3]
real :: Hurr_cen_Y0 !< The initial y position of the hurricane
!! This experiment is conducted in a Cartesian
!! grid and this is assumed to be in meters [m]
Expand All @@ -69,7 +69,7 @@ module Idealized_hurricane


! Parameters used if in SCM (single column model) mode
logical :: SCM_mode !< Single Column Model Mode [nd]
logical :: SCM_mode !< If true this being used in Single Column Model mode
logical :: BR_BENCH !< A "benchmark" configuration (which is meant to
!! provide identical wind to reproduce a previous
!! experiment, where that wind formula contained
Expand Down Expand Up @@ -198,10 +198,10 @@ end subroutine idealized_hurricane_wind_init

!> Computes the surface wind for the idealized hurricane test cases
subroutine idealized_hurricane_wind_forcing(state, forces, day, G, US, CS)
type(surface), intent(in) :: state !< Surface state structure
type(mech_forcing), intent(inout) :: forces !< A structure with the driving mechanical forces
type(time_type), intent(in) :: day !< Time in days
type(ocean_grid_type), intent(inout) :: G !< Grid structure
type(surface), intent(in) :: state !< Surface state structure
type(mech_forcing), intent(inout) :: forces !< A structure with the driving mechanical forces
type(time_type), intent(in) :: day !< Time in days
type(ocean_grid_type), intent(inout) :: G !< Grid structure
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
type(idealized_hurricane_CS), pointer :: CS !< Container for idealized hurricane parameters

Expand Down
8 changes: 4 additions & 4 deletions src/user/MOM_wave_interface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1189,7 +1189,7 @@ subroutine StokesMixing(G, GV, DT, h, u, v, Waves )
intent(in) :: GV !< Ocean vertical grid
real, intent(in) :: Dt !< Time step of MOM6 [s] for explicit solver
real, dimension(SZI_(G),SZJ_(G),SZK_(G)),&
intent(in) :: h !< Layer/level thicknesses (H ~> m or kg m-2)
intent(in) :: h !< Layer thicknesses [H ~> m or kg m-2]
real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), &
intent(inout) :: u !< Velocity i-component (m/s)
real, dimension(SZI_(G),SZJB_(G),SZK_(G)), &
Expand Down Expand Up @@ -1257,11 +1257,11 @@ subroutine CoriolisStokes(G, GV, DT, h, u, v, WAVES)
intent(in) :: GV !< Ocean vertical grid
real, intent(in) :: Dt !< Time step of MOM6 [s] CHECK IF PASSING RIGHT TIMESTEP
real, dimension(SZI_(G),SZJ_(G),SZK_(G)), &
intent(in) :: h !< Layer/level thicknesses (H ~> m or kg m-2)
intent(in) :: h !< Layer thicknesses [H ~> m or kg m-2]
real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), &
intent(inout) :: u !< Velocity i-component (m/s)
intent(inout) :: u !< Velocity i-component [m s-1]
real, dimension(SZI_(G),SZJB_(G),SZK_(G)), &
intent(inout) :: v !< Velocity j-component (m/s)
intent(inout) :: v !< Velocity j-component [m s-1]
type(Wave_parameters_CS), &
pointer :: Waves !< Surface wave related control structure.
! Local variables
Expand Down
27 changes: 15 additions & 12 deletions src/user/Phillips_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,20 @@ subroutine Phillips_initialize_thickness(h, G, GV, US, param_file, just_read_par
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
intent(out) :: h !< The thickness that is being initialized, in H ~> m or kg m-2.
intent(out) :: h !< The thickness that is being initialized [H ~> m or kg m-2]
type(param_file_type), intent(in) :: param_file !< A structure indicating the open file
!! to parse for model parameter values.
logical, optional, intent(in) :: just_read_params !< If present and true, this call will
!! only read parameters without changing h.

real :: eta0(SZK_(G)+1) ! The 1-d nominal positions of the interfaces, in Z ~> m.
real :: eta_im(SZJ_(G),SZK_(G)+1) ! A temporary array for zonal-mean eta, in Z ~> m.
real :: eta1D(SZK_(G)+1) ! Interface height relative to the sea surface
! positive upward, in Z ~> m.
real :: damp_rate, jet_width, jet_height, y_2
real :: half_strat, half_depth
real :: eta0(SZK_(G)+1) ! The 1-d nominal positions of the interfaces [Z ~> m]
real :: eta_im(SZJ_(G),SZK_(G)+1) ! A temporary array for zonal-mean eta [Z ~> m]
real :: eta1D(SZK_(G)+1) ! Interface height relative to the sea surface, positive upward [Z ~> m]
real :: jet_width ! The width of the zonal-mean jet [km]
real :: jet_height ! The interface height scale associated with the zonal-mean jet [Z ~> m]
real :: y_2
real :: half_strat ! The fractional depth where the stratification is centered [nondim]
real :: half_depth ! The depth where the stratification is centered [Z ~> m]
logical :: just_read ! If true, just read parameters but set nothing.
character(len=40) :: mdl = "Phillips_initialize_thickness" ! This subroutine's name.
integer :: i, j, k, is, ie, js, je, isd, ied, jsd, jed, nz
Expand All @@ -64,8 +66,9 @@ subroutine Phillips_initialize_thickness(h, G, GV, US, param_file, just_read_par

if (.not.just_read) call log_version(param_file, mdl, version)
call get_param(param_file, mdl, "HALF_STRAT_DEPTH", half_strat, &
"The maximum depth of the ocean.", units="nondim", &
default = 0.5, do_not_log=just_read)
!### UNCOMMENT TO FIX THIS "The fractional depth where the stratification is centered.", &
"The maximum depth of the ocean.", &
units="nondim", default = 0.5, do_not_log=just_read)
call get_param(param_file, mdl, "JET_WIDTH", jet_width, &
"The width of the zonal-mean jet.", units="km", &
fail_if_missing=.not.just_read, do_not_log=just_read)
Expand Down Expand Up @@ -119,15 +122,15 @@ subroutine Phillips_initialize_velocity(u, v, G, GV, US, param_file, just_read_p
type(verticalGrid_type), intent(in) :: GV !< Vertical grid structure
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), &
intent(out) :: u !< i-component of velocity [m/s]
intent(out) :: u !< i-component of velocity [m s-1]
real, dimension(SZI_(G),SZJB_(G),SZK_(G)), &
intent(out) :: v !< j-component of velocity [m/s]
intent(out) :: v !< j-component of velocity [m s-1]
type(param_file_type), intent(in) :: param_file !< A structure indicating the open file to
!! parse for modelparameter values.
logical, optional, intent(in) :: just_read_params !< If present and true, this call will
!! only read parameters without changing h.

real :: damp_rate, jet_width, jet_height, x_2, y_2
real :: jet_width, jet_height, x_2, y_2
real :: velocity_amplitude, pi
integer :: i, j, k, is, ie, js, je, nz, m
logical :: just_read ! If true, just read parameters but set nothing.
Expand Down
18 changes: 9 additions & 9 deletions src/user/Rossby_front_2d_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ module Rossby_front_2d_initialization
public Rossby_front_initialize_velocity

! Parameters defining the initial conditions of this test case
real, parameter :: frontFractionalWidth = 0.5 !< Width of front as fraction of domain
real, parameter :: HMLmin = 0.25 !< Shallowest ML as fractional depth of ocean
real, parameter :: HMLmax = 0.75 !< Deepest ML as fractional depth of ocean
real, parameter :: frontFractionalWidth = 0.5 !< Width of front as fraction of domain [nondim]
real, parameter :: HMLmin = 0.25 !< Shallowest ML as fractional depth of ocean [nondim]
real, parameter :: HMLmax = 0.75 !< Deepest ML as fractional depth of ocean [nondim]

contains

Expand All @@ -39,7 +39,7 @@ subroutine Rossby_front_initialize_thickness(h, G, GV, param_file, just_read_par
type(ocean_grid_type), intent(in) :: G !< Grid structure
type(verticalGrid_type), intent(in) :: GV !< Vertical grid structure
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
intent(out) :: h !< The thickness that is being initialized, in H ~> m or kg m-2.
intent(out) :: h !< The thickness that is being initialized [H ~> m or kg m-2]
type(param_file_type), intent(in) :: param_file !< A structure indicating the open file
!! to parse for model parameter values.
logical, optional, intent(in) :: just_read_params !< If present and true, this call will
Expand Down Expand Up @@ -110,9 +110,9 @@ subroutine Rossby_front_initialize_temperature_salinity(T, S, h, G, GV, &
param_file, eqn_of_state, just_read_params)
type(ocean_grid_type), intent(in) :: G !< Grid structure
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(out) :: T !< Potential temperature [deg C]
real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(out) :: T !< Potential temperature [degC]
real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(out) :: S !< Salinity [ppt]
real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(in) :: h !< Thickness in H ~> m or kg m-2
real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(in) :: h !< Thickness [H ~> m or kg m-2]
type(param_file_type), intent(in) :: param_file !< Parameter file handle
type(EOS_type), pointer :: eqn_of_state !< Equation of state structure
logical, optional, intent(in) :: just_read_params !< If present and true, this call will
Expand Down Expand Up @@ -163,11 +163,11 @@ subroutine Rossby_front_initialize_velocity(u, v, h, G, GV, param_file, just_rea
type(ocean_grid_type), intent(in) :: G !< Grid structure
type(verticalGrid_type), intent(in) :: GV !< Vertical grid structure
real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), &
intent(out) :: u !< i-component of velocity [m/s]
intent(out) :: u !< i-component of velocity [m s-1]
real, dimension(SZI_(G),SZJB_(G),SZK_(G)), &
intent(out) :: v !< j-component of velocity [m/s]
intent(out) :: v !< j-component of velocity [m s-1]
real, dimension(SZI_(G),SZJ_(G), SZK_(G)), &
intent(in) :: h !< Thickness [H]
intent(in) :: h !< Thickness [H ~> m or kg m-2]
type(param_file_type), intent(in) :: param_file !< A structure indicating the open file
!! to parse for model parameter values.
logical, optional, intent(in) :: just_read_params !< If present and true, this call
Expand Down
11 changes: 5 additions & 6 deletions src/user/SCM_CVMix_tests.F90
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ module SCM_CVMix_tests
! their mks counterparts with notation like "a velocity, in Z T-1 ~> m s-1."

!> Container for surface forcing parameters
type SCM_CVMix_tests_CS
private
type SCM_CVMix_tests_CS ; private
logical :: UseWindStress !< True to use wind stress
logical :: UseHeatFlux !< True to use heat flux
logical :: UseHeatFlux !< True to use heat flux
logical :: UseEvaporation !< True to use evaporation
logical :: UseDiurnalSW !< True to use diurnal sw radiation
real :: tau_x !< (Constant) Wind stress, X (Pa)
Expand Down Expand Up @@ -112,8 +111,8 @@ subroutine SCM_CVMix_tests_TS_init(T, S, h, G, GV, US, param_file, just_read_par
top = 0. ! Reference to surface
bottom = 0.
do k=1,nz
bottom = bottom - h(i,j,k)*GV%H_to_Z ! Interface below layer (in m)
zC = 0.5*( top + bottom ) ! Z of middle of layer (in m)
bottom = bottom - h(i,j,k)*GV%H_to_Z ! Interface below layer [Z ~> m]
zC = 0.5*( top + bottom ) ! Z of middle of layer [Z ~> m]
DZ = min(0., zC + UpperLayerTempMLD)
T(i,j,k) = max(LowerLayerMinTemp,LowerLayerTemp + LowerLayerdTdZ * DZ)
DZ = min(0., zC + UpperLayerSaltMLD)
Expand Down Expand Up @@ -255,7 +254,7 @@ subroutine SCM_CVMix_tests_buoyancy_forcing(state, fluxes, day, G, CS)

if (CS%UseEvaporation) then
do J=Jsq,Jeq ; do i=is,ie
! Note CVMix test inputs give evaporation in m/s
! Note CVMix test inputs give evaporation in [m s-1]
! This therefore must be converted to mass flux
! by multiplying by density
fluxes%evap(i,J) = CS%surf_evap * CS%Rho0
Expand Down
6 changes: 3 additions & 3 deletions src/user/baroclinic_zone_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ subroutine baroclinic_zone_init_temperature_salinity(T, S, h, G, GV, US, param_f
type(ocean_grid_type), intent(in) :: G !< Grid structure
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(out) :: T !< Potential temperature [deg C]
real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(out) :: T !< Potential temperature [degC]
real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(out) :: S !< Salinity [ppt]
real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(in) :: h !< The model thicknesses in H ~> m or kg m-2
real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(in) :: h !< The model thicknesses [H ~> m or kg m-2]
type(param_file_type), intent(in) :: param_file !< Parameter file handle
logical, optional, intent(in) :: just_read_params !< If present and true, this call will
!! only read parameters without changing T & S.
Expand All @@ -90,7 +90,7 @@ subroutine baroclinic_zone_init_temperature_salinity(T, S, h, G, GV, US, param_f
real :: T_ref, dTdz, dTdx, delta_T ! Parameters describing temperature distribution
real :: S_ref, dSdz, dSdx, delta_S ! Parameters describing salinity distribution
real :: L_zone ! Width of baroclinic zone
real :: zc, zi ! Depths in depth units (Z ~> m).
real :: zc, zi ! Depths in depth units [Z ~> m]
real :: x, xd, xs, y, yd, fn
real :: PI ! 3.1415926... calculated as 4*atan(1)
logical :: just_read ! If true, just read parameters but set nothing.
Expand Down
10 changes: 5 additions & 5 deletions src/user/dense_water_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ module dense_water_initialization

character(len=40) :: mdl = "dense_water_initialization" !< Module name

real, parameter :: default_sill = 0.2 !< Default depth of the sill [nondim]
real, parameter :: default_shelf = 0.4 !< Default depth of the shelf [nondim]
real, parameter :: default_sill = 0.2 !< Default depth of the sill [nondim]
real, parameter :: default_shelf = 0.4 !< Default depth of the shelf [nondim]
real, parameter :: default_mld = 0.25 !< Default depth of the mixed layer [nondim]

contains
Expand Down Expand Up @@ -100,9 +100,9 @@ subroutine dense_water_initialize_TS(G, GV, param_file, eqn_of_state, T, S, h, j
type(verticalGrid_type), intent(in) :: GV !< Vertical grid control structure
type(param_file_type), intent(in) :: param_file !< Parameter file structure
type(EOS_type), pointer :: eqn_of_state !< EOS structure
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: T !< Output temperature (degC)
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: S !< Output salinity (ppt)
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: h !< Layer thicknesses
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: T !< Output temperature [degC]
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: S !< Output salinity [ppt]
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: h !< Layer thicknesses [H ~> m or kg m-2]
logical, optional, intent(in) :: just_read_params !< If present and true, this call will
!! only read parameters without changing h.
! Local variables
Expand Down
6 changes: 3 additions & 3 deletions src/user/soliton_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ end subroutine soliton_initialize_thickness
!> Initialization of u and v in the equatorial Rossby soliton test
subroutine soliton_initialize_velocity(u, v, h, G)
type(ocean_grid_type), intent(in) :: G !< Grid structure
real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(out) :: u !< i-component of velocity [m/s]
real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(out) :: v !< j-component of velocity [m/s]
real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(in) :: h !< Thickness [H]
real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(out) :: u !< i-component of velocity [m s-1]
real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(out) :: v !< j-component of velocity [m s-1]
real, dimension(SZI_(G),SZJ_(G), SZK_(G)), intent(in) :: h !< Thickness [H ~> m or kg m-2]

real :: x, y, x0, y0
real :: val1, val2, val3, val4
Expand Down
2 changes: 1 addition & 1 deletion src/user/user_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ end subroutine USER_initialize_thickness
!> initialize velocities.
subroutine USER_initialize_velocity(u, v, G, param_file, just_read_params)
type(ocean_grid_type), intent(in) :: G !< Ocean grid structure.
real, dimension(SZIB_(G), SZJ_(G), SZK_(G)), intent(out) :: u !< i-component of velocity [m/s]
real, dimension(SZIB_(G), SZJ_(G), SZK_(G)), intent(out) :: u !< i-component of velocity [m s-1]
real, dimension(SZI_(G), SZJB_(G), SZK_(G)), intent(out) :: v !< j-component of velocity [m/s]
type(param_file_type), intent(in) :: param_file !< A structure indicating the
!! open file to parse for model
Expand Down

0 comments on commit 0e2066d

Please sign in to comment.