Skip to content

Commit

Permalink
Documented temperature variable units
Browse files Browse the repository at this point in the history
  Changed comments to use the square bracket notation to document the units of
about 350 temperature, salinity and various other variables.  Also eliminated
several redundant argument documentation blocks.  Only comments have been
changed and all answers are bitwise identical.
  • Loading branch information
Hallberg-NOAA committed Dec 21, 2018
1 parent 6976ac6 commit e0c3d49
Show file tree
Hide file tree
Showing 23 changed files with 353 additions and 364 deletions.
11 changes: 5 additions & 6 deletions config_src/ice_solo_driver/user_surface_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ module user_surface_forcing
real :: G_Earth ! The gravitational acceleration [m s-2].
real :: Flux_const ! The restoring rate at the surface [m s-1].
real :: gust_const ! A constant unresolved background gustiness
! that contributes to ustar, in Pa.
! that contributes to ustar [Pa].

type(diag_ctrl), pointer :: diag ! A structure that is used to regulate the
! timing of diagnostic output.
Expand Down Expand Up @@ -126,7 +126,7 @@ subroutine USER_wind_forcing(sfc_state, forces, day, G, US, CS)
! Allocate the forcing arrays, if necessary.
call allocate_mech_forcing(G, forces, stress=.true., ustar=.true.)

! Set the surface wind stresses, in units of Pa. A positive taux
! Set the surface wind stresses [Pa]. A positive taux
! accelerates the ocean to the (pseudo-)east.

! The i-loop extends to is-1 so that taux can be used later in the
Expand All @@ -138,8 +138,7 @@ subroutine USER_wind_forcing(sfc_state, forces, day, G, US, CS)
forces%tauy(i,J) = G%mask2dCv(i,J) * 0.0 ! Change this to the desired expression.
enddo ; enddo

! Set the surface friction velocity, in units of m s-1. ustar
! is always positive.
! Set the surface friction velocity [Z s-1 ~> m s-1]. ustar is always positive.
if (associated(forces%ustar)) then ; do j=js,je ; do i=is,ie
! This expression can be changed if desired, but need not be.
forces%ustar(i,j) = US%m_to_Z * G%mask2dT(i,j) * sqrt(CS%gust_const/CS%Rho0 + &
Expand Down Expand Up @@ -177,8 +176,8 @@ subroutine USER_buoyancy_forcing(sfc_state, fluxes, day, dt, G, CS)
! are in W m-2 and positive for heat going into the ocean. All fresh water
! fluxes are in kg m-2 s-1 and positive for water moving into the ocean.

real :: Temp_restore ! The temperature that is being restored toward, in C.
real :: Salin_restore ! The salinity that is being restored toward, in PSU.
real :: Temp_restore ! The temperature that is being restored toward [C].
real :: Salin_restore ! The salinity that is being restored toward [ppt]
real :: density_restore ! The potential density that is being restored
! toward [kg m-3].
real :: rhoXcp ! The mean density times the heat capacity [J m-3 degC-1].
Expand Down
14 changes: 7 additions & 7 deletions config_src/solo_driver/MESO_surface_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ module MESO_surface_forcing
real :: G_Earth !< The gravitational acceleration [m s-2].
real :: Flux_const !< The restoring rate at the surface [m s-1].
real :: gust_const !< A constant unresolved background gustiness
!! that contributes to ustar, in Pa.
!! that contributes to ustar [Pa].
real, dimension(:,:), pointer :: &
T_Restore(:,:) => NULL(), & !< The temperature to restore the SST toward, in C.
S_Restore(:,:) => NULL(), & !< The salinity to restore the sea surface salnity toward, in PSU.
PmE(:,:) => NULL(), & !< The prescribed precip minus evap, in m s-1.
Solar(:,:) => NULL() !< The shortwave forcing into the ocean, in W m-2 m s-1.
T_Restore(:,:) => NULL(), & !< The temperature to restore the SST toward [degC].
S_Restore(:,:) => NULL(), & !< The salinity to restore the sea surface salnity toward [ppt]
PmE(:,:) => NULL(), & !< The prescribed precip minus evap [m s-1].
Solar(:,:) => NULL() !< The shortwave forcing into the ocean [W m-2].
real, dimension(:,:), pointer :: Heat(:,:) => NULL() !< The prescribed longwave, latent and sensible
!! heat flux into the ocean, in W m-2.
!! heat flux into the ocean [W m-2].
character(len=200) :: inputdir !< The directory where NetCDF input files are.
character(len=200) :: salinityrestore_file !< The file with the target sea surface salinity
character(len=200) :: SSTrestore_file !< The file with the target sea surface temperature
Expand Down Expand Up @@ -76,7 +76,7 @@ subroutine MESO_buoyancy_forcing(sfc_state, fluxes, day, dt, G, CS)
! fluxes are in kg m-2 s-1 and positive for water moving into the ocean.

real :: Temp_restore ! The temperature that is being restored toward [degC].
real :: Salin_restore ! The salinity that is being restored toward, in PSU.
real :: Salin_restore ! The salinity that is being restored toward [ppt]
real :: density_restore ! The potential density that is being restored
! toward [kg m-3].
real :: rhoXcp ! The mean density times the heat capacity [J m-3 degC-1].
Expand Down
54 changes: 27 additions & 27 deletions config_src/solo_driver/MOM_surface_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -78,32 +78,32 @@ module MOM_surface_forcing
real :: south_lat !< southern latitude of the domain
real :: len_lat !< domain length in latitude

real :: Rho0 !< Boussinesq reference density (kg/m^3)
real :: G_Earth !< gravitational acceleration (m/s^2)
real :: Rho0 !< Boussinesq reference density [kg m-3]
real :: G_Earth !< gravitational acceleration [m s-2]
real :: Flux_const !< piston velocity for surface restoring [m s-1]
real :: Flux_const_T !< piston velocity for surface temperature restoring [m s-1]
real :: Flux_const_S !< piston velocity for surface salinity restoring [m s-1]
real :: latent_heat_fusion !< latent heat of fusion (J/kg)
real :: latent_heat_vapor !< latent heat of vaporization (J/kg)
real :: latent_heat_fusion !< latent heat of fusion [J kg]
real :: latent_heat_vapor !< latent heat of vaporization [J kg]
real :: tau_x0 !< Constant zonal wind stress used in the WIND_CONFIG="const" forcing
real :: tau_y0 !< Constant meridional wind stress used in the WIND_CONFIG="const" forcing

real :: gust_const !< constant unresolved background gustiness for ustar (Pa)
real :: gust_const !< constant unresolved background gustiness for ustar [Pa]
logical :: read_gust_2d !< if true, use 2-dimensional gustiness supplied from a file
real, pointer :: gust(:,:) => NULL() !< spatially varying unresolved background gustiness (Pa)
real, pointer :: gust(:,:) => NULL() !< spatially varying unresolved background gustiness [Pa]
!! gust is used when read_gust_2d is true.

real, pointer :: T_Restore(:,:) => NULL() !< temperature to damp (restore) the SST to (deg C)
real, pointer :: S_Restore(:,:) => NULL() !< salinity to damp (restore) the SSS (g/kg)
real, pointer :: Dens_Restore(:,:) => NULL() !< density to damp (restore) surface density (kg/m^3)
real, pointer :: T_Restore(:,:) => NULL() !< temperature to damp (restore) the SST to [degC]
real, pointer :: S_Restore(:,:) => NULL() !< salinity to damp (restore) the SSS [ppt]
real, pointer :: Dens_Restore(:,:) => NULL() !< density to damp (restore) surface density [kg m-3]

integer :: buoy_last_lev_read = -1 !< The last time level read from buoyancy input files

! if WIND_CONFIG=='gyres' then use the following as = A, B, C and n respectively for
! taux = A + B*sin(n*pi*y/L) + C*cos(n*pi*y/L)
real :: gyres_taux_const !< A constant wind stress, in Pa.
real :: gyres_taux_sin_amp !< The amplitude of cosine wind stress gyres, in Pa, if WIND_CONFIG=='gyres'.
real :: gyres_taux_cos_amp !< The amplitude of cosine wind stress gyres, in Pa, if WIND_CONFIG=='gyres'.
real :: gyres_taux_const !< A constant wind stress [Pa].
real :: gyres_taux_sin_amp !< The amplitude of cosine wind stress gyres [Pa], if WIND_CONFIG=='gyres'.
real :: gyres_taux_cos_amp !< The amplitude of cosine wind stress gyres [Pa], if WIND_CONFIG=='gyres'.
real :: gyres_taux_n_pis !< The number of sine lobes in the basin if if WIND_CONFIG=='gyres'


Expand Down Expand Up @@ -360,8 +360,8 @@ subroutine wind_forcing_const(sfc_state, forces, tau_x0, tau_y0, day, G, US, CS)
type(surface), intent(inout) :: sfc_state !< A structure containing fields that
!! describe the surface state of the ocean.
type(mech_forcing), intent(inout) :: forces !< A structure with the driving mechanical forces
real, intent(in) :: tau_x0 !< The zonal wind stress in Pa
real, intent(in) :: tau_y0 !< The meridional wind stress in Pa
real, intent(in) :: tau_x0 !< The zonal wind stress [Pa]
real, intent(in) :: tau_y0 !< The meridional wind stress [Pa]
type(time_type), intent(in) :: day !< The time of the fluxes
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
Expand Down Expand Up @@ -484,7 +484,7 @@ subroutine wind_forcing_gyres(sfc_state, forces, day, G, US, CS)
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec
Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB

! steady surface wind stresses (Pa)
! steady surface wind stresses [Pa]
PI = 4.0*atan(1.0)

do j=js-1,je+1 ; do I=is-1,Ieq
Expand Down Expand Up @@ -522,7 +522,7 @@ subroutine wind_forcing_from_file(sfc_state, forces, day, G, US, CS)
! Local variables
character(len=200) :: filename ! The name of the input file.
real :: temp_x(SZI_(G),SZJ_(G)) ! Pseudo-zonal and psuedo-meridional
real :: temp_y(SZI_(G),SZJ_(G)) ! wind stresses at h-points, in Pa.
real :: temp_y(SZI_(G),SZJ_(G)) ! wind stresses at h-points [Pa].
integer :: time_lev_daily ! The time levels to read for fields with
integer :: time_lev_monthly ! daily and montly cycles.
integer :: time_lev ! The time level that is used for a field.
Expand Down Expand Up @@ -671,7 +671,7 @@ subroutine wind_forcing_by_data_override(sfc_state, forces, day, G, US, CS)
!! a previous surface_forcing_init call
! Local variables
real :: temp_x(SZI_(G),SZJ_(G)) ! Pseudo-zonal and psuedo-meridional
real :: temp_y(SZI_(G),SZJ_(G)) ! wind stresses at h-points, in Pa.
real :: temp_y(SZI_(G),SZJ_(G)) ! wind stresses at h-points [Pa].
real :: temp_ustar(SZI_(G),SZJ_(G)) ! ustar [m s-1] (not rescaled).
integer :: i, j, is_in, ie_in, js_in, je_in
logical :: read_uStar
Expand Down Expand Up @@ -743,15 +743,15 @@ subroutine buoyancy_forcing_from_files(sfc_state, fluxes, day, dt, G, CS)
real, dimension(SZI_(G),SZJ_(G)) :: &
temp, & ! A 2-d temporary work array with various units.
SST_anom, & ! Instantaneous sea surface temperature anomalies from a
! target (observed) value, in deg C.
! target (observed) value [degC].
SSS_anom, & ! Instantaneous sea surface salinity anomalies from a target
! (observed) value, in g kg-1.
! (observed) value [ppt].
SSS_mean ! A (mean?) salinity about which to normalize local salinity
! anomalies when calculating restorative precipitation
! anomalies, in g kg-1.
! anomalies [ppt].

real :: rhoXcp ! reference density times heat capacity (J/(m^3 * K))
real :: Irho0 ! inverse of the Boussinesq reference density (m^3/kg)
real :: rhoXcp ! reference density times heat capacity [J m-3 degC-1]
real :: Irho0 ! inverse of the Boussinesq reference density [m3 kg-1]

integer :: time_lev_daily ! time levels to read for fields with daily cycle
integer :: time_lev_monthly ! time levels to read for fields with monthly cycle
Expand Down Expand Up @@ -1021,14 +1021,14 @@ subroutine buoyancy_forcing_from_data_override(sfc_state, fluxes, day, dt, G, CS
real, dimension(SZI_(G),SZJ_(G)) :: &
temp, & ! A 2-d temporary work array with various units.
SST_anom, & ! Instantaneous sea surface temperature anomalies from a
! target (observed) value, in deg C.
! target (observed) value [degC].
SSS_anom, & ! Instantaneous sea surface salinity anomalies from a target
! (observed) value, in g kg-1.
! (observed) value [ppt].
SSS_mean ! A (mean?) salinity about which to normalize local salinity
! anomalies when calculating restorative precipitation
! anomalies, in g kg-1.
real :: rhoXcp ! The mean density times the heat capacity, in J m-3 K-1.
real :: Irho0 ! The inverse of the Boussinesq density, in m3 kg-1.
! anomalies [ppt].
real :: rhoXcp ! The mean density times the heat capacity [J m-3 degC-1].
real :: Irho0 ! The inverse of the Boussinesq density [m3 kg-1].

integer :: time_lev_daily ! The time levels to read for fields with
integer :: time_lev_monthly ! daily and montly cycles.
Expand Down
4 changes: 2 additions & 2 deletions config_src/solo_driver/user_surface_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module user_surface_forcing
real :: G_Earth !< The gravitational acceleration [m s-2].
real :: Flux_const !< The restoring rate at the surface [m s-1].
real :: gust_const !< A constant unresolved background gustiness
!! that contributes to ustar, in Pa.
!! that contributes to ustar [Pa].

type(diag_ctrl), pointer :: diag !< A structure that is used to regulate the
!! timing of diagnostic output.
Expand Down Expand Up @@ -125,7 +125,7 @@ subroutine USER_buoyancy_forcing(sfc_state, fluxes, day, dt, G, CS)

! Local variables
real :: Temp_restore ! The temperature that is being restored toward [degC].
real :: Salin_restore ! The salinity that is being restored toward, in PSU.
real :: Salin_restore ! The salinity that is being restored toward [ppt]
real :: density_restore ! The potential density that is being restored
! toward [kg m-3].
real :: rhoXcp ! The mean density times the heat capacity [J m-3 degC-1].
Expand Down
4 changes: 2 additions & 2 deletions src/core/MOM_PressureForce_analytic_FV.F90
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,14 @@ subroutine PressureForce_AFV_nonBouss(h, tv, PFu, PFv, G, GV, US, CS, ALE_CSp, p
real :: g_Earth_z ! A scaled version of g_Earth [m2 Z-1 s-2 ~> m s-2].
real :: I_gEarth ! The inverse of g_Earth_z [s2 Z m-2 ~> s2 m-1]
real :: alpha_anom ! The in-situ specific volume, averaged over a
! layer, less alpha_ref, in m3 kg-1.
! layer, less alpha_ref [m3 kg-1].
logical :: use_p_atm ! If true, use the atmospheric pressure.
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 :: alpha_ref ! A reference specific volume, in m3 kg-1, that is used
real :: alpha_ref ! A reference specific volume [m3 kg-1], that is used
! to reduce the impact of truncation errors.
real :: rho_in_situ(SZI_(G)) ! The in situ density [kg m-3].
real :: Pa_to_H ! A factor to convert from Pa to the thicknesss units (H).
Expand Down
14 changes: 8 additions & 6 deletions src/core/MOM_checksum_packages.F90
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ subroutine MOM_state_chksum_5arg(mesg, u, v, h, uh, vh, G, GV, haloshift, symmet
real, dimension(SZI_(G),SZJ_(G),SZK_(G)), &
intent(in) :: h !< Layer thicknesses [H ~> m or kg m-2].
real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), &
intent(in) :: uh !< Volume flux through zonal faces = u*h*dy, m3 s-1.
intent(in) :: uh !< Volume flux through zonal faces = u*h*dy
!! [H m2 s-1 ~> m3 s-1 or kg s-1].
real, dimension(SZI_(G),SZJB_(G),SZK_(G)), &
intent(in) :: vh !< Volume flux through meridional faces = v*h*dx, in m3 s-1.
intent(in) :: vh !< Volume flux through meridional faces = v*h*dx
!! [H m2 s-1 ~> m3 s-1 or kg s-1].
integer, optional, intent(in) :: haloshift !< The width of halos to check (default 0).
logical, optional, intent(in) :: symmetric !< If true, do checksums on the fully symmetric
!! computationoal domain.
Expand Down Expand Up @@ -185,10 +187,10 @@ subroutine MOM_accel_chksum(mesg, CAu, CAv, PFu, PFv, diffu, diffv, G, GV, pbce,
!! [m2 s-2 H-1 ~> m s-2 or m4 s-2 kg-1].
real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), &
optional, intent(in) :: u_accel_bt !< The zonal acceleration from terms in the
!! barotropic solver,in m s-2.
!! barotropic solver [m s-2].
real, dimension(SZI_(G),SZJB_(G),SZK_(G)), &
optional, intent(in) :: v_accel_bt !< The meridional acceleration from terms in
!! the barotropic solver,in m s-2.
!! the barotropic solver [m s-2].
logical, optional, intent(in) :: symmetric !< If true, do checksums on the fully symmetric
!! computationoal domain.

Expand Down Expand Up @@ -223,9 +225,9 @@ subroutine MOM_state_stats(mesg, u, v, h, Temp, Salt, G, allowChange, permitDimi
real, dimension(SZI_(G),SZJ_(G),SZK_(G)), &
intent(in) :: h !< Layer thicknesses [H ~> m or kg m-2].
real, pointer, dimension(:,:,:), &
intent(in) :: Temp !< Temperature in degree C.
intent(in) :: Temp !< Temperature [degC].
real, pointer, dimension(:,:,:), &
intent(in) :: Salt !< Salinity, in ppt.
intent(in) :: Salt !< Salinity [ppt].
logical, optional, intent(in) :: allowChange !< do not flag an error
!! if the statistics change.
logical, optional, intent(in) :: permitDiminishing !< do not flag error
Expand Down
8 changes: 4 additions & 4 deletions src/core/MOM_continuity.F90
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ subroutine continuity(u, v, hin, h, uh, vh, dt, G, GV, CS, uhbt, vhbt, OBC, &
intent(inout) :: h !< Final layer thickness [H ~> m or kg m-2].
real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), &
intent(out) :: uh !< Volume flux through zonal faces =
!! u*h*dy, in m3/s.
!! u*h*dy [H m2 s-1 ~> m3 s-1 or kg s-1].
real, dimension(SZI_(G),SZJB_(G),SZK_(G)), &
intent(out) :: vh !< Volume flux through meridional faces =
!! v*h*dx, in m3/s.
!! v*h*dx [H m2 s-1 ~> m3 s-1 or kg s-1].
real, intent(in) :: dt !< Time increment [s].
type(continuity_CS), pointer :: CS !< Control structure for mom_continuity.
real, dimension(SZIB_(G),SZJ_(G)), &
optional, intent(in) :: uhbt !< The vertically summed volume
!! flux through zonal faces, in m3/s.
!! flux through zonal faces [H m2 s-1 ~> m3 s-1 or kg s-1].
real, dimension(SZI_(G),SZJB_(G)), &
optional, intent(in) :: vhbt !< The vertically summed volume
!! flux through meridional faces, in m3/s.
!! flux through meridional faces [H m2 s-1 ~> m3 s-1 or kg s-1].
type(ocean_OBC_type), &
optional, pointer :: OBC !< Open boundaries control structure.
real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), &
Expand Down
Loading

0 comments on commit e0c3d49

Please sign in to comment.