From 6976ac606aa3d71179efb7e3e53f5d8ac7dc5916 Mon Sep 17 00:00:00 2001 From: Robert Hallberg Date: Fri, 21 Dec 2018 14:27:06 -0500 Subject: [PATCH] Documented density variable units Changed comments to use the square bracket notation to document the units of about 500 density and related variables. Also eliminated several redundant argument documentation blocks. Only comments have been changed and all answers are bitwise identical. --- .../coupled_driver/MOM_surface_forcing.F90 | 4 +- config_src/coupled_driver/ocean_model_MOM.F90 | 2 +- .../ice_solo_driver/user_surface_forcing.F90 | 42 +- config_src/mct_driver/MOM_ocean_model.F90 | 2 +- .../solo_driver/MESO_surface_forcing.F90 | 12 +- .../solo_driver/Neverland_surface_forcing.F90 | 4 +- .../solo_driver/user_surface_forcing.F90 | 12 +- src/ALE/coord_rho.F90 | 4 +- src/ALE/coord_slight.F90 | 10 +- src/ALE/regrid_interp.F90 | 2 +- src/core/MOM.F90 | 15 +- src/core/MOM_PressureForce_Montgomery.F90 | 86 ++-- src/core/MOM_PressureForce_blocked_AFV.F90 | 70 ++-- src/core/MOM_barotropic.F90 | 22 +- src/core/MOM_dynamics_unsplit.F90 | 10 +- src/core/MOM_dynamics_unsplit_RK2.F90 | 10 +- src/core/MOM_isopycnal_slopes.F90 | 28 +- src/core/MOM_variables.F90 | 36 +- src/core/MOM_verticalGrid.F90 | 14 +- src/diagnostics/MOM_diagnostics.F90 | 4 +- src/equation_of_state/MOM_EOS.F90 | 366 +++++++++--------- src/equation_of_state/MOM_EOS_NEMO.F90 | 58 +-- src/equation_of_state/MOM_EOS_TEOS10.F90 | 98 ++--- src/equation_of_state/MOM_EOS_UNESCO.F90 | 110 +++--- src/equation_of_state/MOM_EOS_Wright.F90 | 176 +++++---- src/equation_of_state/MOM_EOS_linear.F90 | 220 ++++++----- .../MOM_coord_initialization.F90 | 22 +- .../MOM_state_initialization.F90 | 55 +-- .../lateral/MOM_mixed_layer_restrat.F90 | 31 +- .../lateral/MOM_thickness_diffuse.F90 | 59 +-- .../vertical/MOM_CVMix_ddiff.F90 | 4 +- .../vertical/MOM_bulk_mixed_layer.F90 | 88 ++--- .../vertical/MOM_entrain_diffusive.F90 | 23 +- .../vertical/MOM_full_convection.F90 | 10 +- .../vertical/MOM_internal_tide_input.F90 | 2 +- .../vertical/MOM_set_diffusivity.F90 | 8 +- .../vertical/MOM_set_viscosity.F90 | 8 +- src/parameterizations/vertical/MOM_sponge.F90 | 8 +- src/tracer/MOM_offline_main.F90 | 8 +- src/tracer/MOM_tracer_hor_diff.F90 | 4 +- src/user/BFB_surface_forcing.F90 | 6 +- src/user/DOME_initialization.F90 | 8 +- src/user/ISOMIP_initialization.F90 | 24 +- src/user/Phillips_initialization.F90 | 6 +- src/user/benchmark_initialization.F90 | 14 +- src/user/dumbbell_surface_forcing.F90 | 10 +- src/user/user_change_diffusivity.F90 | 12 +- 47 files changed, 904 insertions(+), 923 deletions(-) diff --git a/config_src/coupled_driver/MOM_surface_forcing.F90 b/config_src/coupled_driver/MOM_surface_forcing.F90 index 6d161aad00..1b8770fba4 100644 --- a/config_src/coupled_driver/MOM_surface_forcing.F90 +++ b/config_src/coupled_driver/MOM_surface_forcing.F90 @@ -228,7 +228,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, G, US, CS, sfc net_FW, & ! The area integrated net freshwater flux into the ocean [kg s-1] net_FW2, & ! The area integrated net freshwater flux into the ocean [kg s-1] work_sum, & ! A 2-d array that is used as the work space for global sums [m2] or [kg s-1] - open_ocn_mask ! a binary field indicating where ice is present based on frazil criteria + open_ocn_mask ! a binary field indicating where ice is present based on frazil criteria [nondim] integer :: i, j, is, ie, js, je, Isq, Ieq, Jsq, Jeq, i0, j0 integer :: isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB, isr, ier, jsr, jer @@ -1019,7 +1019,7 @@ subroutine apply_flux_adjustments(G, CS, Time, fluxes) type(forcing), intent(inout) :: fluxes !< Surface fluxes structure ! Local variables - real, dimension(SZI_(G),SZJ_(G)) :: temp_at_h ! Fluxes at h points (W m-2 or kg m-2 s-1) + real, dimension(SZI_(G),SZJ_(G)) :: temp_at_h ! Various fluxes at h points [W m-2] or [kg m-2 s-1] integer :: isc, iec, jsc, jec, i, j logical :: overrode_h diff --git a/config_src/coupled_driver/ocean_model_MOM.F90 b/config_src/coupled_driver/ocean_model_MOM.F90 index ce42e26b45..57d0882870 100644 --- a/config_src/coupled_driver/ocean_model_MOM.F90 +++ b/config_src/coupled_driver/ocean_model_MOM.F90 @@ -239,7 +239,7 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn) !! tracer fluxes, and can be used to spawn related !! internal variables in the ice model. ! Local variables - real :: Rho0 ! The Boussinesq ocean density, in kg m-3. + real :: Rho0 ! The Boussinesq ocean density [kg m-3]. real :: G_Earth ! The gravitational acceleration [m s-2]. real :: HFrz !< If HFrz > 0 (m), melt potential will be computed. !! The actual depth over which melt potential is computed will diff --git a/config_src/ice_solo_driver/user_surface_forcing.F90 b/config_src/ice_solo_driver/user_surface_forcing.F90 index 56baa4579e..41694af97c 100644 --- a/config_src/ice_solo_driver/user_surface_forcing.F90 +++ b/config_src/ice_solo_driver/user_surface_forcing.F90 @@ -79,7 +79,7 @@ module user_surface_forcing ! state variables. logical :: restorebuoy ! If true, use restoring surface buoyancy forcing. real :: Rho0 ! The density used in the Boussinesq - ! approximation, in kg m-3. + ! approximation [kg m-3]. 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 @@ -109,15 +109,6 @@ subroutine USER_wind_forcing(sfc_state, forces, day, G, US, CS) ! direction as the u- and v- velocities.) They are both in Pa. ! In addition, this subroutine can be used to set the surface friction ! velocity, forces%ustar [Z s-1 ~> m s-1]. This is needed with a bulk mixed layer. -! -! Arguments: state - A structure containing fields that describe the -! surface state of the ocean. -! (out) fluxes - A structure containing pointers to any possible -! forcing fields. Unused fields have NULL ptrs. -! (in) day - Time of the fluxes. -! (in) G - The ocean's grid structure. -! (in) CS - A pointer to the control structure returned by a previous -! call to user_surface_forcing_init integer :: i, j, is, ie, js, je, Isq, Ieq, Jsq, Jeq integer :: isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB @@ -186,24 +177,13 @@ 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. -! Arguments: state - A structure containing fields that describe the -! surface state of the ocean. -! (out) fluxes - A structure containing pointers to any possible -! forcing fields. Unused fields have NULL ptrs. -! (in) day_start - Start time of the fluxes. -! (in) day_interval - Length of time over which these fluxes -! will be applied. -! (in) G - The ocean's grid structure. -! (in) CS - A pointer to the control structure returned by a previous -! call to user_surface_forcing_init - 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 :: density_restore ! The potential density that is being restored - ! toward, in kg m-3. - real :: rhoXcp ! The mean density times the heat capacity, in J m-3 K-1. + ! toward [kg m-3]. + real :: rhoXcp ! The mean density times the heat capacity [J m-3 degC-1]. real :: buoy_rest_const ! A constant relating density anomalies to the - ! restoring buoyancy flux, in m5 s-3 kg-1. + ! restoring buoyancy flux [m5 s-3 kg-1]. integer :: i, j, is, ie, js, je integer :: isd, ied, jsd, jed @@ -294,7 +274,7 @@ subroutine USER_buoyancy_forcing(sfc_state, fluxes, day, dt, G, CS) buoy_rest_const = -1.0 * (CS%G_Earth * CS%Flux_const) / CS%Rho0 do j=js,je ; do i=is,ie ! Set density_restore to an expression for the surface potential - ! density in kg m-3 that is being restored toward. + ! density [kg m-3] that is being restored toward. density_restore = 1030.0 fluxes%buoy(i,j) = G%mask2dT(i,j) * buoy_rest_const * & @@ -314,16 +294,8 @@ subroutine USER_surface_forcing_init(Time, G, param_file, diag, CS) type(user_surface_forcing_CS), pointer :: CS !< A pointer that is set to point to !! the control structure for this module -! Arguments: Time - The current model time. -! (in) G - The ocean's grid structure. -! (in) param_file - A structure indicating the open file to parse for -! model parameter values. -! (in) diag - A structure that is used to regulate diagnostic output. -! (in/out) CS - A pointer that is set to point to the control structure -! for this module - -! This include declares and sets the variable "version". -#include "version_variable.h" + ! This include declares and sets the variable "version". +# include "version_variable.h" character(len=40) :: mdl = "user_surface_forcing" ! This module's name. if (associated(CS)) then diff --git a/config_src/mct_driver/MOM_ocean_model.F90 b/config_src/mct_driver/MOM_ocean_model.F90 index a8f67c1e79..64ef660dbf 100644 --- a/config_src/mct_driver/MOM_ocean_model.F90 +++ b/config_src/mct_driver/MOM_ocean_model.F90 @@ -247,7 +247,7 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn, i ! Because of the way that indicies and domains are handled, Ocean_sfc must have ! been used in a previous call to initialize_ocean_type. - real :: Rho0 !< The Boussinesq ocean density, in kg m-3. + real :: Rho0 !< The Boussinesq ocean density [kg m-3]. real :: G_Earth !< The gravitational acceleration [m s-2]. !! This include declares and sets the variable "version". real :: HFrz !< If HFrz > 0 (m), melt potential will be computed. diff --git a/config_src/solo_driver/MESO_surface_forcing.F90 b/config_src/solo_driver/MESO_surface_forcing.F90 index fd172cfaf1..e6f35274bf 100644 --- a/config_src/solo_driver/MESO_surface_forcing.F90 +++ b/config_src/solo_driver/MESO_surface_forcing.F90 @@ -26,7 +26,7 @@ module MESO_surface_forcing logical :: use_temperature !< If true, temperature and salinity are used as state variables. logical :: restorebuoy !< If true, use restoring surface buoyancy forcing. - real :: Rho0 !< The density used in the Boussinesq approximation, in kg m-3. + real :: Rho0 !< The density used in the Boussinesq approximation [kg m-3]. 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 @@ -75,13 +75,13 @@ subroutine MESO_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 :: Temp_restore ! The temperature that is being restored toward [degC]. real :: Salin_restore ! The salinity that is being restored toward, in PSU. real :: density_restore ! The potential density that is being restored - ! toward, in kg m-3. - real :: rhoXcp ! The mean density times the heat capacity, in J m-3 K-1. + ! toward [kg m-3]. + real :: rhoXcp ! The mean density times the heat capacity [J m-3 degC-1]. real :: buoy_rest_const ! A constant relating density anomalies to the - ! restoring buoyancy flux, in m5 s-3 kg-1. + ! restoring buoyancy flux [m5 s-3 kg-1]. integer :: i, j, is, ie, js, je integer :: isd, ied, jsd, jed @@ -192,7 +192,7 @@ subroutine MESO_buoyancy_forcing(sfc_state, fluxes, day, dt, G, CS) buoy_rest_const = -1.0 * (CS%G_Earth * CS%Flux_const) / CS%Rho0 do j=js,je ; do i=is,ie ! Set density_restore to an expression for the surface potential - ! density in kg m-3 that is being restored toward. + ! density [kg m-3] that is being restored toward. density_restore = 1030.0 fluxes%buoy(i,j) = G%mask2dT(i,j) * buoy_rest_const * & diff --git a/config_src/solo_driver/Neverland_surface_forcing.F90 b/config_src/solo_driver/Neverland_surface_forcing.F90 index c727b62833..bd99299531 100644 --- a/config_src/solo_driver/Neverland_surface_forcing.F90 +++ b/config_src/solo_driver/Neverland_surface_forcing.F90 @@ -32,7 +32,7 @@ module Neverland_surface_forcing logical :: use_temperature !< If true, use temperature and salinity. logical :: restorebuoy !< If true, use restoring surface buoyancy forcing. real :: Rho0 !< The density used in the Boussinesq - !! approximation, in kg m-3. + !! approximation [kg m-3]. real :: G_Earth !< The gravitational acceleration [m s-2]. real :: flux_const !< The restoring rate at the surface [m s-1]. real, dimension(:,:), pointer :: & @@ -197,7 +197,7 @@ subroutine Neverland_buoyancy_forcing(sfc_state, fluxes, day, dt, G, CS) buoy_rest_const = -1.0 * (CS%G_Earth * CS%flux_const) / CS%Rho0 do j=js,je ; do i=is,ie ! Set density_restore to an expression for the surface potential - ! density in kg m-3 that is being restored toward. + ! density [kg m-3] that is being restored toward. density_restore = 1030.0 fluxes%buoy(i,j) = G%mask2dT(i,j) * buoy_rest_const * & diff --git a/config_src/solo_driver/user_surface_forcing.F90 b/config_src/solo_driver/user_surface_forcing.F90 index ce77d6dd8c..4472ea9a76 100644 --- a/config_src/solo_driver/user_surface_forcing.F90 +++ b/config_src/solo_driver/user_surface_forcing.F90 @@ -33,7 +33,7 @@ module user_surface_forcing logical :: use_temperature !< If true, temperature and salinity are used as state variables. logical :: restorebuoy !< If true, use restoring surface buoyancy forcing. - real :: Rho0 !< The density used in the Boussinesq approximation, in kg m-3. + real :: Rho0 !< The density used in the Boussinesq approximation [kg m-3]. 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 @@ -124,13 +124,13 @@ subroutine USER_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. ! Local variables - real :: Temp_restore ! The temperature that is being restored toward, in C. + real :: Temp_restore ! The temperature that is being restored toward [degC]. real :: Salin_restore ! The salinity that is being restored toward, in PSU. real :: density_restore ! The potential density that is being restored - ! toward, in kg m-3. - real :: rhoXcp ! The mean density times the heat capacity, in J m-3 K-1. + ! toward [kg m-3]. + real :: rhoXcp ! The mean density times the heat capacity [J m-3 degC-1]. real :: buoy_rest_const ! A constant relating density anomalies to the - ! restoring buoyancy flux, in m5 s-3 kg-1. + ! restoring buoyancy flux [m5 s-3 kg-1]. integer :: i, j, is, ie, js, je integer :: isd, ied, jsd, jed @@ -221,7 +221,7 @@ subroutine USER_buoyancy_forcing(sfc_state, fluxes, day, dt, G, CS) buoy_rest_const = -1.0 * (CS%G_Earth * CS%Flux_const) / CS%Rho0 do j=js,je ; do i=is,ie ! Set density_restore to an expression for the surface potential - ! density in kg m-3 that is being restored toward. + ! density [kg m-3] that is being restored toward. density_restore = 1030.0 fluxes%buoy(i,j) = G%mask2dT(i,j) * buoy_rest_const * & diff --git a/src/ALE/coord_rho.F90 b/src/ALE/coord_rho.F90 index 6c9ec71582..16c05943aa 100644 --- a/src/ALE/coord_rho.F90 +++ b/src/ALE/coord_rho.F90 @@ -26,7 +26,7 @@ module coord_rho !! If false, integrate from the bottom upward, as does the rest of the model. logical :: integrate_downward_for_e = .false. - !> Nominal density of interfaces, in kg m-3 + !> Nominal density of interfaces [kg m-3] real, allocatable, dimension(:) :: target_density !> Interpolation control structure @@ -47,7 +47,7 @@ subroutine init_coord_rho(CS, nk, ref_pressure, target_density, interp_CS) type(rho_CS), pointer :: CS !< Unassociated pointer to hold the control structure integer, intent(in) :: nk !< Number of layers in the grid real, intent(in) :: ref_pressure !< Nominal density of interfaces in Pa - real, dimension(:), intent(in) :: target_density !< Nominal density of interfaces in kg m-3 + real, dimension(:), intent(in) :: target_density !< Nominal density of interfaces [kg m-3] type(interp_CS_type), intent(in) :: interp_CS !< Controls for interpolation if (associated(CS)) call MOM_error(FATAL, "init_coord_rho: CS already associated!") diff --git a/src/ALE/coord_slight.F90 b/src/ALE/coord_slight.F90 index 935804e301..d510388414 100644 --- a/src/ALE/coord_slight.F90 +++ b/src/ALE/coord_slight.F90 @@ -51,7 +51,7 @@ module coord_slight !> A value of the stratification ratio that defines a problematic halocline region (nondim). real :: halocline_strat_tol - !> Nominal density of interfaces, in kg m-3. + !> Nominal density of interfaces [kg m-3]. real, allocatable, dimension(:) :: target_density !> Maximum depths of interfaces [H ~> m or kg m-2]. @@ -73,7 +73,7 @@ subroutine init_coord_slight(CS, nk, ref_pressure, target_density, interp_CS, m_ type(slight_CS), pointer :: CS !< Unassociated pointer to hold the control structure integer, intent(in) :: nk !< Number of layers in the grid real, intent(in) :: ref_pressure !< Nominal density of interfaces in Pa - real, dimension(:), intent(in) :: target_density !< Nominal density of interfaces in kg m-3 + real, dimension(:), intent(in) :: target_density !< Nominal density of interfaces [kg m-3] type(interp_CS_type), intent(in) :: interp_CS !< Controls for interpolation real, optional, intent(in) :: m_to_H !< A conversion factor from m to the units of thicknesses @@ -211,9 +211,9 @@ subroutine build_slight_column(CS, eqn_of_state, H_to_Pa, H_subroundoff, & real :: dz ! A uniform layer thickness in very shallow water [H ~> m or kg m-2]. real :: dz_ur ! The total thickness of an unstable region [H ~> m or kg m-2]. real :: wgt, cowgt ! A weight and its complement, nondim. - real :: rho_ml_av ! The average potential density in a near-surface region, in kg m-3. + real :: rho_ml_av ! The average potential density in a near-surface region [kg m-3]. real :: H_ml_av ! A thickness to try to use in taking the near-surface average [H ~> m or kg m-2]. - real :: rho_x_z ! A cumulative integral of a density, in kg m-3 H. + real :: rho_x_z ! A cumulative integral of a density [kg m-3 H ~> kg m-2 or kg2 m-5]. real :: z_wt ! The thickness actually used in taking the near-surface average [H ~> m or kg m-2]. real :: k_interior ! The (real) value of k where the interior grid starts. real :: k_int2 ! The (real) value of k where the interior grid starts. @@ -503,7 +503,7 @@ subroutine rho_interfaces_col(rho_col, h_col, z_col, rho_tgt, nz, z_col_new, & real, dimension(nz,DEGREE_MAX+1) :: ppoly_i_coefficients ! Coefficients of polynomial logical, dimension(nz) :: unstable_lay ! If true, this layer is in an unstable region. logical, dimension(nz+1) :: unstable_int ! If true, this interface is in an unstable region. - real :: rt ! The current target density, in kg m-3. + real :: rt ! The current target density [kg m-3]. real :: zf ! The fractional z-position within a layer of the target density. real :: rfn real :: a(5) ! Coefficients of a local polynomial minus the target density. diff --git a/src/ALE/regrid_interp.F90 b/src/ALE/regrid_interp.F90 index 9bc794a2ef..d2c384c15e 100644 --- a/src/ALE/regrid_interp.F90 +++ b/src/ALE/regrid_interp.F90 @@ -298,7 +298,7 @@ end subroutine interpolate_grid subroutine build_and_interpolate_grid(CS, densities, n0, h0, x0, target_values, & n1, h1, x1, h_neglect, h_neglect_edge) type(interp_CS_type), intent(in) :: CS !< A control structure for regrid_interp - real, dimension(:), intent(in) :: densities !< Input cell densities, in kg m-3 + real, dimension(:), intent(in) :: densities !< Input cell densities [kg m-3] real, dimension(:), intent(in) :: target_values !< Target values of interfaces integer, intent(in) :: n0 !< The number of points on the input grid real, dimension(:), intent(in) :: h0 !< Initial cell widths diff --git a/src/core/MOM.F90 b/src/core/MOM.F90 index ae6ab26b5d..08e33c27db 100644 --- a/src/core/MOM.F90 +++ b/src/core/MOM.F90 @@ -1537,11 +1537,10 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, & integer :: i, j, k, is, ie, js, je, isd, ied, jsd, jed, nz integer :: IsdB, IedB, JsdB, JedB - real :: dtbt - real :: Z_diag_int ! minimum interval between calc depth-space diagnostics [s] + real :: dtbt ! The barotropic timestep [s] + real :: Z_diag_int ! minimum interval between calc depth-space diagnosetics [s] - real, allocatable, dimension(:,:,:) :: e ! interface heights (meter) - real, allocatable, dimension(:,:) :: eta ! free surface height [m] or column mass [kg m-2] + real, allocatable, dimension(:,:) :: eta ! free surface height or column mass [H ~> m or kg m-2] real, allocatable, dimension(:,:) :: area_shelf_h ! area occupied by ice shelf [m2] real, dimension(:,:), allocatable, target :: frac_shelf_h ! fraction of total area occupied by ice shelf [nondim] real, dimension(:,:), pointer :: shelf_area => NULL() @@ -2660,14 +2659,14 @@ subroutine adjust_ssh_for_p_atm(tv, G, GV, US, ssh, p_atm, use_EOS) type(ocean_grid_type), intent(in) :: G !< ocean grid structure type(verticalGrid_type), intent(in) :: GV !< ocean vertical grid structure type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type - real, dimension(SZI_(G),SZJ_(G)), intent(inout) :: ssh !< time mean surface height (m) - real, dimension(:,:), optional, pointer :: p_atm !< atmospheric pressure (Pascal) + real, dimension(SZI_(G),SZJ_(G)), intent(inout) :: ssh !< time mean surface height [m] + real, dimension(:,:), optional, pointer :: p_atm !< atmospheric pressure [Pa] logical, optional, intent(in) :: use_EOS !< If true, calculate the density for !! the SSH correction using the equation of state. real :: Rho_conv ! The density used to convert surface pressure to - ! a corrected effective SSH, in kg m-3. - real :: IgR0 ! The SSH conversion factor from Pa to m. + ! a corrected effective SSH [kg m-3]. + real :: IgR0 ! The SSH conversion factor from Pa to m [m Pa-1]. logical :: calc_rho integer :: i, j, is, ie, js, je diff --git a/src/core/MOM_PressureForce_Montgomery.F90 b/src/core/MOM_PressureForce_Montgomery.F90 index aa228c5a6d..986a5cdb48 100644 --- a/src/core/MOM_PressureForce_Montgomery.F90 +++ b/src/core/MOM_PressureForce_Montgomery.F90 @@ -34,15 +34,15 @@ module MOM_PressureForce_Mont !! approximation [kg m-3]. real :: Rho_atm !< The assumed atmospheric density [kg m-3]. !! By default, Rho_atm is 0. - real :: GFS_scale !< Ratio between gravity applied to top interface - !! and the gravitational acceleration of the planet. + real :: GFS_scale !< Ratio between gravity applied to top interface and the + !! gravitational acceleration of the planet [nondim]. !! Usually this ratio is 1. type(time_type), pointer :: Time => NULL() !< A pointer to the ocean model's clock. type(diag_ctrl), pointer :: diag => NULL() !< A structure that is used to regulate !! the timing of diagnostic output. real, pointer :: PFu_bc(:,:,:) => NULL() !< Accelerations due to pressure real, pointer :: PFv_bc(:,:,:) => NULL() !< gradients deriving from density - !! gradients within layers, m s-2. + !! gradients within layers [m s-2]. !>@{ Diagnostic IDs integer :: id_PFu_bc = -1, id_PFv_bc = -1, id_e_tidal = -1 !!@} @@ -63,44 +63,44 @@ module MOM_PressureForce_Mont subroutine PressureForce_Mont_nonBouss(h, tv, PFu, PFv, G, GV, US, CS, p_atm, pbce, eta) type(ocean_grid_type), intent(in) :: G !< Ocean grid structure. type(verticalGrid_type), intent(in) :: GV !< Vertical grid structure. - type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type - real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(in) :: h !< Layer thickness, in kg/m2. + type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type + real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(in) :: h !< Layer thickness, [H ~> kg m-2]. type(thermo_var_ptrs), intent(in) :: tv !< Thermodynamic variables. real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(out) :: PFu !< Zonal acceleration due to pressure gradients - !! (equal to -dM/dx) in m/s2. + !! (equal to -dM/dx) [m s-2]. real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(out) :: PFv !< Meridional acceleration due to pressure gradients - !! (equal to -dM/dy) in m/s2. + !! (equal to -dM/dy) [m s-2]. type(PressureForce_Mont_CS), pointer :: CS !< Control structure for Montgomery potential PGF real, dimension(:,:), optional, pointer :: p_atm !< The pressure at the ice-ocean or - !! atmosphere-ocean in Pa. + !! atmosphere-ocean [Pa]. real, dimension(SZI_(G),SZJ_(G),SZK_(G)), & optional, intent(out) :: pbce !< The baroclinic pressure anomaly in !! each layer due to free surface height anomalies, !! [m2 s-2 H-1 ~> m s-2 or m4 kg-1 s-2]. - real, dimension(SZI_(G),SZJ_(G)), optional, intent(out) :: eta !< Free surface height, in m. + real, dimension(SZI_(G),SZJ_(G)), optional, intent(out) :: eta !< Free surface height [H ~> kg m-1]. ! Local variables real, dimension(SZI_(G),SZJ_(G),SZK_(G)) :: & M, & ! The Montgomery potential, M = (p/rho + gz) [m2 s-2]. - alpha_star, & ! Compression adjusted specific volume, in m3 kg-1. + alpha_star, & ! Compression adjusted specific volume [m3 kg-1]. dz_geo ! The change in geopotential across a layer [m2 s-2]. - real, dimension(SZI_(G),SZJ_(G),SZK_(G)+1) :: p ! Interface pressure in Pa. + real, dimension(SZI_(G),SZJ_(G),SZK_(G)+1) :: p ! Interface pressure [Pa]. ! p may be adjusted (with a nonlinear equation of state) so that ! its derivative compensates for the adiabatic compressibility ! in seawater, but p will still be close to the pressure. real, dimension(SZI_(G),SZJ_(G),SZK_(G)), target :: & T_tmp, & ! Temporary array of temperatures where layers that are lighter - ! than the mixed layer have the mixed layer's properties, in C. + ! than the mixed layer have the mixed layer's properties [degC]. S_tmp ! Temporary array of salinities where layers that are lighter - ! than the mixed layer have the mixed layer's properties [PSU]. + ! than the mixed layer have the mixed layer's properties [ppt]. real, dimension(SZI_(G)) :: Rho_cv_BL ! The coordinate potential density in the ! deepest variable density near-surface layer [kg m-3]. real, dimension(SZI_(G),SZJ_(G)) :: & dM, & ! A barotropic correction to the Montgomery potentials to - ! enable the use of a reduced gravity form of the equations, - ! in m2 s-2. + ! enable the use of a reduced gravity form of the equations + ! [m2 s-2]. dp_star, & ! Layer thickness after compensation for compressibility [Pa]. SSH, & ! The sea surface height anomaly, in depth units [Z ~> m]. e_tidal, & ! Bottom geopotential anomaly due to tidal forces from @@ -108,7 +108,7 @@ subroutine PressureForce_Mont_nonBouss(h, tv, PFu, PFv, G, GV, US, CS, p_atm, pb geopot_bot ! Bottom geopotential relative to time-mean sea level, ! including any tidal contributions [m2 s-2]. real :: p_ref(SZI_(G)) ! The pressure used to calculate the coordinate - ! density, in Pa (usually 2e7 Pa = 2000 dbar). + ! density [Pa] (usually 2e7 Pa = 2000 dbar). real :: rho_in_situ(SZI_(G)) !In-situ density of a layer [kg m-3]. real :: PFu_bc, PFv_bc ! The pressure gradient force due to along-layer ! compensated density gradients [m s-2] @@ -374,7 +374,7 @@ subroutine PressureForce_Mont_Bouss(h, tv, PFu, PFv, G, GV, US, CS, p_atm, pbce, real, dimension(SZI_(G),SZJ_(G),SZK_(G)), optional, intent(out) :: pbce !< The baroclinic pressure anomaly in !! each layer due to free surface height anomalies !! [m2 s-2 H-1 ~> m s-2]. - real, dimension(SZI_(G),SZJ_(G)), optional, intent(out) :: eta !< Free surface height, in m. + real, dimension(SZI_(G),SZJ_(G)), optional, intent(out) :: eta !< Free surface height [H ~> m]. ! Local variables real, dimension(SZI_(G),SZJ_(G),SZK_(G)) :: & M, & ! The Montgomery potential, M = (p/rho + gz) [m2 s-2]. @@ -403,7 +403,7 @@ subroutine PressureForce_Mont_Bouss(h, tv, PFu, PFv, G, GV, US, CS, p_atm, pbce, real :: G_Rho0 ! G_Earth / Rho0 [m5 Z-1 s-2 kg-1 ~> m4 s-2 kg-1]. real :: PFu_bc, PFv_bc ! The pressure gradient force due to along-layer ! compensated density gradients [m s-2] - real :: dr ! Temporary variables. +! real :: dr ! Temporary variables. real :: h_neglect ! A thickness that is so small it is usually lost ! in roundoff and can be neglected [Z ~> m]. logical :: use_p_atm ! If true, use the atmospheric pressure. @@ -609,12 +609,13 @@ subroutine Set_pbce_Bouss(e, tv, G, GV, Rho0, GFS_scale, pbce, rho_star) real, dimension(SZI_(G),SZJ_(G),SZK_(G)+1), intent(in) :: e !< Interface height [Z ~> m]. type(thermo_var_ptrs), intent(in) :: tv !< Thermodynamic variables real, intent(in) :: Rho0 !< The "Boussinesq" ocean density [kg m-3]. - real, intent(in) :: GFS_scale !< Ratio between gravity applied to top interface - !! and the gravitational acceleration of the planet. - !! Usually this ratio is 1. + real, intent(in) :: GFS_scale !< Ratio between gravity applied to top + !! interface and the gravitational acceleration of + !! the planet [nondim]. Usually this ratio is 1. real, dimension(SZI_(G),SZJ_(G),SZK_(G)), & intent(out) :: pbce !< The baroclinic pressure anomaly in each layer due - !! to free surface height anomalies, in m2 H-1 s-2. + !! to free surface height anomalies + !! [m2 H-1 s-2 ~> m4 kg-2 s-2]. real, dimension(SZI_(G),SZJ_(G),SZK_(G)), & optional, intent(in) :: rho_star !< The layer densities (maybe compressibility !! compensated), times g/rho_0 [m2 Z-1 s-2 ~> m s-2]. @@ -622,11 +623,11 @@ subroutine Set_pbce_Bouss(e, tv, G, GV, Rho0, GFS_scale, pbce, rho_star) ! Local variables real :: Ihtot(SZI_(G)) ! The inverse of the sum of the layer thicknesses [H-1 ~> m-1 or m2 kg-1]. real :: press(SZI_(G)) ! Interface pressure [Pa]. - real :: T_int(SZI_(G)) ! Interface temperature in C. - real :: S_int(SZI_(G)) ! Interface salinity in PSU. - real :: dR_dT(SZI_(G)) ! Partial derivatives of density with temperature - real :: dR_dS(SZI_(G)) ! and salinity in kg m-3 K-1 and kg m-3 PSU-1. - real :: rho_in_situ(SZI_(G)) !In-situ density at the top of a layer. + real :: T_int(SZI_(G)) ! Interface temperature [degC]. + real :: S_int(SZI_(G)) ! Interface salinity [ppt]. + real :: dR_dT(SZI_(G)) ! Partial derivative of density with temperature [kg m-3 degC-1]. + real :: dR_dS(SZI_(G)) ! Partial derivative of density with salinity [kg m-3 ppt-1]. + real :: rho_in_situ(SZI_(G)) !In-situ density at the top of a layer [kg m-3]. real :: G_Rho0 ! G_Earth / Rho0 [m5 Z-1 s-2 kg-1 ~> m4 s-2 kg-1] real :: Rho0xG ! g_Earth * Rho0 [kg s-2 m-1 Z-1 ~> kg s-2 m-2] logical :: use_EOS ! If true, density is calculated from T & S using @@ -707,28 +708,27 @@ subroutine Set_pbce_nonBouss(p, tv, G, GV, GFS_scale, pbce, alpha_star) type(verticalGrid_type), intent(in) :: GV !< Vertical grid structure real, dimension(SZI_(G),SZJ_(G),SZK_(G)+1), intent(in) :: p !< Interface pressures [Pa]. type(thermo_var_ptrs), intent(in) :: tv !< Thermodynamic variables - real, intent(in) :: GFS_scale !< Ratio between gravity applied to top interface - !! and the gravitational acceleration of the planet. - !! Usually this ratio is 1. + real, intent(in) :: GFS_scale !< Ratio between gravity applied to top + !! interface and the gravitational acceleration of + !! the planet [nondim]. Usually this ratio is 1. real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(out) :: pbce !< The baroclinic pressure anomaly in each layer due - !! to free surface height anomalies, in m2 H-1 s-2. + !! to free surface height anomalies + !! [m2 H-1 s-2 ~> m4 kg-2 s-2]. real, dimension(SZI_(G),SZJ_(G),SZK_(G)), optional, intent(in) :: alpha_star !< The layer specific volumes - !! (maybe compressibility compensated), in m3 kg-1. + !! (maybe compressibility compensated) [m3 kg-1]. ! Local variables real, dimension(SZI_(G),SZJ_(G)) :: & dpbce, & ! A barotropic correction to the pbce to enable the use of - ! a reduced gravity form of the equations, in m4 s-2 kg-1. - C_htot ! dP_dH divided by the total ocean pressure, m2 kg-1. - real :: T_int(SZI_(G)) ! Interface temperature in C. - real :: S_int(SZI_(G)) ! Interface salinity in PSU. - real :: dR_dT(SZI_(G)) ! Partial derivatives of density with temperature - real :: dR_dS(SZI_(G)) ! and salinity in kg m-3 K-1 and kg m-3 PSU-1. - real :: rho_in_situ(SZI_(G)) !In-situ density at an interface [kg m-3]. + ! a reduced gravity form of the equations [m4 s-2 kg-1]. + C_htot ! dP_dH divided by the total ocean pressure [m2 kg-1]. + real :: T_int(SZI_(G)) ! Interface temperature [degC]. + real :: S_int(SZI_(G)) ! Interface salinity [ppt]. + real :: dR_dT(SZI_(G)) ! Partial derivative of density with temperature [kg m-3 degC-1]. + real :: dR_dS(SZI_(G)) ! Partial derivative of density with salinity [kg m-3 ppt-1]. + real :: rho_in_situ(SZI_(G)) ! In-situ density at an interface [kg m-3]. real :: alpha_Lay(SZK_(G)) ! The specific volume of each layer [kg m-3]. - real :: dalpha_int(SZK_(G)+1) ! The change in specific volume across each - ! interface [kg m-3]. - real :: dP_dH ! A factor that converts from thickness to pressure, - ! usually in Pa m2 kg-1. + real :: dalpha_int(SZK_(G)+1) ! The change in specific volume across each interface [kg m-3]. + real :: dP_dH ! A factor that converts from thickness to pressure [Pa H-1 ~> Pa m2 kg-1]. real :: dp_neglect ! A thickness that is so small it is usually lost ! in roundoff and can be neglected [Pa]. logical :: use_EOS ! If true, density is calculated from T & S using diff --git a/src/core/MOM_PressureForce_blocked_AFV.F90 b/src/core/MOM_PressureForce_blocked_AFV.F90 index a9de1401b1..d94adf7872 100644 --- a/src/core/MOM_PressureForce_blocked_AFV.F90 +++ b/src/core/MOM_PressureForce_blocked_AFV.F90 @@ -38,7 +38,7 @@ module MOM_PressureForce_blk_AFV real :: Rho0 !< The density used in the Boussinesq !! approximation [kg m-3]. real :: GFS_scale !< A scaling of the surface pressure gradients to - !! allow the use of a reduced gravity model. + !! allow the use of a reduced gravity model [nondim]. type(time_type), pointer :: Time !< A pointer to the ocean model's clock. type(diag_ctrl), pointer :: diag !< A structure that is used to regulate the !! timing of diagnostic output. @@ -74,7 +74,7 @@ subroutine PressureForce_blk_AFV(h, tv, PFu, PFv, G, GV, US, CS, ALE_CSp, p_atm, type(PressureForce_blk_AFV_CS), pointer :: CS !< Finite volume PGF control structure type(ALE_CS), pointer :: ALE_CSp !< ALE control structure real, dimension(:,:), optional, pointer :: p_atm !< The pressure at the ice-ocean - !! or atmosphere-ocean interface in Pa. + !! or atmosphere-ocean interface [Pa]. real, dimension(SZI_(G),SZJ_(G),SZK_(G)), optional, intent(out) :: pbce !< The baroclinic pressure !! anomaly in each layer due to eta anomalies !! [m2 s-2 H-1 ~> m s-2 or m4 s-2 kg-1]. @@ -103,7 +103,7 @@ subroutine PressureForce_blk_AFV_nonBouss(h, tv, PFu, PFv, G, GV, US, CS, p_atm, type(ocean_grid_type), intent(in) :: G !< Ocean grid structure type(verticalGrid_type), intent(in) :: GV !< Vertical grid structure type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type - real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(in) :: h !< Layer thickness (kg/m2) + real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(in) :: h !< Layer thickness [H ~> kg m-2] type(thermo_var_ptrs), intent(in) :: tv !< Thermodynamic variables real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(out) :: PFu !< Zonal acceleration [m s-2] real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(out) :: PFv !< Meridional acceleration [m s-2] @@ -117,17 +117,17 @@ subroutine PressureForce_blk_AFV_nonBouss(h, tv, PFu, PFv, G, GV, US, CS, p_atm, !! calculate PFu and PFv [H ~> m or kg m-2], with any tidal !! contributions or compressibility compensation. ! Local variables - real, dimension(SZI_(G),SZJ_(G),SZK_(G)+1) :: p ! Interface pressure in Pa. + real, dimension(SZI_(G),SZJ_(G),SZK_(G)+1) :: p ! Interface pressure [Pa]. real, dimension(SZI_(G),SZJ_(G),SZK_(G)), target :: & T_tmp, & ! Temporary array of temperatures where layers that are lighter - ! than the mixed layer have the mixed layer's properties, in C. + ! than the mixed layer have the mixed layer's properties [degC]. S_tmp ! Temporary array of salinities where layers that are lighter ! than the mixed layer have the mixed layer's properties [PSU]. real, dimension(SZI_(G),SZJ_(G),SZK_(G)) :: & dza, & ! The change in geopotential anomaly between the top and bottom ! of a layer [m2 s-2]. intp_dza ! The vertical integral in depth of the pressure anomaly less - ! the pressure anomaly at the top of the layer, in Pa m2 s-2. + ! the pressure anomaly at the top of the layer [Pa m2 s-2]. real, dimension(SZI_(G),SZJ_(G)) :: & dp, & ! The (positive) change in pressure across a layer [Pa]. SSH, & ! The sea surface height anomaly, in depth units [Z ~> m]. @@ -146,29 +146,29 @@ subroutine PressureForce_blk_AFV_nonBouss(h, tv, PFu, PFv, G, GV, US, CS, p_atm, ! density near-surface layer [kg m-3]. real, dimension(SZDIB_(G%Block(1)),SZDJ_(G%Block(1))) :: & ! on block indices intx_za_bk ! The zonal integral of the geopotential anomaly along the - ! interface below a layer, divided by the grid spacing, m2 s-2. + ! interface below a layer, divided by the grid spacing [m2 s-2]. real, dimension(SZIB_(G),SZJ_(G),SZK_(G)) :: & intx_dza ! The change in intx_za through a layer [m2 s-2]. real, dimension(SZDI_(G%Block(1)),SZDJB_(G%Block(1))) :: & ! on block indices inty_za_bk ! The meridional integral of the geopotential anomaly along the - ! interface below a layer, divided by the grid spacing, m2 s-2. + ! interface below a layer, divided by the grid spacing [m2 s-2]. real, dimension(SZI_(G),SZJB_(G),SZK_(G)) :: & inty_dza ! The change in inty_za through a layer [m2 s-2]. - real :: p_ref(SZI_(G)) ! The pressure used to calculate the coordinate - ! density, in Pa (usually 2e7 Pa = 2000 dbar). - - real :: dp_neglect ! A thickness that is so small it is usually lost - ! in roundoff and can be neglected [Pa]. - 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. - logical :: use_p_atm ! If true, use the atmospheric pressure. + real :: p_ref(SZI_(G)) ! The pressure used to calculate the coordinate + ! density [Pa] (usually 2e7 Pa = 2000 dbar). + + real :: dp_neglect ! A thickness that is so small it is usually lost + ! in roundoff and can be neglected [Pa]. + 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 [m3 kg-1]. + logical :: use_p_atm ! If true, use the atmospheric pressure. 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). @@ -452,7 +452,7 @@ subroutine PressureForce_blk_AFV_Bouss(h, tv, PFu, PFv, G, GV, US, CS, ALE_CSp, Rho_cv_BL ! The coordinate potential density in the deepest variable ! density near-surface layer [kg m-3]. real, dimension(SZDI_(G%Block(1)),SZDJ_(G%Block(1))) :: & ! on block indices - dz_bk, & ! The change in geopotential thickness through a layer, m2 s-2. + dz_bk, & ! The change in geopotential thickness through a layer [m2 s-2]. pa_bk, & ! The pressure anomaly (i.e. pressure + g*RHO_0*e) at the ! the interface atop a layer [Pa]. dpa_bk, & ! The change in pressure anomaly between the top and bottom @@ -470,25 +470,25 @@ subroutine PressureForce_blk_AFV_Bouss(h, tv, PFu, PFv, G, GV, US, CS, ALE_CSp, real, dimension(SZI_(G),SZJ_(G),SZK_(G)), target :: & T_tmp, & ! Temporary array of temperatures where layers that are lighter - ! than the mixed layer have the mixed layer's properties, in C. + ! than the mixed layer have the mixed layer's properties [degC]. S_tmp ! Temporary array of salinities where layers that are lighter ! than the mixed layer have the mixed layer's properties [PSU]. real, dimension(SZI_(G),SZJ_(G),SZK_(G)) :: & - S_t, S_b, T_t, T_b ! Top and bottom edge values for linear reconstructions - ! of salinity and temperature within each layer. + S_t, S_b, & ! Top and bottom edge salinities for linear reconstructions within each layer [ppt]. + T_t, T_b ! Top and bottom edge temperatures for linear reconstructions within each layer [degC]. real :: rho_in_situ(SZI_(G)) ! The in situ density [kg m-3]. - real :: p_ref(SZI_(G)) ! The pressure used to calculate the coordinate - ! density, in Pa (usually 2e7 Pa = 2000 dbar). - real :: p0(SZI_(G)) ! An array of zeros to use for pressure in Pa. - 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 :: I_Rho0 ! 1/Rho0. - real :: g_Earth_z ! A scaled version of g_Earth [m2 Z-1 s-2 ~> m s-2]. - real :: G_Rho0 ! G_Earth / Rho0 in m5 Z-1 s-2 kg-1. - real :: Rho_ref ! The reference density in kg m-3. - real :: dz_neglect ! A minimal thickness [Z ~> m], like e. - logical :: use_p_atm ! If true, use the atmospheric pressure. - logical :: use_ALE ! If true, use an ALE pressure reconstruction. + real :: p_ref(SZI_(G)) ! The pressure used to calculate the coordinate + ! density [Pa] (usually 2e7 Pa = 2000 dbar). + real :: p0(SZI_(G)) ! An array of zeros to use for pressure [Pa]. + 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 :: I_Rho0 ! 1/Rho0 [m3 kg-1]. + real :: g_Earth_z ! A scaled version of g_Earth [m2 Z-1 s-2 ~> m s-2]. + real :: G_Rho0 ! G_Earth / Rho0 [m5 Z-1 s-2 kg-1 ~> m4 s-2 kg-1]. + real :: Rho_ref ! The reference density [kg m-3]. + real :: dz_neglect ! A minimal thickness [Z ~> m], like e. + 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. diff --git a/src/core/MOM_barotropic.F90 b/src/core/MOM_barotropic.F90 index 9b661fa46c..9f83205fc6 100644 --- a/src/core/MOM_barotropic.F90 +++ b/src/core/MOM_barotropic.F90 @@ -160,7 +160,7 @@ module MOM_barotropic !! for applying open boundary conditions. real :: Rho0 !< The density used in the Boussinesq - !! approximation, in kg m-3. + !! approximation [kg m-3 ~> m or kg m-2]. real :: dtbt !< The barotropic time step [s]. real :: dtbt_fraction !< The fraction of the maximum time-step that !! should used. The default is 0.98. @@ -420,11 +420,11 @@ subroutine btstep(U_in, V_in, eta_in, dt, bc_accel_u, bc_accel_v, forces, pbce, real, dimension(SZI_(G),SZJ_(G)), intent(out) :: eta_out !< The final barotropic free surface !! height anomaly or column mass anomaly [H ~> m or kg m-2]. real, dimension(SZIB_(G),SZJ_(G)), intent(out) :: uhbtav !< the barotropic zonal volume or mass - !! fluxes averaged through the barotropic steps, in - !! m3 s-1 or kg s-1. + !! fluxes averaged through the barotropic steps + !! [H m2 s-1 ~> m3 or kg s-1]. real, dimension(SZI_(G),SZJB_(G)), intent(out) :: vhbtav !< the barotropic meridional volume or mass - !! fluxes averaged through the barotropic steps, in - !! m3 s-1 or kg s-1. + !! fluxes averaged through the barotropic steps + !! [H m2 s-1 ~> m3 or kg s-1]. type(barotropic_CS), pointer :: CS !< The control structure returned by a !! previous call to barotropic_init. real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(in) :: visc_rem_u !< Both the fraction of the momentum @@ -433,7 +433,7 @@ subroutine btstep(U_in, V_in, eta_in, dt, bc_accel_u, bc_accel_v, forces, pbce, !! barotropic acceleration that a layer experiences after !! viscosity is applied, in the zonal direction. Nondimensional !! between 0 (at the bottom) and 1 (far above the bottom). - real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(in) :: visc_rem_v !< Ditto for meridional direction. + real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(in) :: visc_rem_v !< Ditto for meridional direction [nondim]. real, dimension(SZI_(G),SZJ_(G)), optional, intent(out) :: etaav !< The free surface height or column mass !! averaged over the barotropic integration [H ~> m or kg m-2]. type(ocean_OBC_type), optional, pointer :: OBC !< The open boundary condition structure. @@ -441,12 +441,12 @@ subroutine btstep(U_in, V_in, eta_in, dt, bc_accel_u, bc_accel_v, forces, pbce, !! the effective open face areas as a function of barotropic !! flow. real, dimension(:,:), optional, pointer :: eta_PF_start !< The eta field consistent with the pressure - !! gradient at the start of the barotropic stepping, in m or - !! kg m-2. + !! gradient at the start of the barotropic stepping + !! [H ~> m or kg m-2]. real, dimension(:,:), optional, pointer :: taux_bot !< The zonal bottom frictional stress from - !! ocean to the seafloor, in Pa. + !! ocean to the seafloor [Pa]. real, dimension(:,:), optional, pointer :: tauy_bot !< The meridional bottom frictional stress - !! from ocean to the seafloor, in Pa. + !! from ocean to the seafloor [Pa]. real, dimension(:,:,:), optional, pointer :: uh0 !< The zonal layer transports at reference !! velocities [H m s-1 ~> m2 s-1 or kg m-1 s-1]. real, dimension(:,:,:), optional, pointer :: u_uh0 !< The velocities used to calculate uh0 [m s-1] @@ -578,7 +578,7 @@ subroutine btstep(U_in, V_in, eta_in, dt, bc_accel_u, bc_accel_v, forces, pbce, real, dimension(SZIW_(CS),SZJBW_(CS)) :: & vbt_prev, vhbt_prev, vbt_sum_prev, vhbt_sum_prev, vbt_wtd_prev ! for OBC - real :: mass_to_Z ! The depth unit converison divided by the mean density (Rho0), in m3 kg-1. + real :: mass_to_Z ! The depth unit converison divided by the mean density (Rho0) [m3 kg-1]. real :: visc_rem ! A work variable that may equal visc_rem_[uv]. Nondim. real :: vel_prev ! The previous velocity [m s-1]. real :: dtbt ! The barotropic time step [s]. diff --git a/src/core/MOM_dynamics_unsplit.F90 b/src/core/MOM_dynamics_unsplit.F90 index 73ffc9aad5..887a6c4f54 100644 --- a/src/core/MOM_dynamics_unsplit.F90 +++ b/src/core/MOM_dynamics_unsplit.F90 @@ -201,14 +201,14 @@ subroutine step_MOM_dyn_unsplit(u, v, h, tv, visc, Time_local, dt, forces, & !! pressure at the start of this dynamic step [Pa]. real, dimension(:,:), pointer :: p_surf_end !< A pointer (perhaps NULL) to the surface !! pressure at the end of this dynamic step [Pa]. - real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(inout) :: uh !< The zonal volume or mass transport, - !! in m3 s-1 or kg s-1. + real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(inout) :: uh !< The zonal volume or mass transport + !! [H m2 s-1 ~> m3 or kg s-1]. real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(inout) :: vh !< The meridional volume or mass - !! transport, in m3 s-1 or kg s-1. + !! transport [H m2 s-1 ~> m3 or kg s-1]. real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(inout) :: uhtr !< The accumulated zonal volume or mass - !! transport since the last tracer advection, in m3 or kg. + !! transport since the last tracer advection [H m2 ~> m3 or kg]. real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(inout) :: vhtr !< The accumulated meridional volume or mass - !! transport since the last tracer advection, in m3 or kg. + !! transport since the last tracer advection [H m2 ~> m3 or kg]. real, dimension(SZI_(G),SZJ_(G)), intent(out) :: eta_av !< The time-mean free surface height or !! column mass [H ~> m or kg m-2]. type(MOM_dyn_unsplit_CS), pointer :: CS !< The control structure set up by diff --git a/src/core/MOM_dynamics_unsplit_RK2.F90 b/src/core/MOM_dynamics_unsplit_RK2.F90 index 6aa4ce2e15..e3625dd6a3 100644 --- a/src/core/MOM_dynamics_unsplit_RK2.F90 +++ b/src/core/MOM_dynamics_unsplit_RK2.F90 @@ -210,16 +210,16 @@ subroutine step_MOM_dyn_unsplit_RK2(u_in, v_in, h_in, tv, visc, Time_local, dt, real, dimension(:,:), pointer :: p_surf_end !< A pointer (perhaps NULL) to !! the surface pressure at the end of !! this dynamic step [Pa]. - real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(inout) :: uh !< The zonal volume or mass transport, - !! in m3 s-1 or kg s-1. + real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(inout) :: uh !< The zonal volume or mass transport + !! [H m2 s-1 ~> m3 or kg s-1]. real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(inout) :: vh !< The meridional volume or mass - !! transport, in m3 s-1 or kg s-1. + !! transport [H m2 s-1 ~> m3 or kg s-1]. real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(inout) :: uhtr !< The accumulated zonal volume or !! mass transport since the last - !! tracer advection, in m3 or kg. + !! tracer advection [H m2 ~> m3 or kg]. real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(inout) :: vhtr !< The accumulated meridional volume !! or mass transport since the last - !! tracer advection, in m3 or kg. + !! tracer advection [H m2 ~> m3 or kg]. real, dimension(SZI_(G),SZJ_(G)), intent(out) :: eta_av !< The time-mean free surface height !! or column mass [H ~> m or kg m-2]. type(MOM_dyn_unsplit_RK2_CS), pointer :: CS !< The control structure set up by diff --git a/src/core/MOM_isopycnal_slopes.F90 b/src/core/MOM_isopycnal_slopes.F90 index 8742a0d945..03f89f7061 100644 --- a/src/core/MOM_isopycnal_slopes.F90 +++ b/src/core/MOM_isopycnal_slopes.F90 @@ -58,17 +58,19 @@ subroutine calc_isoneutral_slopes(G, GV, US, h, e, tv, dt_kappa_smooth, & real, dimension(SZI_(G), SZJ_(G), SZK_(G)+1) :: & pres ! The pressure at an interface [Pa]. real, dimension(SZIB_(G)) :: & - drho_dT_u, & ! The derivatives of density with temperature and - drho_dS_u ! salinity at u points, in kg m-3 K-1 and kg m-3 psu-1. + drho_dT_u, & ! The derivative of density with temperature at u points [kg m-3 degC-1]. + drho_dS_u ! The derivative of density with salinity at u points [kg m-3 ppt-1]. real, dimension(SZI_(G)) :: & - drho_dT_v, & ! The derivatives of density with temperature and - drho_dS_v ! salinity at v points, in kg m-3 K-1 and kg m-3 psu-1. + drho_dT_v, & ! The derivative of density with temperature at v points [kg m-3 degC-1]. + drho_dS_v ! The derivative of density with salinity at v points [kg m-3 ppt-1]. real, dimension(SZIB_(G)) :: & - T_u, S_u, & ! Temperature, salinity, and pressure on the interface at - pres_u ! the u-point in the horizontal. + T_u, & ! Temperature on the interface at the u-point [degC]. + S_u, & ! Salinity on the interface at the u-point [ppt]. + pres_u ! Pressure on the interface at the u-point [Pa]. real, dimension(SZI_(G)) :: & - T_v, S_v, & ! Temperature, salinity, and pressure on the interface at - pres_v ! the v-point in the horizontal. + T_v, & ! Temperature on the interface at the v-point [degC]. + S_v, & ! Salinity on the interface at the v-point [ppt]. + pres_v ! Pressure on the interface at the v-point [Pa]. real :: drdiA, drdiB ! Along layer zonal- and meridional- potential density real :: drdjA, drdjB ! gradients in the layers above (A) and below(B) the ! interface times the grid spacing [kg m-3]. @@ -334,12 +336,12 @@ subroutine vert_fill_TS(h, T_in, S_in, kappa_dt, T_f, S_f, G, GV, halo_here) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(in) :: h !< Layer thicknesses [H ~> m or kg m-2] - real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(in) :: T_in !< Temperature (deg C) - real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(in) :: S_in !< Salinity (psu) + real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(in) :: T_in !< Temperature [degC] + real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(in) :: S_in !< Salinity [ppt] real, intent(in) :: kappa_dt !< A vertical diffusivity to use for smoothing !! times a smoothing timescale [Z2 ~> m2]. - real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(out) :: T_f !< Filled temperature (deg C) - real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(out) :: S_f !< Filed salinity (psu) + real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(out) :: T_f !< Filled temperature [degC] + real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(out) :: S_f !< Filed salinity [ppt] integer, optional, intent(in) :: halo_here !< Halo width over which to compute ! Local variables real :: ent(SZI_(G),SZK_(G)+1) ! The diffusive entrainment (kappa*dt)/dz @@ -347,7 +349,7 @@ subroutine vert_fill_TS(h, T_in, S_in, kappa_dt, T_f, S_f, G, GV, halo_here) real :: b1(SZI_(G)), d1(SZI_(G)) ! b1, c1, and d1 are variables used by the real :: c1(SZI_(G),SZK_(G)) ! tridiagonal solver. real :: kap_dt_x2 ! The product of 2*kappa*dt, converted to - ! the same units as h, in m2 or kg2 m-4. + ! the same units as h squared, [H2 ~> m2 or kg2 m-4]. real :: h_neglect ! A negligible thickness [H ~> m or kg m-2], to ! allow for zero thicknesses. integer :: i, j, k, is, ie, js, je, nz, halo diff --git a/src/core/MOM_variables.F90 b/src/core/MOM_variables.F90 index 7404c25a43..8db9a02f79 100644 --- a/src/core/MOM_variables.F90 +++ b/src/core/MOM_variables.F90 @@ -37,38 +37,38 @@ module MOM_variables !! will be returned to a the calling program type, public :: surface real, allocatable, dimension(:,:) :: & - SST, & !< The sea surface temperature in C. - SSS, & !< The sea surface salinity in psu. - sfc_density, & !< The mixed layer density in kg m-3. - Hml, & !< The mixed layer depth in m. + SST, & !< The sea surface temperature [degC]. + SSS, & !< The sea surface salinity [ppt ~> psu or gSalt/kg]. + sfc_density, & !< The mixed layer density [kg m-3]. + Hml, & !< The mixed layer depth [m]. u, & !< The mixed layer zonal velocity [m s-1]. v, & !< The mixed layer meridional velocity [m s-1]. - sea_lev, & !< The sea level in m. If a reduced surface gravity is + sea_lev, & !< The sea level [m]. If a reduced surface gravity is !! used, that is compensated for in sea_lev. melt_potential, & !< instantaneous amount of heat that can be used to melt sea ice, !! in J m-2. This is computed w.r.t. surface freezing temperature. - ocean_mass, & !< The total mass of the ocean in kg m-2. - ocean_heat, & !< The total heat content of the ocean in C kg m-2. - ocean_salt, & !< The total salt content of the ocean in kgSalt m-2. + ocean_mass, & !< The total mass of the ocean [kg m-2]. + ocean_heat, & !< The total heat content of the ocean in [degC kg m-2]. + ocean_salt, & !< The total salt content of the ocean in [kgSalt m-2]. salt_deficit !< The salt needed to maintain the ocean column at a minimum - !! salinity of 0.01 PSU over the call to step_MOM, in kgSalt m-2. + !! salinity of 0.01 PSU over the call to step_MOM [kgSalt m-2]. logical :: T_is_conT = .false. !< If true, the temperature variable SST is actually the - !! conservative temperature [degC]. + !! conservative temperature in [degC]. logical :: S_is_absS = .false. !< If true, the salinity variable SSS is actually the - !! absolute salinity, in g/kg. + !! absolute salinity in [g/kg]. real, pointer, dimension(:,:) :: & taux_shelf => NULL(), & !< The zonal stresses on the ocean under shelves [Pa]. tauy_shelf => NULL() !< The meridional stresses on the ocean under shelves [Pa]. real, pointer, dimension(:,:) :: frazil => NULL() !< The energy needed to heat the ocean column to the freezing point during the call - !! to step_MOM, in J m-2. + !! to step_MOM [J m-2]. real, pointer, dimension(:,:) :: TempxPmE => NULL() !< The net inflow of water into the ocean times the temperature at which this inflow - !! occurs during the call to step_MOM, in deg C kg m-2. This should be prescribed in the + !! occurs during the call to step_MOM [degC kg m-2]. This should be prescribed in the !! forcing fields, but as it often is not, this is a useful heat budget diagnostic. real, pointer, dimension(:,:) :: internal_heat => NULL() !< Any internal or geothermal heat sources that are applied to the ocean integrated - !! over the call to step_MOM, in deg C kg m-2. + !! over the call to step_MOM [degC kg m-2]. type(coupler_2d_bc_type) :: tr_fields !< A structure that may contain an !! array of named fields describing tracer-related quantities. !### NOTE: ALL OF THE ARRAYS IN TR_FIELDS USE THE COUPLER'S INDEXING CONVENTION AND HAVE NO @@ -123,8 +123,8 @@ module MOM_variables !! they refer to in MOM.F90. type, public :: ocean_internal_state real, pointer, dimension(:,:,:) :: & - T => NULL(), & !< Pointer to the temperature state variable, in deg C - S => NULL(), & !< Pointer to the salinity state variable, in PSU or g/kg + T => NULL(), & !< Pointer to the temperature state variable [degC] + S => NULL(), & !< Pointer to the salinity state variable [ppt ~> PSU or g/kg] u => NULL(), & !< Pointer to the zonal velocity [m s-1] v => NULL(), & !< Pointer to the meridional velocity [m s-1] h => NULL() !< Pointer to the layer thicknesses [H ~> m or kg m-2] @@ -197,7 +197,7 @@ module MOM_variables !> Vertical viscosities, drag coefficients, and related fields. type, public :: vertvisc_type real :: Prandtl_turb !< The Prandtl number for the turbulent diffusion - !! that is captured in Kd_shear. + !! that is captured in Kd_shear [nondim]. real, pointer, dimension(:,:) :: & bbl_thick_u => NULL(), & !< The bottom boundary layer thickness at the u-points [Z ~> m]. bbl_thick_v => NULL(), & !< The bottom boundary layer thickness at the v-points [Z ~> m]. @@ -224,7 +224,7 @@ module MOM_variables !! terms of layers, not depth, to facilitate the movement of the viscous boundary layer !! with the flow. real, pointer, dimension(:,:) :: nkml_visc_v => NULL() - !< The number of layers in the viscous surface mixed layer at v-points (nondimensional). + !< The number of layers in the viscous surface mixed layer at v-points [nondim]. real, pointer, dimension(:,:) :: & MLD => NULL() !< Instantaneous active mixing layer depth [H ~> m or kg m-2]. real, pointer, dimension(:,:,:) :: & diff --git a/src/core/MOM_verticalGrid.F90 b/src/core/MOM_verticalGrid.F90 index ac3d5d4a6d..a824553a84 100644 --- a/src/core/MOM_verticalGrid.F90 +++ b/src/core/MOM_verticalGrid.F90 @@ -25,7 +25,7 @@ module MOM_verticalGrid ! Commonly used parameters integer :: ke !< The number of layers/levels in the vertical - real :: max_depth !< The maximum depth of the ocean in Z (often m). + real :: max_depth !< The maximum depth of the ocean [Z ~> m]. real :: g_Earth !< The gravitational acceleration [m2 Z-1 s-2 ~> m s-2]. real :: Rho0 !< The density used in the Boussinesq approximation or nominal !! density used to convert depths into mass units [kg m-3]. @@ -40,15 +40,15 @@ module MOM_verticalGrid ! The following variables give information about the vertical grid. logical :: Boussinesq !< If true, make the Boussinesq approximation. - real :: Angstrom_H !< A one-Angstrom thickness in the model thickness units. - real :: Angstrom_Z !< A one-Angstrom thickness in the model depth units. - real :: Angstrom_m !< A one-Angstrom thickness in m. + real :: Angstrom_H !< A one-Angstrom thickness in the model thickness units [H ~> m or kg m-2]. + real :: Angstrom_Z !< A one-Angstrom thickness in the model depth units [Z ~> m]. + real :: Angstrom_m !< A one-Angstrom thickness [m]. real :: H_subroundoff !< A thickness that is so small that it can be added to a thickness of - !! Angstrom or larger without changing it at the bit level, in thickness units. + !! Angstrom or larger without changing it at the bit level [H ~> m or kg m-2]. !! If Angstrom is 0 or exceedingly small, this is negligible compared to 1e-17 m. real, allocatable, dimension(:) :: & g_prime, & !< The reduced gravity at each interface [m2 Z-1 s-2 ~> m s-2]. - Rlay !< The target coordinate value (potential density) in each layer in kg m-3. + Rlay !< The target coordinate value (potential density) in each layer [kg m-3]. integer :: nkml = 0 !< The number of layers at the top that should be treated !! as parts of a homogenous region. integer :: nk_rho_varies = 0 !< The number of layers at the top where the @@ -57,7 +57,7 @@ module MOM_verticalGrid real :: kg_m2_to_H !< A constant that translates thicknesses from kg m-2 to the units of thickness. real :: m_to_H !< A constant that translates distances in m to the units of thickness. real :: H_to_m !< A constant that translates distances in the units of thickness to m. - real :: H_to_Pa !< A constant that translates the units of thickness to pressure in Pa. + real :: H_to_Pa !< A constant that translates the units of thickness to pressure [Pa]. real :: H_to_Z !< A constant that translates thickness units to the units of depth. real :: Z_to_H !< A constant that translates depth units to thickness units. diff --git a/src/diagnostics/MOM_diagnostics.F90 b/src/diagnostics/MOM_diagnostics.F90 index 4d894ba1a2..37e4b6c03b 100644 --- a/src/diagnostics/MOM_diagnostics.F90 +++ b/src/diagnostics/MOM_diagnostics.F90 @@ -699,8 +699,8 @@ end subroutine calculate_diagnostic_fields !! weights that should be assigned to elements k and k+1. subroutine find_weights(Rlist, R_in, k, nz, wt, wt_p) real, dimension(:), & - intent(in) :: Rlist !< The list of target densities, in kg m-3 - real, intent(in) :: R_in !< The density being inserted into Rlist, in kg m-3 + intent(in) :: Rlist !< The list of target densities [kg m-3] + real, intent(in) :: R_in !< The density being inserted into Rlist [kg m-3] integer, intent(inout) :: k !< The value of k such that Rlist(k) <= R_in < Rlist(k+1) !! The input value is a first guess integer, intent(in) :: nz !< The number of layers in Rlist diff --git a/src/equation_of_state/MOM_EOS.F90 b/src/equation_of_state/MOM_EOS.F90 index 43b99b46e0..a872d3d5a6 100644 --- a/src/equation_of_state/MOM_EOS.F90 +++ b/src/equation_of_state/MOM_EOS.F90 @@ -92,13 +92,13 @@ module MOM_EOS logical :: Compressible = .true. !< If true, in situ density is a function of pressure. ! The following parameters are used with the linear equation of state only. real :: Rho_T0_S0 !< The density at T=0, S=0 [kg m-3]. - real :: dRho_dT !< The partial derivatives of density with temperature - real :: dRho_dS !< and salinity, in kg m-3 K-1 and kg m-3 psu-1. + real :: dRho_dT !< The partial derivative of density with temperature [kg m-3 degC-1] + real :: dRho_dS !< The partial derivative of density with salinity [kg m-3 ppt-1]. ! The following parameters are use with the linear expression for the freezing ! point only. - real :: TFr_S0_P0 !< The freezing potential temperature at S=0, P=0 in deg C. - real :: dTFr_dS !< The derivative of freezing point with salinity, in deg C PSU-1. - real :: dTFr_dp !< The derivative of freezing point with pressure, in deg C Pa-1. + real :: TFr_S0_P0 !< The freezing potential temperature at S=0, P=0 [degC]. + real :: dTFr_dS !< The derivative of freezing point with salinity [deg C ppt-1]. + real :: dTFr_dp !< The derivative of freezing point with pressure [deg C Pa-1]. ! logical :: test_EOS = .true. ! If true, test the equation of state end type EOS_type @@ -131,12 +131,12 @@ module MOM_EOS !> Calls the appropriate subroutine to calculate density of sea water for scalar inputs. !! If rho_ref is present, the anomaly with respect to rho_ref is returned. subroutine calculate_density_scalar(T, S, pressure, rho, EOS, rho_ref) - real, intent(in) :: T !< Potential temperature referenced to the surface (degC) - real, intent(in) :: S !< Salinity (PSU) - real, intent(in) :: pressure !< Pressure (Pa) - real, intent(out) :: rho !< Density (in-situ if pressure is local) (kg m-3) + real, intent(in) :: T !< Potential temperature referenced to the surface [degC] + real, intent(in) :: S !< Salinity [ppt] + real, intent(in) :: pressure !< Pressure [Pa] + real, intent(out) :: rho !< Density (in-situ if pressure is local) [kg m-3] type(EOS_type), pointer :: EOS !< Equation of state structure - real, optional, intent(in) :: rho_ref !< A reference density in kg m-3. + real, optional, intent(in) :: rho_ref !< A reference density [kg m-3]. if (.not.associated(EOS)) call MOM_error(FATAL, & "calculate_density_scalar called with an unassociated EOS_type EOS.") @@ -163,14 +163,14 @@ end subroutine calculate_density_scalar !> Calls the appropriate subroutine to calculate the density of sea water for 1-D array inputs. !! If rho_ref is present, the anomaly with respect to rho_ref is returned. subroutine calculate_density_array(T, S, pressure, rho, start, npts, EOS, rho_ref) - real, dimension(:), intent(in) :: T !< Potential temperature referenced to the surface (degC) - real, dimension(:), intent(in) :: S !< Salinity (PSU) - real, dimension(:), intent(in) :: pressure !< Pressure (Pa) - real, dimension(:), intent(out) :: rho !< Density (in-situ if pressure is local) (kg m-3) + real, dimension(:), intent(in) :: T !< Potential temperature referenced to the surface [degC] + real, dimension(:), intent(in) :: S !< Salinity [ppt] + real, dimension(:), intent(in) :: pressure !< Pressure [Pa] + real, dimension(:), intent(out) :: rho !< Density (in-situ if pressure is local) [kg m-3] integer, intent(in) :: start !< Start index for computation integer, intent(in) :: npts !< Number of point to compute type(EOS_type), pointer :: EOS !< Equation of state structure - real, optional, intent(in) :: rho_ref !< A reference density in kg m-3. + real, optional, intent(in) :: rho_ref !< A reference density [kg m-3]. if (.not.associated(EOS)) call MOM_error(FATAL, & "calculate_density_array called with an unassociated EOS_type EOS.") @@ -197,12 +197,12 @@ end subroutine calculate_density_array !> Calls the appropriate subroutine to calculate specific volume of sea water !! for scalar inputs. subroutine calculate_spec_vol_scalar(T, S, pressure, specvol, EOS, spv_ref) - real, intent(in) :: T !< Potential temperature referenced to the surface (degC) - real, intent(in) :: S !< Salinity (PSU) - real, intent(in) :: pressure !< Pressure (Pa) + real, intent(in) :: T !< Potential temperature referenced to the surface [degC] + real, intent(in) :: S !< Salinity [ppt] + real, intent(in) :: pressure !< Pressure [Pa] real, intent(out) :: specvol !< specific volume (in-situ if pressure is local) (m3 kg-1) type(EOS_type), pointer :: EOS !< Equation of state structure - real, optional, intent(in) :: spv_ref !< A reference specific volume in m3 kg-1. + real, optional, intent(in) :: spv_ref !< A reference specific volume [m3 kg-1]. real :: rho @@ -238,14 +238,14 @@ end subroutine calculate_spec_vol_scalar !! for 1-D array inputs. subroutine calculate_spec_vol_array(T, S, pressure, specvol, start, npts, EOS, spv_ref) real, dimension(:), intent(in) :: T !< potential temperature relative to the surface - !! in C. - real, dimension(:), intent(in) :: S !< salinity in PSU. - real, dimension(:), intent(in) :: pressure !< pressure in Pa. - real, dimension(:), intent(out) :: specvol !< in situ specific volume in kg m-3. + !! [degC]. + real, dimension(:), intent(in) :: S !< salinity [ppt]. + real, dimension(:), intent(in) :: pressure !< pressure [Pa]. + real, dimension(:), intent(out) :: specvol !< in situ specific volume [kg m-3]. integer, intent(in) :: start !< the starting point in the arrays. integer, intent(in) :: npts !< the number of values to calculate. type(EOS_type), pointer :: EOS !< Equation of state structure - real, optional, intent(in) :: spv_ref !< A reference specific volume in m3 kg-1. + real, optional, intent(in) :: spv_ref !< A reference specific volume [m3 kg-1]. real, dimension(size(specvol)) :: rho @@ -280,10 +280,10 @@ end subroutine calculate_spec_vol_array !> Calls the appropriate subroutine to calculate the freezing point for scalar inputs. subroutine calculate_TFreeze_scalar(S, pressure, T_fr, EOS) - real, intent(in) :: S !< Salinity (PSU) - real, intent(in) :: pressure !< Pressure (Pa) + real, intent(in) :: S !< Salinity [ppt] + real, intent(in) :: pressure !< Pressure [Pa] real, intent(out) :: T_fr !< Freezing point potential temperature referenced - !! to the surface (degC) + !! to the surface [degC] type(EOS_type), pointer :: EOS !< Equation of state structure if (.not.associated(EOS)) call MOM_error(FATAL, & @@ -306,10 +306,10 @@ end subroutine calculate_TFreeze_scalar !> Calls the appropriate subroutine to calculate the freezing point for a 1-D array. subroutine calculate_TFreeze_array(S, pressure, T_fr, start, npts, EOS) - real, dimension(:), intent(in) :: S !< Salinity (PSU) - real, dimension(:), intent(in) :: pressure !< Pressure (Pa) + real, dimension(:), intent(in) :: S !< Salinity [ppt] + real, dimension(:), intent(in) :: pressure !< Pressure [Pa] real, dimension(:), intent(out) :: T_fr !< Freezing point potential temperature referenced - !! to the surface (degC) + !! to the surface [degC] integer, intent(in) :: start !< Starting index within the array integer, intent(in) :: npts !< The number of values to calculate type(EOS_type), pointer :: EOS !< Equation of state structure @@ -334,17 +334,17 @@ end subroutine calculate_TFreeze_array !> Calls the appropriate subroutine to calculate density derivatives for 1-D array inputs. subroutine calculate_density_derivs_array(T, S, pressure, drho_dT, drho_dS, start, npts, EOS) - real, dimension(:), intent(in) :: T !< Potential temperature referenced to the surface (degC) - real, dimension(:), intent(in) :: S !< Salinity (PSU) - real, dimension(:), intent(in) :: pressure !< Pressure (Pa) + real, dimension(:), intent(in) :: T !< Potential temperature referenced to the surface [degC] + real, dimension(:), intent(in) :: S !< Salinity [ppt] + real, dimension(:), intent(in) :: pressure !< Pressure [Pa] real, dimension(:), intent(out) :: drho_dT !< The partial derivative of density with potential - !! temperature, in kg m-3 K-1. + !! temperature [kg m-3 degC-1]. real, dimension(:), intent(out) :: drho_dS !< The partial derivative of density with salinity, - !! in kg m-3 psu-1. + !! in [kg m-3 ppt-1]. integer, intent(in) :: start !< Starting index within the array integer, intent(in) :: npts !< The number of values to calculate type(EOS_type), pointer :: EOS !< Equation of state structure - !! + if (.not.associated(EOS)) call MOM_error(FATAL, & "calculate_density_derivs called with an unassociated EOS_type EOS.") @@ -370,13 +370,13 @@ end subroutine calculate_density_derivs_array !> Calls the appropriate subroutines to calculate density derivatives by promoting a scalar !! to a one-element array subroutine calculate_density_derivs_scalar(T, S, pressure, drho_dT, drho_dS, EOS) - real, intent(in) :: T !< Potential temperature referenced to the surface (degC) - real, intent(in) :: S !< Salinity (PSU) - real, intent(in) :: pressure !< Pressure (Pa) + real, intent(in) :: T !< Potential temperature referenced to the surface [degC] + real, intent(in) :: S !< Salinity [ppt] + real, intent(in) :: pressure !< Pressure [Pa] real, intent(out) :: drho_dT !< The partial derivative of density with potential - !! temperature, in kg m-3 K-1. + !! temperature [kg m-3 degC-1]. real, intent(out) :: drho_dS !< The partial derivative of density with salinity, - !! in kg m-3 psu-1. + !! in [kg m-3 ppt-1]. type(EOS_type), pointer :: EOS !< Equation of state structure if (.not.associated(EOS)) call MOM_error(FATAL, & "calculate_density_derivs called with an unassociated EOS_type EOS.") @@ -399,18 +399,23 @@ end subroutine calculate_density_derivs_scalar !> Calls the appropriate subroutine to calculate density second derivatives for 1-D array inputs. subroutine calculate_density_second_derivs_array(T, S, pressure, drho_dS_dS, drho_dS_dT, drho_dT_dT, & drho_dS_dP, drho_dT_dP, start, npts, EOS) - real, dimension(:), intent(in) :: T !< Potential temperature referenced to the surface (degC) - real, dimension(:), intent(in) :: S !< Salinity (PSU) - real, dimension(:), intent(in) :: pressure !< Pressure (Pa) - real, dimension(:), intent(out) :: drho_dS_dS !< Partial derivative of beta with respect to S - real, dimension(:), intent(out) :: drho_dS_dT !< Partial derivative of beta with resepct to T - real, dimension(:), intent(out) :: drho_dT_dT !< Partial derivative of alpha with respect to T - real, dimension(:), intent(out) :: drho_dS_dP !< Partial derivative of beta with respect to pressure - real, dimension(:), intent(out) :: drho_dT_dP !< Partial derivative of alpha with respect to pressure + real, dimension(:), intent(in) :: T !< Potential temperature referenced to the surface [degC] + real, dimension(:), intent(in) :: S !< Salinity [ppt] + real, dimension(:), intent(in) :: pressure !< Pressure [Pa] + real, dimension(:), intent(out) :: drho_dS_dS !< Partial derivative of beta with respect + !! to S [kg m-3 ppt-2] + real, dimension(:), intent(out) :: drho_dS_dT !< Partial derivative of beta with respcct + !! to T [kg m-3 ppt-1 degC-1] + real, dimension(:), intent(out) :: drho_dT_dT !< Partial derivative of alpha with respect + !! to T [kg m-3 degC-2] + real, dimension(:), intent(out) :: drho_dS_dP !< Partial derivative of beta with respect + !! to pressure [kg m-3 ppt-1 Pa-1] + real, dimension(:), intent(out) :: drho_dT_dP !< Partial derivative of alpha with respect + !! to pressure [kg m-3 degC-1 Pa-1] integer, intent(in) :: start !< Starting index within the array integer, intent(in) :: npts !< The number of values to calculate type(EOS_type), pointer :: EOS !< Equation of state structure - !! + if (.not.associated(EOS)) call MOM_error(FATAL, & "calculate_density_derivs called with an unassociated EOS_type EOS.") @@ -434,16 +439,21 @@ end subroutine calculate_density_second_derivs_array !> Calls the appropriate subroutine to calculate density second derivatives for scalar nputs. subroutine calculate_density_second_derivs_scalar(T, S, pressure, drho_dS_dS, drho_dS_dT, drho_dT_dT, & drho_dS_dP, drho_dT_dP, EOS) - real, intent(in) :: T !< Potential temperature referenced to the surface (degC) - real, intent(in) :: S !< Salinity (PSU) - real, intent(in) :: pressure !< Pressure (Pa) - real, intent(out) :: drho_dS_dS !< Partial derivative of beta with respect to S - real, intent(out) :: drho_dS_dT !< Partial derivative of beta with resepct to T - real, intent(out) :: drho_dT_dT !< Partial derivative of alpha with respect to T - real, intent(out) :: drho_dS_dP !< Partial derivative of beta with respect to pressure - real, intent(out) :: drho_dT_dP !< Partial derivative of alpha with respect to pressure + real, intent(in) :: T !< Potential temperature referenced to the surface [degC] + real, intent(in) :: S !< Salinity [ppt] + real, intent(in) :: pressure !< Pressure [Pa] + real, intent(out) :: drho_dS_dS !< Partial derivative of beta with respect + !! to S [kg m-3 ppt-2] + real, intent(out) :: drho_dS_dT !< Partial derivative of beta with respcct + !! to T [kg m-3 ppt-1 degC-1] + real, intent(out) :: drho_dT_dT !< Partial derivative of alpha with respect + !! to T [kg m-3 degC-2] + real, intent(out) :: drho_dS_dP !< Partial derivative of beta with respect + !! to pressure [kg m-3 ppt-1 Pa-1] + real, intent(out) :: drho_dT_dP !< Partial derivative of alpha with respect + !! to pressure [kg m-3 degC-1 Pa-1] type(EOS_type), pointer :: EOS !< Equation of state structure - !! + if (.not.associated(EOS)) call MOM_error(FATAL, & "calculate_density_derivs called with an unassociated EOS_type EOS.") @@ -466,13 +476,13 @@ end subroutine calculate_density_second_derivs_scalar !> Calls the appropriate subroutine to calculate specific volume derivatives for an array. subroutine calculate_specific_vol_derivs(T, S, pressure, dSV_dT, dSV_dS, start, npts, EOS) - real, dimension(:), intent(in) :: T !< Potential temperature referenced to the surface (degC) - real, dimension(:), intent(in) :: S !< Salinity (PSU) - real, dimension(:), intent(in) :: pressure !< Pressure (Pa) + real, dimension(:), intent(in) :: T !< Potential temperature referenced to the surface [degC] + real, dimension(:), intent(in) :: S !< Salinity [ppt] + real, dimension(:), intent(in) :: pressure !< Pressure [Pa] real, dimension(:), intent(out) :: dSV_dT !< The partial derivative of specific volume with potential - !! temperature, in m3 kg-1 K-1. - real, dimension(:), intent(out) :: dSV_dS !< The partial derivative of specific volume with salinity, - !! in m3 kg-1 / (g/kg). + !! temperature [m3 kg-1 degC-1]. + real, dimension(:), intent(out) :: dSV_dS !< The partial derivative of specific volume with salinity + !! [m3 kg-1 ppt-1]. integer, intent(in) :: start !< Starting index within the array integer, intent(in) :: npts !< The number of values to calculate type(EOS_type), pointer :: EOS !< Equation of state structure @@ -514,10 +524,10 @@ end subroutine calculate_specific_vol_derivs !> Calls the appropriate subroutine to calculate the density and compressibility for 1-D array inputs. subroutine calculate_compress(T, S, pressure, rho, drho_dp, start, npts, EOS) - real, dimension(:), intent(in) :: T !< Potential temperature referenced to the surface (degC) - real, dimension(:), intent(in) :: S !< Salinity (PSU) - real, dimension(:), intent(in) :: pressure !< Pressure (Pa) - real, dimension(:), intent(out) :: rho !< In situ density in kg m-3. + real, dimension(:), intent(in) :: T !< Potential temperature referenced to the surface [degC] + real, dimension(:), intent(in) :: S !< Salinity [ppt] + real, dimension(:), intent(in) :: pressure !< Pressure [Pa] + real, dimension(:), intent(out) :: rho !< In situ density [kg m-3]. real, dimension(:), intent(out) :: drho_dp !< The partial derivative of density with pressure !! (also the inverse of the square of sound speed) in s2 m-2. integer, intent(in) :: start !< Starting index within the array @@ -557,13 +567,13 @@ subroutine int_specific_vol_dp(T, S, p_t, p_b, alpha_ref, HI, EOS, & bathyP, dP_tiny, useMassWghtInterp) type(hor_index_type), intent(in) :: HI !< The horizontal index structure real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & - intent(in) :: T !< Potential temperature referenced to the surface (degC) + intent(in) :: T !< Potential temperature referenced to the surface [degC] real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & - intent(in) :: S !< Salinity (PSU) + intent(in) :: S !< Salinity [ppt] real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & - intent(in) :: p_t !< Pressure at the top of the layer in Pa. + intent(in) :: p_t !< Pressure at the top of the layer [Pa]. real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & - intent(in) :: p_b !< Pressure at the bottom of the layer in Pa. + intent(in) :: p_b !< Pressure at the bottom of the layer [Pa]. real, intent(in) :: alpha_ref !< A mean specific volume that is subtracted out !! to reduce the magnitude of each of the integrals, m3 kg-1. The !! calculation is mathematically identical with different values of @@ -575,7 +585,7 @@ subroutine int_specific_vol_dp(T, S, p_t, p_b, alpha_ref, HI, EOS, & real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & optional, intent(out) :: intp_dza !< The integral in pressure through the layer of the !! geopotential anomaly relative to the anomaly at the bottom of the - !! layer, in Pa m2 s-2. + !! layer [Pa m2 s-2]. real, dimension(HI%IsdB:HI%IedB,HI%jsd:HI%jed), & optional, intent(out) :: intx_dza !< The integral in x of the difference between the !! geopotential anomaly at the top and bottom of the layer divided by @@ -626,16 +636,16 @@ subroutine int_density_dz(T, S, z_t, z_b, rho_ref, rho_0, G_e, HII, HIO, EOS, & type(hor_index_type), intent(in) :: HII !< Ocean horizontal index structures for the input arrays type(hor_index_type), intent(in) :: HIO !< Ocean horizontal index structures for the output arrays real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & - intent(in) :: T !< Potential temperature referenced to the surface (degC) + intent(in) :: T !< Potential temperature referenced to the surface [degC] real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & - intent(in) :: S !< Salinity (PSU) + intent(in) :: S !< Salinity [ppt] real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & intent(in) :: z_t !< Height at the top of the layer in depth units [Z ~> m]. real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & intent(in) :: z_b !< Height at the bottom of the layer [Z ~> m]. - real, intent(in) :: rho_ref !< A mean density, in kg m-3, that is subtracted out to + real, intent(in) :: rho_ref !< A mean density [kg m-3], that is subtracted out to !! reduce the magnitude of each of the integrals. - real, intent(in) :: rho_0 !< A density, in kg m-3, that is used to calculate the + real, intent(in) :: rho_0 !< A density [kg m-3], that is used to calculate the !! pressure (as p~=-z*rho_0*G_e) used in the equation of state. real, intent(in) :: G_e !< The Earth's gravitational acceleration [m2 Z-1 s-2 ~> m s-2]. type(EOS_type), pointer :: EOS !< Equation of state structure @@ -644,7 +654,7 @@ subroutine int_density_dz(T, S, z_t, z_b, rho_ref, rho_0, G_e, HII, HIO, EOS, & real, dimension(HIO%isd:HIO%ied,HIO%jsd:HIO%jed), & optional, intent(out) :: intz_dpa !< The integral through the thickness of the layer of !! the pressure anomaly relative to the anomaly at the - !! top of the layer, in Pa Z. + !! top of the layer [Pa Z ~> Pa m]. real, dimension(HIO%IsdB:HIO%IedB,HIO%jsd:HIO%jed), & optional, intent(out) :: intx_dpa !< The integral in x of the difference between the !! pressure anomaly at the top and bottom of the layer @@ -804,11 +814,11 @@ subroutine EOS_manual_init(EOS, form_of_EOS, form_of_TFreeze, EOS_quadrature, Co logical, optional, intent(in) :: EOS_quadrature !< If true, always use the generic (quadrature) !! code for the integrals of density. logical, optional, intent(in) :: Compressible !< If true, in situ density is a function of pressure. - real , optional, intent(in) :: Rho_T0_S0 !< Density at T=0 degC and S=0 ppt (kg m-3) + real , optional, intent(in) :: Rho_T0_S0 !< Density at T=0 degC and S=0 ppt [kg m-3] real , optional, intent(in) :: drho_dT !< Partial derivative of density with temperature - !! in (kg m-3 degC-1) + !! in [kg m-3 degC-1] real , optional, intent(in) :: dRho_dS !< Partial derivative of density with salinity - !! in (kg m-3 ppt-1) + !! in [kg m-3 ppt-1] real , optional, intent(in) :: TFr_S0_P0 !< The freezing potential temperature at S=0, P=0 in deg C. real , optional, intent(in) :: dTFr_dS !< The derivative of freezing point with salinity, !! in deg C PSU-1. @@ -848,9 +858,9 @@ end subroutine EOS_end !! EOS_type (EOS argument) to be set to use the linear equation of state !! independent from the rest of the model. subroutine EOS_use_linear(Rho_T0_S0, dRho_dT, dRho_dS, EOS, use_quadrature) - real, intent(in) :: Rho_T0_S0 !< Density at T=0 degC and S=0 ppt (kg m-3) - real, intent(in) :: dRho_dT !< Partial derivative of density with temperature (kg m-3 degC-1) - real, intent(in) :: dRho_dS !< Partial derivative of density with salinity (kg m-3 ppt-1) + real, intent(in) :: Rho_T0_S0 !< Density at T=0 degC and S=0 ppt [kg m-3] + real, intent(in) :: dRho_dT !< Partial derivative of density with temperature [kg m-3 degC-1] + real, intent(in) :: dRho_dS !< Partial derivative of density with salinity [kg m-3 ppt-1] logical, optional, intent(in) :: use_quadrature !< If true, always use the generic (quadrature) !! code for the integrals of density. type(EOS_type), pointer :: EOS !< Equation of state structure @@ -877,17 +887,17 @@ subroutine int_density_dz_generic(T, S, z_t, z_b, rho_ref, rho_0, G_e, HII, HIO, type(hor_index_type), intent(in) :: HII !< Horizontal index type for input variables. type(hor_index_type), intent(in) :: HIO !< Horizontal index type for output variables. real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & - intent(in) :: T !< Potential temperature of the layer in C. + intent(in) :: T !< Potential temperature of the layer [degC]. real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & - intent(in) :: S !< Salinity of the layer in PSU. + intent(in) :: S !< Salinity of the layer [ppt]. real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & intent(in) :: z_t !< Height at the top of the layer in depth units [Z ~> m]. real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & intent(in) :: z_b !< Height at the bottom of the layer [Z ~> m]. - real, intent(in) :: rho_ref !< A mean density, in kg m-3, that is + real, intent(in) :: rho_ref !< A mean density [kg m-3], that is !! subtracted out to reduce the magnitude !! of each of the integrals. - real, intent(in) :: rho_0 !< A density, in kg m-3, that is used + real, intent(in) :: rho_0 !< A density [kg m-3], that is used !! to calculate the pressure (as p~=-z*rho_0*G_e) !! used in the equation of state. real, intent(in) :: G_e !< The Earth's gravitational acceleration [m2 Z-1 s-2 ~> m s-2]. @@ -898,7 +908,7 @@ subroutine int_density_dz_generic(T, S, z_t, z_b, rho_ref, rho_0, G_e, HII, HIO, real, dimension(HIO%isd:HIO%ied,HIO%jsd:HIO%jed), & optional, intent(out) :: intz_dpa !< The integral through the thickness of the !! layer of the pressure anomaly relative to the - !! anomaly at the top of the layer, in Pa Z. + !! anomaly at the top of the layer [Pa Z ~> Pa m]. real, dimension(HIO%IsdB:HIO%IedB,HIO%jsd:HIO%jed), & optional, intent(out) :: intx_dpa !< The integral in x of the difference between !! the pressure anomaly at the top and bottom of the @@ -913,7 +923,7 @@ subroutine int_density_dz_generic(T, S, z_t, z_b, rho_ref, rho_0, G_e, HII, HIO, logical, optional, intent(in) :: useMassWghtInterp !< If true, uses mass weighting to !! interpolate T/S for top and bottom integrals. real :: T5(5), S5(5), p5(5), r5(5) - real :: rho_anom ! The depth averaged density anomaly in kg m-3. + real :: rho_anom ! The depth averaged density anomaly [kg m-3]. real :: w_left, w_right real, parameter :: C1_90 = 1.0/90.0 ! Rational constants. real :: GxRho, I_Rho @@ -1064,25 +1074,24 @@ subroutine int_density_dz_generic_plm (T_t, T_b, S_t, S_b, z_t, z_b, rho_ref, & type(hor_index_type), intent(in) :: HII !< Ocean horizontal index structures for the input arrays type(hor_index_type), intent(in) :: HIO !< Ocean horizontal index structures for the output arrays real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & - intent(in) :: T_t !< Potential temperatue at the cell top (degC) + intent(in) :: T_t !< Potential temperatue at the cell top [degC] real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & - intent(in) :: T_b !< Potential temperatue at the cell bottom (degC) + intent(in) :: T_b !< Potential temperatue at the cell bottom [degC] real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & - intent(in) :: S_t !< Salinity at the cell top (ppt) + intent(in) :: S_t !< Salinity at the cell top [ppt] real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & - intent(in) :: S_b !< Salinity at the cell bottom (ppt) + intent(in) :: S_b !< Salinity at the cell bottom [ppt] real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & intent(in) :: z_t !< The geometric height at the top of the layer, !! in depth units [Z ~> m]. real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & intent(in) :: z_b !< The geometric height at the bottom of the layer [Z ~> m]. - real, intent(in) :: rho_ref !< A mean density, in kg m-3, that is subtracted out to + real, intent(in) :: rho_ref !< A mean density [kg m-3], that is subtracted out to !! reduce the magnitude of each of the integrals. - real, intent(in) :: rho_0 !< A density, in kg m-3, that is used to calculate the + real, intent(in) :: rho_0 !< A density [kg m-3], that is used to calculate the !! pressure (as p~=-z*rho_0*G_e) used in the equation of state. real, intent(in) :: G_e !< The Earth's gravitational acceleration [m2 Z-1 s-2 ~> m s-2]. - real, intent(in) :: dz_subroundoff !< A miniscule thickness - !! change with the same units as z_t + real, intent(in) :: dz_subroundoff !< A miniscule thickness change [Z ~> m]. real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & intent(in) :: bathyT !< The depth of the bathymetry [Z ~> m]. type(EOS_type), pointer :: EOS !< Equation of state structure @@ -1091,7 +1100,7 @@ subroutine int_density_dz_generic_plm (T_t, T_b, S_t, S_b, z_t, z_b, rho_ref, & real, dimension(HIO%isd:HIO%ied,HIO%jsd:HIO%jed), & optional, intent(out) :: intz_dpa !< The integral through the thickness of the layer of !! the pressure anomaly relative to the anomaly at the - !! top of the layer, in Pa Z. + !! top of the layer [Pa Z]. real, dimension(HIO%IsdB:HIO%IedB,HIO%jsd:HIO%jed), & optional, intent(out) :: intx_dpa !< The integral in x of the difference between the !! pressure anomaly at the top and bottom of the layer @@ -1114,29 +1123,29 @@ subroutine int_density_dz_generic_plm (T_t, T_b, S_t, S_b, z_t, z_b, rho_ref, & ! a linear interpolation is used to compute intermediate values. ! Local variables - real :: T5((5*HIO%iscB+1):(5*(HIO%iecB+2))) ! Temperatures along a line of subgrid locations, in degC. - real :: S5((5*HIO%iscB+1):(5*(HIO%iecB+2))) ! Salinities along a line of subgrid locations, in ppt. - real :: p5((5*HIO%iscB+1):(5*(HIO%iecB+2))) ! Pressures along a line of subgrid locations, in Pa. - real :: r5((5*HIO%iscB+1):(5*(HIO%iecB+2))) ! Densities along a line of subgrid locations, in kg m-3. - real :: T15((15*HIO%iscB+1):(15*(HIO%iecB+1))) ! Temperatures at an array of subgrid locations, in degC. - real :: S15((15*HIO%iscB+1):(15*(HIO%iecB+1))) ! Salinities at an array of subgrid locations, in ppt. - real :: p15((15*HIO%iscB+1):(15*(HIO%iecB+1))) ! Pressures at an array of subgrid locations, in Pa. - real :: r15((15*HIO%iscB+1):(15*(HIO%iecB+1))) ! Densities at an array of subgrid locations, in kg m-3. + real :: T5((5*HIO%iscB+1):(5*(HIO%iecB+2))) ! Temperatures along a line of subgrid locations [degC]. + real :: S5((5*HIO%iscB+1):(5*(HIO%iecB+2))) ! Salinities along a line of subgrid locations [ppt]. + real :: p5((5*HIO%iscB+1):(5*(HIO%iecB+2))) ! Pressures along a line of subgrid locations [Pa]. + real :: r5((5*HIO%iscB+1):(5*(HIO%iecB+2))) ! Densities along a line of subgrid locations [kg m-3]. + real :: T15((15*HIO%iscB+1):(15*(HIO%iecB+1))) ! Temperatures at an array of subgrid locations [degC]. + real :: S15((15*HIO%iscB+1):(15*(HIO%iecB+1))) ! Salinities at an array of subgrid locations [ppt]. + real :: p15((15*HIO%iscB+1):(15*(HIO%iecB+1))) ! Pressures at an array of subgrid locations [Pa]. + real :: r15((15*HIO%iscB+1):(15*(HIO%iecB+1))) ! Densities at an array of subgrid locations [kg m-3]. real :: wt_t(5), wt_b(5) ! Top and bottom weights [nondim]. - real :: rho_anom ! A density anomaly in kg m-3. + real :: rho_anom ! A density anomaly [kg m-3]. real :: w_left, w_right ! Left and right weights [nondim]. real :: intz(5) ! The gravitational acceleration times the integrals of density ! with height at the 5 sub-column locations [Pa]. real, parameter :: C1_90 = 1.0/90.0 ! A rational constant [nondim]. - real :: GxRho ! Gravitational acceleration times density, in kg m-1 Z-1 s-2. - real :: I_Rho ! The inverse of the reference density, in m3 kg-1. + real :: GxRho ! Gravitational acceleration times density [kg m-1 Z-1 s-2 ~> kg m-2 s-2]. + real :: I_Rho ! The inverse of the reference density [m3 kg-1]. real :: dz(HIO%iscB:HIO%iecB+1) ! Layer thicknesses at tracer points [Z ~> m]. real :: dz_x(5,HIO%iscB:HIO%iecB) ! Layer thicknesses along an x-line of subrid locations [Z ~> m]. real :: dz_y(5,HIO%isc:HIO%iec) ! Layer thicknesses along a y-line of subrid locations [Z ~> m]. real :: weight_t, weight_b ! Nondimensional wieghts of the top and bottom. real :: massWeightToggle ! A nondimensional toggle factor (0 or 1). real :: Ttl, Tbl, Ttr, Tbr ! Temperatures at the velocity cell corners [degC]. - real :: Stl, Sbl, Str, Sbr ! Salinities at the velocity cell corners, in ppt. + real :: Stl, Sbl, Str, Sbr ! Salinities at the velocity cell corners [ppt]. real :: hWght ! A topographically limited thicknes weight [Z ~> m]. real :: hL, hR ! Thicknesses to the left and right [Z ~> m]. real :: iDenom ! The denominator of the thickness weight expressions [Z-2 ~> m-2]. @@ -1361,18 +1370,18 @@ end subroutine int_density_dz_generic_plm !> Find the depth at which the reconstructed pressure matches P_tgt subroutine find_depth_of_pressure_in_cell(T_t, T_b, S_t, S_b, z_t, z_b, P_t, P_tgt, & rho_ref, G_e, EOS, P_b, z_out, z_tol) - real, intent(in) :: T_t !< Potential temperatue at the cell top (degC) - real, intent(in) :: T_b !< Potential temperatue at the cell bottom (degC) - real, intent(in) :: S_t !< Salinity at the cell top (ppt) - real, intent(in) :: S_b !< Salinity at the cell bottom (ppt) + real, intent(in) :: T_t !< Potential temperatue at the cell top [degC] + real, intent(in) :: T_b !< Potential temperatue at the cell bottom [degC] + real, intent(in) :: S_t !< Salinity at the cell top [ppt] + real, intent(in) :: S_b !< Salinity at the cell bottom [ppt] real, intent(in) :: z_t !< Absolute height of top of cell [Z ~> m]. (Boussinesq ????) real, intent(in) :: z_b !< Absolute height of bottom of cell [Z ~> m]. - real, intent(in) :: P_t !< Anomalous pressure of top of cell, relative to g*rho_ref*z_t (Pa) - real, intent(in) :: P_tgt !< Target pressure at height z_out, relative to g*rho_ref*z_out (Pa) + real, intent(in) :: P_t !< Anomalous pressure of top of cell, relative to g*rho_ref*z_t [Pa] + real, intent(in) :: P_tgt !< Target pressure at height z_out, relative to g*rho_ref*z_out [Pa] real, intent(in) :: rho_ref !< Reference density with which calculation are anomalous to real, intent(in) :: G_e !< Gravitational acceleration (m2 Z-1 s-2) type(EOS_type), pointer :: EOS !< Equation of state structure - real, intent(out) :: P_b !< Pressure at the bottom of the cell (Pa) + real, intent(out) :: P_b !< Pressure at the bottom of the cell [Pa] real, intent(out) :: z_out !< Absolute depth at which anomalous pressure = p_tgt [Z ~> m]. real, optional, intent(in) :: z_tol !< The tolerance in finding z_out [Z ~> m]. ! Local variables @@ -1433,16 +1442,16 @@ end subroutine find_depth_of_pressure_in_cell !> Returns change in anomalous pressure change from top to non-dimensional !! position pos between z_t and z_b real function frac_dp_at_pos(T_t, T_b, S_t, S_b, z_t, z_b, rho_ref, G_e, pos, EOS) - real, intent(in) :: T_t !< Potential temperatue at the cell top (degC) - real, intent(in) :: T_b !< Potential temperatue at the cell bottom (degC) - real, intent(in) :: S_t !< Salinity at the cell top (ppt) - real, intent(in) :: S_b !< Salinity at the cell bottom (ppt) - real, intent(in) :: z_t !< The geometric height at the top of the layer, usually in m - real, intent(in) :: z_b !< The geometric height at the bottom of the layer, usually in m - real, intent(in) :: rho_ref !< A mean density, in kg m-3, that is subtracted out to + real, intent(in) :: T_t !< Potential temperatue at the cell top [degC] + real, intent(in) :: T_b !< Potential temperatue at the cell bottom [degC] + real, intent(in) :: S_t !< Salinity at the cell top [ppt] + real, intent(in) :: S_b !< Salinity at the cell bottom [ppt] + real, intent(in) :: z_t !< The geometric height at the top of the layer [Z ~> m] + real, intent(in) :: z_b !< The geometric height at the bottom of the layer [Z ~> m] + real, intent(in) :: rho_ref !< A mean density [kg m-3], that is subtracted out to !! reduce the magnitude of each of the integrals. real, intent(in) :: G_e !< The Earth's gravitational acceleration [m s-2] - real, intent(in) :: pos !< The fractional vertical position, nondim, 0 to 1. + real, intent(in) :: pos !< The fractional vertical position, 0 to 1 [nondim]. type(EOS_type), pointer :: EOS !< Equation of state structure ! Local variables real, parameter :: C1_90 = 1.0/90.0 ! Rational constants. @@ -1480,24 +1489,24 @@ subroutine int_density_dz_generic_ppm (T, T_t, T_b, S, S_t, S_b, & type(hor_index_type), intent(in) :: HII !< Ocean horizontal index structures for the input arrays type(hor_index_type), intent(in) :: HIO !< Ocean horizontal index structures for the output arrays real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & - intent(in) :: T !< Potential temperature referenced to the surface (degC) + intent(in) :: T !< Potential temperature referenced to the surface [degC] real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & - intent(in) :: T_t !< Potential temperatue at the cell top (degC) + intent(in) :: T_t !< Potential temperatue at the cell top [degC] real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & - intent(in) :: T_b !< Potential temperatue at the cell bottom (degC) + intent(in) :: T_b !< Potential temperatue at the cell bottom [degC] real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & - intent(in) :: S !< Salinity (PSU) + intent(in) :: S !< Salinity [ppt] real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & - intent(in) :: S_t !< Salinity at the cell top (ppt) + intent(in) :: S_t !< Salinity at the cell top [ppt] real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & - intent(in) :: S_b !< Salinity at the cell bottom (ppt) + intent(in) :: S_b !< Salinity at the cell bottom [ppt] real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & - intent(in) :: z_t !< Height at the top of the layer in m. + intent(in) :: z_t !< Height at the top of the layer [Z ~> m]. real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & - intent(in) :: z_b !< Height at the bottom of the layer in m. - real, intent(in) :: rho_ref !< A mean density, in kg m-3, that is subtracted out to + intent(in) :: z_b !< Height at the bottom of the layer [Z ~> m]. + real, intent(in) :: rho_ref !< A mean density [kg m-3], that is subtracted out to !! reduce the magnitude of each of the integrals. - real, intent(in) :: rho_0 !< A density, in kg m-3, that is used to calculate the + real, intent(in) :: rho_0 !< A density [kg m-3], that is used to calculate the !! pressure (as p~=-z*rho_0*G_e) used in the equation of state. real, intent(in) :: G_e !< The Earth's gravitational acceleration [m s-2] type(EOS_type), pointer :: EOS !< Equation of state structure @@ -1506,7 +1515,7 @@ subroutine int_density_dz_generic_ppm (T, T_t, T_b, S, S_t, S_b, & real, dimension(HIO%isd:HIO%ied,HIO%jsd:HIO%jed), & optional, intent(out) :: intz_dpa !< The integral through the thickness of the layer of !! the pressure anomaly relative to the anomaly at the - !! top of the layer, in Pa m. + !! top of the layer [Pa Z ~> Pa m]. real, dimension(HIO%IsdB:HIO%IedB,HIO%jsd:HIO%jed), & optional, intent(out) :: intx_dpa !< The integral in x of the difference between the !! pressure anomaly at the top and bottom of the layer @@ -1526,35 +1535,8 @@ subroutine int_density_dz_generic_ppm (T, T_t, T_b, S, S_t, S_b, & ! It is assumed that the salinity and temperature profiles are linear in the ! vertical. The top and bottom values within each layer are provided and ! a linear interpolation is used to compute intermediate values. -! -! Arguments: T - potential temperature relative to the surface in C -! (the 't' and 'b' subscripts refer to the values at -! the top and the bottom of each layer) -! (in) S - salinity in PSU. -! (the 't' and 'b' subscripts refer to the values at -! the top and the bottom of each layer) -! (in) z_t - height at the top of the layer in m. -! (in) z_b - height at the top of the layer in m. -! (in) rho_ref - A mean density, in kg m-3, that is subtracted out to reduce -! the magnitude of each of the integrals. -! (The pressure is calucated as p~=-z*rho_0*G_e.) -! (in) rho_0 - A density, in kg m-3, that is used to calculate the pressure -! (as p~=-z*rho_0*G_e) used in the equation of state. -! (in) G_e - The Earth's gravitational acceleration [m s-2] -! (in) G - The ocean's grid structure. -! (in) form_of_eos - integer that selects the eqn of state. -! (out) dpa - The change in the pressure anomaly across the layer, -! in Pa. -! (out,opt) intz_dpa - The integral through the thickness of the layer of the -! pressure anomaly relative to the anomaly at the top of -! the layer, in Pa m. -! (out,opt) intx_dpa - The integral in x of the difference between the -! pressure anomaly at the top and bottom of the layer -! divided by the x grid spacing [Pa]. -! (out,opt) inty_dpa - The integral in y of the difference between the -! pressure anomaly at the top and bottom of the layer -! divided by the y grid spacing [Pa]. + ! Local variables real :: T5(5), S5(5), p5(5), r5(5) real :: rho_anom real :: w_left, w_right, intz(5) @@ -1562,8 +1544,8 @@ subroutine int_density_dz_generic_ppm (T, T_t, T_b, S, S_t, S_b, & real :: GxRho, I_Rho real :: dz real :: weight_t, weight_b - real :: s0, s1, s2 ! parabola coefficients for S - real :: t0, t1, t2 ! parabola coefficients for T + real :: s0, s1, s2 ! parabola coefficients for S [ppt] + real :: t0, t1, t2 ! parabola coefficients for T [degC] real :: xi ! normalized coordinate real :: T_top, T_mid, T_bot real :: S_top, S_mid, S_bot @@ -1944,16 +1926,16 @@ subroutine int_spec_vol_dp_generic(T, S, p_t, p_b, alpha_ref, HI, EOS, & bathyP, dP_neglect, useMassWghtInterp) type(hor_index_type), intent(in) :: HI !< A horizontal index type structure. real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & - intent(in) :: T !< Potential temperature of the layer in C. + intent(in) :: T !< Potential temperature of the layer [degC]. real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & - intent(in) :: S !< Salinity of the layer in PSU. + intent(in) :: S !< Salinity of the layer [ppt]. real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & - intent(in) :: p_t !< Pressure atop the layer in Pa. + intent(in) :: p_t !< Pressure atop the layer [Pa]. real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & - intent(in) :: p_b !< Pressure below the layer in Pa. + intent(in) :: p_b !< Pressure below the layer [Pa]. real, intent(in) :: alpha_ref !< A mean specific volume that is !! subtracted out to reduce the magnitude of each of the - !! integrals, in m3 kg-1. The calculation is mathematically + !! integrals [m3 kg-1]. The calculation is mathematically !! identical with different values of alpha_ref, but alpha_ref !! alters the effects of roundoff, and answers do change. type(EOS_type), pointer :: EOS !< Equation of state structure @@ -1963,7 +1945,7 @@ subroutine int_spec_vol_dp_generic(T, S, p_t, p_b, alpha_ref, HI, EOS, & real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & optional, intent(out) :: intp_dza !< The integral in pressure through the !! layer of the geopotential anomaly relative to the anomaly - !! at the bottom of the layer, in Pa m2 s-2. + !! at the bottom of the layer [Pa m2 s-2]. real, dimension(HI%IsdB:HI%IedB,HI%jsd:HI%jed), & optional, intent(out) :: intx_dza !< The integral in x of the difference !! between the geopotential anomaly at the top and bottom of @@ -1988,12 +1970,12 @@ subroutine int_spec_vol_dp_generic(T, S, p_t, p_b, alpha_ref, HI, EOS, & ! series for log(1-eps/1+eps) that assumes that |eps| < 0.34. real :: T5(5), S5(5), p5(5), a5(5) - real :: alpha_anom ! The depth averaged specific density anomaly in m3 kg-1. + real :: alpha_anom ! The depth averaged specific density anomaly [m3 kg-1]. real :: dp ! The pressure change through a layer [Pa]. ! real :: dp_90(2:4) ! The pressure change through a layer divided by 90 [Pa]. real :: hWght ! A pressure-thickness below topography [Pa]. real :: hL, hR ! Pressure-thicknesses of the columns to the left and right [Pa]. - real :: iDenom ! The inverse of the denominator in the weights, in Pa-2. + real :: iDenom ! The inverse of the denominator in the weights [Pa-2]. real :: hWt_LL, hWt_LR ! hWt_LA is the weighted influence of A on the left column [nondim]. real :: hWt_RL, hWt_RR ! hWt_RA is the weighted influence of A on the right column [nondim]. real :: wt_L, wt_R ! The linear weights of the left and right columns [nondim]. @@ -2134,20 +2116,20 @@ subroutine int_spec_vol_dp_generic_plm(T_t, T_b, S_t, S_b, p_t, p_b, alpha_ref, intp_dza, intx_dza, inty_dza, useMassWghtInterp) type(hor_index_type), intent(in) :: HI !< A horizontal index type structure. real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & - intent(in) :: T_t !< Potential temperature at the top of the layer in C. + intent(in) :: T_t !< Potential temperature at the top of the layer [degC]. real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & - intent(in) :: T_b !< Potential temperature at the bottom of the layer in C. + intent(in) :: T_b !< Potential temperature at the bottom of the layer [degC]. real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & - intent(in) :: S_t !< Salinity at the top the layer in PSU. + intent(in) :: S_t !< Salinity at the top the layer [ppt]. real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & - intent(in) :: S_b !< Salinity at the bottom the layer in PSU. + intent(in) :: S_b !< Salinity at the bottom the layer [ppt]. real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & - intent(in) :: p_t !< Pressure atop the layer in Pa. + intent(in) :: p_t !< Pressure atop the layer [Pa]. real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & - intent(in) :: p_b !< Pressure below the layer in Pa. + intent(in) :: p_b !< Pressure below the layer [Pa]. real, intent(in) :: alpha_ref !< A mean specific volume that is !! subtracted out to reduce the magnitude of each of the - !! integrals, in m3 kg-1. The calculation is mathematically + !! integrals [m3 kg-1]. The calculation is mathematically !! identical with different values of alpha_ref, but alpha_ref !! alters the effects of roundoff, and answers do change. real, intent(in) :: dP_neglect !< A miniscule pressure change with @@ -2161,7 +2143,7 @@ subroutine int_spec_vol_dp_generic_plm(T_t, T_b, S_t, S_b, p_t, p_b, alpha_ref, real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & optional, intent(out) :: intp_dza !< The integral in pressure through the !! layer of the geopotential anomaly relative to the anomaly - !! at the bottom of the layer, in Pa m2 s-2. + !! at the bottom of the layer [Pa m2 s-2]. real, dimension(HI%IsdB:HI%IedB,HI%jsd:HI%jed), & optional, intent(out) :: intx_dza !< The integral in x of the difference !! between the geopotential anomaly at the top and bottom of @@ -2185,12 +2167,12 @@ subroutine int_spec_vol_dp_generic_plm(T_t, T_b, S_t, S_b, p_t, p_b, alpha_ref, real :: wt_t(5), wt_b(5) real :: T_top, T_bot, S_top, S_bot, P_top, P_bot - real :: alpha_anom ! The depth averaged specific density anomaly in m3 kg-1. + real :: alpha_anom ! The depth averaged specific density anomaly [m3 kg-1]. real :: dp ! The pressure change through a layer [Pa]. real :: dp_90(2:4) ! The pressure change through a layer divided by 90 [Pa]. real :: hWght ! A pressure-thickness below topography [Pa]. real :: hL, hR ! Pressure-thicknesses of the columns to the left and right [Pa]. - real :: iDenom ! The inverse of the denominator in the weights, in Pa-2. + real :: iDenom ! The inverse of the denominator in the weights [Pa-2]. real :: hWt_LL, hWt_LR ! hWt_LA is the weighted influence of A on the left column [nondim]. real :: hWt_RL, hWt_RR ! hWt_RA is the weighted influence of A on the right column [nondim]. real :: wt_L, wt_R ! The linear weights of the left and right columns [nondim]. @@ -2360,10 +2342,10 @@ subroutine convert_temp_salt_for_TEOS10(T, S, press, G, kd, mask_z, EOS) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure real, dimension(SZI_(G),SZJ_(G), SZK_(G)), & - intent(inout) :: T !< Potential temperature referenced to the surface (degC) + intent(inout) :: T !< Potential temperature referenced to the surface [degC] real, dimension(SZI_(G),SZJ_(G), SZK_(G)), & - intent(inout) :: S !< Salinity (PSU) - real, dimension(:), intent(in) :: press !< Pressure at the top of the layer in Pa. + intent(inout) :: S !< Salinity [ppt] + real, dimension(:), intent(in) :: press !< Pressure at the top of the layer [Pa]. type(EOS_type), pointer :: EOS !< Equation of state structure real, dimension(SZI_(G),SZJ_(G), SZK_(G)), & intent(in) :: mask_z !< 3d mask regulating which points to convert. @@ -2398,11 +2380,11 @@ subroutine extract_member_EOS(EOS, form_of_EOS, form_of_TFreeze, EOS_quadrature, logical, optional, intent(out) :: EOS_quadrature !< If true, always use the generic (quadrature) !! code for the integrals of density. logical, optional, intent(out) :: Compressible !< If true, in situ density is a function of pressure. - real , optional, intent(out) :: Rho_T0_S0 !< Density at T=0 degC and S=0 ppt (kg m-3) + real , optional, intent(out) :: Rho_T0_S0 !< Density at T=0 degC and S=0 ppt [kg m-3] real , optional, intent(out) :: drho_dT !< Partial derivative of density with temperature - !! in (kg m-3 degC-1) + !! in [kg m-3 degC-1] real , optional, intent(out) :: dRho_dS !< Partial derivative of density with salinity - !! in (kg m-3 ppt-1) + !! in [kg m-3 ppt-1] real , optional, intent(out) :: TFr_S0_P0 !< The freezing potential temperature at S=0, P=0 in deg C. real , optional, intent(out) :: dTFr_dS !< The derivative of freezing point with salinity, !! in deg C PSU-1. diff --git a/src/equation_of_state/MOM_EOS_NEMO.F90 b/src/equation_of_state/MOM_EOS_NEMO.F90 index fcc005ca61..97ed9f8540 100644 --- a/src/equation_of_state/MOM_EOS_NEMO.F90 +++ b/src/equation_of_state/MOM_EOS_NEMO.F90 @@ -24,7 +24,7 @@ module MOM_EOS_NEMO !> Compute the in situ density of sea water ([kg m-3]), or its anomaly with respect to !! a reference density, from absolute salinity (g/kg), conservative temperature (in deg C), -!! and pressure in Pa, using the expressions derived for use with NEMO +!! and pressure [Pa], using the expressions derived for use with NEMO interface calculate_density_nemo module procedure calculate_density_scalar_nemo, calculate_density_array_nemo end interface calculate_density_nemo @@ -175,14 +175,14 @@ module MOM_EOS_NEMO !> This subroutine computes the in situ density of sea water (rho in !! [kg m-3]) from absolute salinity (S [g kg-1]), conservative temperature -!! (T [degC]), and pressure in Pa. It uses the expressions derived for use +!! (T [degC]), and pressure [Pa]. It uses the expressions derived for use !! with NEMO. subroutine calculate_density_scalar_nemo(T, S, pressure, rho, rho_ref) - real, intent(in) :: T !< Conservative temperature in C. - real, intent(in) :: S !< Absolute salinity in g/kg. - real, intent(in) :: pressure !< Pressure in Pa. - real, intent(out) :: rho !< In situ density in kg m-3. - real, optional, intent(in) :: rho_ref !< A reference density in kg m-3. + real, intent(in) :: T !< Conservative temperature [degC]. + real, intent(in) :: S !< Absolute salinity [g kg-1]. + real, intent(in) :: pressure !< pressure [Pa]. + real, intent(out) :: rho !< In situ density [kg m-3]. + real, optional, intent(in) :: rho_ref !< A reference density [kg m-3]. real :: al0, p0, lambda integer :: j @@ -200,16 +200,16 @@ end subroutine calculate_density_scalar_nemo !> This subroutine computes the in situ density of sea water (rho in !! [kg m-3]) from absolute salinity (S [g kg-1]), conservative temperature -!! (T [degC]), and pressure in Pa. It uses the expressions derived for use +!! (T [degC]), and pressure [Pa]. It uses the expressions derived for use !! with NEMO. subroutine calculate_density_array_nemo(T, S, pressure, rho, start, npts, rho_ref) - real, dimension(:), intent(in) :: T !< Conservative temperature in C. - real, dimension(:), intent(in) :: S !< Absolute salinity in g/kg - real, dimension(:), intent(in) :: pressure !< pressure in Pa. - real, dimension(:), intent(out) :: rho !< in situ density in kg m-3. + real, dimension(:), intent(in) :: T !< Conservative temperature [degC]. + real, dimension(:), intent(in) :: S !< Absolute salinity [g kg-1]. + real, dimension(:), intent(in) :: pressure !< pressure [Pa]. + real, dimension(:), intent(out) :: rho !< in situ density [kg m-3]. integer, intent(in) :: start !< the starting point in the arrays. integer, intent(in) :: npts !< the number of values to calculate. - real, optional, intent(in) :: rho_ref !< A reference density in kg m-3. + real, optional, intent(in) :: rho_ref !< A reference density [kg m-3]. ! Local variables real :: zp, zt, zh, zs, zr0, zn, zn0, zn1, zn2, zn3, zs0 @@ -265,13 +265,13 @@ end subroutine calculate_density_array_nemo !> For a given thermodynamic state, calculate the derivatives of density with conservative !! temperature and absolute salinity, using the expressions derived for use with NEMO. subroutine calculate_density_derivs_array_nemo(T, S, pressure, drho_dT, drho_dS, start, npts) - real, intent(in), dimension(:) :: T !< Conservative temperature in C. - real, intent(in), dimension(:) :: S !< Absolute salinity in g/kg. - real, intent(in), dimension(:) :: pressure !< Pressure in Pa. + real, intent(in), dimension(:) :: T !< Conservative temperature [degC]. + real, intent(in), dimension(:) :: S !< Absolute salinity [g kg-1]. + real, intent(in), dimension(:) :: pressure !< pressure [Pa]. real, intent(out), dimension(:) :: drho_dT !< The partial derivative of density with potential - !! temperature, in kg m-3 K-1. + !! temperature [kg m-3 degC-1]. real, intent(out), dimension(:) :: drho_dS !< The partial derivative of density with salinity, - !! in kg m-3 psu-1. + !! in [kg m-3 ppt-1]. integer, intent(in) :: start !< The starting point in the arrays. integer, intent(in) :: npts !< The number of values to calculate. @@ -339,13 +339,13 @@ end subroutine calculate_density_derivs_array_nemo !> Wrapper to calculate_density_derivs_array for scalar inputs subroutine calculate_density_derivs_scalar_nemo(T, S, pressure, drho_dt, drho_ds) - real, intent(in) :: T !< Potential temperature relative to the surface in degC. - real, intent(in) :: S !< Salinity in PSU. - real, intent(in) :: pressure !< Pressure in Pa. + real, intent(in) :: T !< Potential temperature relative to the surface [degC]. + real, intent(in) :: S !< Salinity [g kg-1]. + real, intent(in) :: pressure !< Pressure [Pa]. real, intent(out) :: drho_dT !< The partial derivative of density with potential - !! temperature, in kg m-3 K-1. + !! temperature [kg m-3 degC-1]. real, intent(out) :: drho_dS !< The partial derivative of density with salinity, - !! in kg m-3 psu-1. + !! in [kg m-3 ppt-1]. ! Local variables real :: al0, p0, lambda integer :: j @@ -363,16 +363,16 @@ end subroutine calculate_density_derivs_scalar_nemo !> Compute the in situ density of sea water (rho in [kg m-3]) and the compressibility !! (drho/dp = C_sound^-2, stored as drho_dp [s2 m-2]) from absolute salinity -!! (sal in g/kg), conservative temperature (T [degC]), and pressure in Pa, using the expressions +!! (sal in g/kg), conservative temperature (T [degC]), and pressure [Pa], using the expressions !! derived for use with NEMO. subroutine calculate_compress_nemo(T, S, pressure, rho, drho_dp, start, npts) - real, intent(in), dimension(:) :: T !< Conservative temperature in C. - real, intent(in), dimension(:) :: S !< Absolute salinity in g/kg. - real, intent(in), dimension(:) :: pressure !< Pressure in Pa. - real, intent(out), dimension(:) :: rho !< In situ density in kg m-3. + real, intent(in), dimension(:) :: T !< Conservative temperature [degC]. + real, intent(in), dimension(:) :: S !< Absolute salinity [g/kg]. + real, intent(in), dimension(:) :: pressure !< pressure [Pa]. + real, intent(out), dimension(:) :: rho !< In situ density [kg m-3]. real, intent(out), dimension(:) :: drho_dp !< The partial derivative of density with pressure !! (also the inverse of the square of sound speed) - !! in s2 m-2. + !! [s2 m-2]. integer, intent(in) :: start !< The starting point in the arrays. integer, intent(in) :: npts !< The number of values to calculate. diff --git a/src/equation_of_state/MOM_EOS_TEOS10.F90 b/src/equation_of_state/MOM_EOS_TEOS10.F90 index 813a51307e..7c148443a5 100644 --- a/src/equation_of_state/MOM_EOS_TEOS10.F90 +++ b/src/equation_of_state/MOM_EOS_TEOS10.F90 @@ -24,14 +24,14 @@ module MOM_EOS_TEOS10 !> Compute the in situ density of sea water ([kg m-3]), or its anomaly with respect to !! a reference density, from absolute salinity (g/kg), conservative temperature (in deg C), -!! and pressure in Pa, using the TEOS10 expressions. +!! and pressure [Pa], using the TEOS10 expressions. interface calculate_density_teos10 module procedure calculate_density_scalar_teos10, calculate_density_array_teos10 end interface calculate_density_teos10 !> Compute the in situ specific volume of sea water (in [m3 kg-1]), or an anomaly with respect !! to a reference specific volume, from absolute salinity (in g/kg), conservative temperature -!! (in deg C), and pressure in Pa, using the TEOS10 expressions. +!! (in deg C), and pressure [Pa], using the TEOS10 expressions. interface calculate_spec_vol_teos10 module procedure calculate_spec_vol_scalar_teos10, calculate_spec_vol_array_teos10 end interface calculate_spec_vol_teos10 @@ -54,14 +54,14 @@ module MOM_EOS_TEOS10 !> This subroutine computes the in situ density of sea water (rho in !! [kg m-3]) from absolute salinity (S [g kg-1]), conservative temperature -!! (T [degC]), and pressure in Pa. It uses the expression from the +!! (T [degC]), and pressure [Pa]. It uses the expression from the !! TEOS10 website. subroutine calculate_density_scalar_teos10(T, S, pressure, rho, rho_ref) - real, intent(in) :: T !< Conservative temperature in C. - real, intent(in) :: S !< Absolute salinity in g/kg. - real, intent(in) :: pressure !< Pressure in Pa. - real, intent(out) :: rho !< In situ density in kg m-3. - real, optional, intent(in) :: rho_ref !< A reference density in kg m-3. + real, intent(in) :: T !< Conservative temperature [degC]. + real, intent(in) :: S !< Absolute salinity [g kg-1]. + real, intent(in) :: pressure !< pressure [Pa]. + real, intent(out) :: rho !< In situ density [kg m-3]. + real, optional, intent(in) :: rho_ref !< A reference density [kg m-3]. ! Local variables real, dimension(1) :: T0, S0, pressure0 @@ -78,16 +78,16 @@ end subroutine calculate_density_scalar_teos10 !> This subroutine computes the in situ density of sea water (rho in !! [kg m-3]) from absolute salinity (S [g kg-1]), conservative temperature -!! (T [degC]), and pressure in Pa. It uses the expression from the +!! (T [degC]), and pressure [Pa]. It uses the expression from the !! TEOS10 website. subroutine calculate_density_array_teos10(T, S, pressure, rho, start, npts, rho_ref) - real, dimension(:), intent(in) :: T !< Conservative temperature in C. - real, dimension(:), intent(in) :: S !< Absolute salinity in g/kg - real, dimension(:), intent(in) :: pressure !< pressure in Pa. - real, dimension(:), intent(out) :: rho !< in situ density in kg m-3. + real, dimension(:), intent(in) :: T !< Conservative temperature [degC]. + real, dimension(:), intent(in) :: S !< Absolute salinity [g kg-1] + real, dimension(:), intent(in) :: pressure !< pressure [Pa]. + real, dimension(:), intent(out) :: rho !< in situ density [kg m-3]. integer, intent(in) :: start !< the starting point in the arrays. integer, intent(in) :: npts !< the number of values to calculate. - real, optional, intent(in) :: rho_ref !< A reference density in kg m-3. + real, optional, intent(in) :: rho_ref !< A reference density [kg m-3]. ! Local variables real :: zs, zt, zp @@ -110,14 +110,14 @@ end subroutine calculate_density_array_teos10 !> This subroutine computes the in situ specific volume of sea water (specvol in !! [m3 kg-1]) from absolute salinity (S [g kg-1]), conservative temperature (T [degC]) -!! and pressure in Pa, using the TEOS10 equation of state. +!! and pressure [Pa], using the TEOS10 equation of state. !! If spv_ref is present, specvol is an anomaly from spv_ref. subroutine calculate_spec_vol_scalar_teos10(T, S, pressure, specvol, spv_ref) - real, intent(in) :: T !< Conservative temperature in C. - real, intent(in) :: S !< Absolute salinity in g/kg - real, intent(in) :: pressure !< pressure in Pa. - real, intent(out) :: specvol !< in situ specific volume in m3 kg-1. - real, optional, intent(in) :: spv_ref !< A reference specific volume in m3 kg-1. + real, intent(in) :: T !< Conservative temperature [degC]. + real, intent(in) :: S !< Absolute salinity [g kg-1] + real, intent(in) :: pressure !< pressure [Pa]. + real, intent(out) :: specvol !< in situ specific volume [m3 kg-1]. + real, optional, intent(in) :: spv_ref !< A reference specific volume [m3 kg-1]. ! Local variables real, dimension(1) :: T0, S0, pressure0, spv0 @@ -131,17 +131,17 @@ end subroutine calculate_spec_vol_scalar_teos10 !> This subroutine computes the in situ specific volume of sea water (specvol in !! [m3 kg-1]) from absolute salinity (S [g kg-1]), conservative temperature (T [degC]) -!! and pressure in Pa, using the TEOS10 equation of state. +!! and pressure [Pa], using the TEOS10 equation of state. !! If spv_ref is present, specvol is an anomaly from spv_ref. subroutine calculate_spec_vol_array_teos10(T, S, pressure, specvol, start, npts, spv_ref) real, dimension(:), intent(in) :: T !< Conservative temperature relative to the surface - !! in C. - real, dimension(:), intent(in) :: S !< salinity in g/kg. - real, dimension(:), intent(in) :: pressure !< pressure in Pa. - real, dimension(:), intent(out) :: specvol !< in situ specific volume in m3 kg-1. + !! [degC]. + real, dimension(:), intent(in) :: S !< salinity [g kg-1]. + real, dimension(:), intent(in) :: pressure !< pressure [Pa]. + real, dimension(:), intent(out) :: specvol !< in situ specific volume [m3 kg-1]. integer, intent(in) :: start !< the starting point in the arrays. integer, intent(in) :: npts !< the number of values to calculate. - real, optional, intent(in) :: spv_ref !< A reference specific volume in m3 kg-1. + real, optional, intent(in) :: spv_ref !< A reference specific volume [m3 kg-1]. ! Local variables real :: zs, zt, zp @@ -166,11 +166,11 @@ end subroutine calculate_spec_vol_array_teos10 !> For a given thermodynamic state, calculate the derivatives of density with conservative !! temperature and absolute salinity, using the TEOS10 expressions. subroutine calculate_density_derivs_array_teos10(T, S, pressure, drho_dT, drho_dS, start, npts) - real, intent(in), dimension(:) :: T !< Conservative temperature in C. - real, intent(in), dimension(:) :: S !< Absolute salinity in g/kg. - real, intent(in), dimension(:) :: pressure !< Pressure in Pa. + real, intent(in), dimension(:) :: T !< Conservative temperature [degC]. + real, intent(in), dimension(:) :: S !< Absolute salinity [g kg-1]. + real, intent(in), dimension(:) :: pressure !< pressure [Pa]. real, intent(out), dimension(:) :: drho_dT !< The partial derivative of density with conservative - !! temperature, in kg m-3 K-1. + !! temperature [kg m-3 degC-1]. real, intent(out), dimension(:) :: drho_dS !< The partial derivative of density with absolute salinity, !! in kg m-3 (g/kg)-1. integer, intent(in) :: start !< The starting point in the arrays. @@ -197,11 +197,11 @@ end subroutine calculate_density_derivs_array_teos10 !> For a given thermodynamic state, calculate the derivatives of density with conservative !! temperature and absolute salinity, using the TEOS10 expressions. subroutine calculate_density_derivs_scalar_teos10(T, S, pressure, drho_dT, drho_dS) - real, intent(in) :: T !< Conservative temperature in C - real, intent(in) :: S !< Absolute Salinity in g/kg - real, intent(in) :: pressure !< Pressure in Pa. + real, intent(in) :: T !< Conservative temperature [degC] + real, intent(in) :: S !< Absolute Salinity [g kg-1] + real, intent(in) :: pressure !< pressure [Pa]. real, intent(out) :: drho_dT !< The partial derivative of density with conservative - !! temperature, in kg m-3 K-1. + !! temperature [kg m-3 degC-1]. real, intent(out) :: drho_dS !< The partial derivative of density with absolute salinity, !! in kg m-3 (g/kg)-1. @@ -218,9 +218,9 @@ end subroutine calculate_density_derivs_scalar_teos10 !> For a given thermodynamic state, calculate the derivatives of specific volume with conservative !! temperature and absolute salinity, using the TEOS10 expressions. subroutine calculate_specvol_derivs_teos10(T, S, pressure, dSV_dT, dSV_dS, start, npts) - real, intent(in), dimension(:) :: T !< Conservative temperature in C. - real, intent(in), dimension(:) :: S !< Absolute salinity in g/kg. - real, intent(in), dimension(:) :: pressure !< Pressure in Pa. + real, intent(in), dimension(:) :: T !< Conservative temperature [degC]. + real, intent(in), dimension(:) :: S !< Absolute salinity [g kg-1]. + real, intent(in), dimension(:) :: pressure !< pressure [Pa]. real, intent(out), dimension(:) :: dSV_dT !< The partial derivative of specific volume with !! conservative temperature, in m3 kg-1 K-1. real, intent(out), dimension(:) :: dSV_dS !< The partial derivative of specific volume with @@ -249,9 +249,9 @@ end subroutine calculate_specvol_derivs_teos10 !> Calculate the 5 second derivatives of the equation of state for scalar inputs subroutine calculate_density_second_derivs_scalar_teos10(T, S, pressure, drho_dS_dS, drho_dS_dT, & drho_dT_dT, drho_dS_dP, drho_dT_dP) - real, intent(in) :: T !< Conservative temperature in C - real, intent(in) :: S !< Absolute Salinity in g/kg - real, intent(in) :: pressure !< Pressure in Pa. + real, intent(in) :: T !< Conservative temperature [degC] + real, intent(in) :: S !< Absolute Salinity [g kg-1] + real, intent(in) :: pressure !< pressure [Pa]. real, intent(out) :: drho_dS_dS !< Partial derivative of beta with respect to S real, intent(out) :: drho_dS_dT !< Partial derivative of beta with resepct to T real, intent(out) :: drho_dT_dT !< Partial derivative of alpha with respect to T @@ -274,9 +274,9 @@ end subroutine calculate_density_second_derivs_scalar_teos10 !> Calculate the 5 second derivatives of the equation of state for scalar inputs subroutine calculate_density_second_derivs_array_teos10(T, S, pressure, drho_dS_dS, drho_dS_dT, & drho_dT_dT, drho_dS_dP, drho_dT_dP, start, npts) - real, dimension(:), intent(in) :: T !< Conservative temperature in C - real, dimension(:), intent(in) :: S !< Absolute Salinity in g/kg - real, dimension(:), intent(in) :: pressure !< Pressure in Pa. + real, dimension(:), intent(in) :: T !< Conservative temperature [degC] + real, dimension(:), intent(in) :: S !< Absolute Salinity [g kg-1] + real, dimension(:), intent(in) :: pressure !< pressure [Pa]. real, dimension(:), intent(out) :: drho_dS_dS !< Partial derivative of beta with respect to S real, dimension(:), intent(out) :: drho_dS_dT !< Partial derivative of beta with resepct to T real, dimension(:), intent(out) :: drho_dT_dT !< Partial derivative of alpha with respect to T @@ -308,16 +308,16 @@ end subroutine calculate_density_second_derivs_array_teos10 !> This subroutine computes the in situ density of sea water (rho in !! [kg m-3]) and the compressibility (drho/dp = C_sound^-2) !! (drho_dp [s2 m-2]) from absolute salinity (sal in g/kg), -!! conservative temperature (T [degC]), and pressure in Pa. It uses the +!! conservative temperature (T [degC]), and pressure [Pa]. It uses the !! subroutines from TEOS10 website subroutine calculate_compress_teos10(T, S, pressure, rho, drho_dp, start, npts) - real, intent(in), dimension(:) :: T !< Conservative temperature in C. - real, intent(in), dimension(:) :: S !< Absolute salinity in g/kg. - real, intent(in), dimension(:) :: pressure !< Pressure in Pa. - real, intent(out), dimension(:) :: rho !< In situ density in kg m-3. + real, intent(in), dimension(:) :: T !< Conservative temperature [degC]. + real, intent(in), dimension(:) :: S !< Absolute salinity [g kg-1]. + real, intent(in), dimension(:) :: pressure !< Pressure [Pa]. + real, intent(out), dimension(:) :: rho !< In situ density [kg m-3]. real, intent(out), dimension(:) :: drho_dp !< The partial derivative of density with pressure !! (also the inverse of the square of sound speed) - !! in s2 m-2. + !! [s2 m-2]. integer, intent(in) :: start !< The starting point in the arrays. integer, intent(in) :: npts !< The number of values to calculate. diff --git a/src/equation_of_state/MOM_EOS_UNESCO.F90 b/src/equation_of_state/MOM_EOS_UNESCO.F90 index 2b6c5469ee..1d3450d871 100644 --- a/src/equation_of_state/MOM_EOS_UNESCO.F90 +++ b/src/equation_of_state/MOM_EOS_UNESCO.F90 @@ -57,11 +57,11 @@ module MOM_EOS_UNESCO !! [kg m-3]) from salinity (S [PSU]), potential temperature !! (T [degC]), and pressure in Pa, using the UNESCO (1981) equation of state. subroutine calculate_density_scalar_UNESCO(T, S, pressure, rho, rho_ref) - real, intent(in) :: T !< Potential temperature relative to the surface in C. - real, intent(in) :: S !< Salinity in PSU. - real, intent(in) :: pressure !< Pressure in Pa. - real, intent(out) :: rho !< In situ density in kg m-3. - real, optional, intent(in) :: rho_ref !< A reference density in kg m-3. + real, intent(in) :: T !< Potential temperature relative to the surface [degC]. + real, intent(in) :: S !< Salinity [PSU]. + real, intent(in) :: pressure !< pressure [Pa]. + real, intent(out) :: rho !< In situ density [kg m-3]. + real, optional, intent(in) :: rho_ref !< A reference density [kg m-3]. ! Local variables real, dimension(1) :: T0, S0, pressure0 @@ -80,21 +80,21 @@ end subroutine calculate_density_scalar_UNESCO !! [kg m-3]) from salinity (S [PSU]), potential temperature !! (T [degC]), and pressure in Pa, using the UNESCO (1981) equation of state. subroutine calculate_density_array_UNESCO(T, S, pressure, rho, start, npts, rho_ref) - real, dimension(:), intent(in) :: T !< potential temperature relative to the surface in C. - real, dimension(:), intent(in) :: S !< salinity in PSU. - real, dimension(:), intent(in) :: pressure !< pressure in Pa. - real, dimension(:), intent(out) :: rho !< in situ density in kg m-3. + real, dimension(:), intent(in) :: T !< potential temperature relative to the surface [degC]. + real, dimension(:), intent(in) :: S !< salinity [PSU]. + real, dimension(:), intent(in) :: pressure !< pressure [Pa]. + real, dimension(:), intent(out) :: rho !< in situ density [kg m-3]. integer, intent(in) :: start !< the starting point in the arrays. integer, intent(in) :: npts !< the number of values to calculate. - real, optional, intent(in) :: rho_ref !< A reference density in kg m-3. + real, optional, intent(in) :: rho_ref !< A reference density [kg m-3]. ! Local variables - real :: t_local, t2, t3, t4, t5 ! Temperature to the 1st - 5th power. - real :: s_local, s32, s2 ! Salinity to the 1st, 3/2, & 2nd power. - real :: p1, p2 ! Pressure (in bars) to the 1st and 2nd power. + real :: t_local, t2, t3, t4, t5 ! Temperature to the 1st - 5th power [degC^n]. + real :: s_local, s32, s2 ! Salinity to the 1st, 3/2, & 2nd power [PSU^n]. + real :: p1, p2 ! Pressure (in bars) to the 1st and 2nd power [bar] and [bar2]. real :: rho0 ! Density at 1 bar pressure [kg m-3]. real :: sig0 ! The anomaly of rho0 from R00 [kg m-3]. - real :: ks ! The secant bulk modulus in bar. + real :: ks ! The secant bulk modulus [bar]. integer :: j do j=start,start+npts-1 @@ -136,11 +136,11 @@ end subroutine calculate_density_array_UNESCO !! If spv_ref is present, specvol is an anomaly from spv_ref. subroutine calculate_spec_vol_scalar_UNESCO(T, S, pressure, specvol, spv_ref) real, intent(in) :: T !< potential temperature relative to the surface - !! in C. - real, intent(in) :: S !< salinity in PSU. - real, intent(in) :: pressure !< pressure in Pa. - real, intent(out) :: specvol !< in situ specific volume in m3 kg-1. - real, optional, intent(in) :: spv_ref !< A reference specific volume in m3 kg-1. + !! [degC]. + real, intent(in) :: S !< salinity [PSU]. + real, intent(in) :: pressure !< pressure [Pa]. + real, intent(out) :: specvol !< in situ specific volume [m3 kg-1]. + real, optional, intent(in) :: spv_ref !< A reference specific volume [m3 kg-1]. ! Local variables real, dimension(1) :: T0, S0, pressure0, spv0 @@ -157,20 +157,20 @@ end subroutine calculate_spec_vol_scalar_UNESCO !! If spv_ref is present, specvol is an anomaly from spv_ref. subroutine calculate_spec_vol_array_UNESCO(T, S, pressure, specvol, start, npts, spv_ref) real, dimension(:), intent(in) :: T !< potential temperature relative to the surface - !! in C. - real, dimension(:), intent(in) :: S !< salinity in PSU. - real, dimension(:), intent(in) :: pressure !< pressure in Pa. - real, dimension(:), intent(out) :: specvol !< in situ specific volume in m3 kg-1. + !! [degC]. + real, dimension(:), intent(in) :: S !< salinity [PSU]. + real, dimension(:), intent(in) :: pressure !< pressure [Pa]. + real, dimension(:), intent(out) :: specvol !< in situ specific volume [m3 kg-1]. integer, intent(in) :: start !< the starting point in the arrays. integer, intent(in) :: npts !< the number of values to calculate. - real, optional, intent(in) :: spv_ref !< A reference specific volume in m3 kg-1. + real, optional, intent(in) :: spv_ref !< A reference specific volume [m3 kg-1]. ! Local variables - real :: t_local, t2, t3, t4, t5; ! Temperature to the 1st - 5th power. - real :: s_local, s32, s2; ! Salinity to the 1st, 3/2, & 2nd power. - real :: p1, p2; ! Pressure (in bars) to the 1st and 2nd power. - real :: rho0; ! Density at 1 bar pressure [kg m-3]. - real :: ks; ! The secant bulk modulus in bar. + real :: t_local, t2, t3, t4, t5 ! Temperature to the 1st - 5th power [degC^n]. + real :: s_local, s32, s2 ! Salinity to the 1st, 3/2, & 2nd power [PSU^n]. + real :: p1, p2 ! Pressure (in bars) to the 1st and 2nd power [bar] and [bar2]. + real :: rho0 ! Density at 1 bar pressure [kg m-3]. + real :: ks ! The secant bulk modulus [bar]. integer :: j do j=start,start+npts-1 @@ -211,27 +211,27 @@ end subroutine calculate_spec_vol_array_UNESCO !! with potential temperature and salinity. subroutine calculate_density_derivs_UNESCO(T, S, pressure, drho_dT, drho_dS, start, npts) real, intent(in), dimension(:) :: T !< Potential temperature relative to the surface - !! in C. - real, intent(in), dimension(:) :: S !< Salinity in PSU. - real, intent(in), dimension(:) :: pressure !< Pressure in Pa. + !! [degC]. + real, intent(in), dimension(:) :: S !< Salinity [PSU]. + real, intent(in), dimension(:) :: pressure !< Pressure [Pa]. real, intent(out), dimension(:) :: drho_dT !< The partial derivative of density with potential - !! temperature, in kg m-3 K-1. + !! temperature [kg m-3 degC-1]. real, intent(out), dimension(:) :: drho_dS !< The partial derivative of density with salinity, - !! in kg m-3 psu-1. + !! in [kg m-3 PSU-1]. integer, intent(in) :: start !< The starting point in the arrays. integer, intent(in) :: npts !< The number of values to calculate. ! Local variables - real :: t_local, t2, t3, t4, t5; ! Temperature to the 1st - 5th power. - real :: s12, s_local, s32, s2; ! Salinity to the 1/2 - 2nd powers. - real :: p1, p2; ! Pressure (in bars) to the 1st & 2nd power. - real :: rho0; ! Density at 1 bar pressure [kg m-3]. - real :: ks; ! The secant bulk modulus, in bar. - real :: drho0_dT; ! Derivative of rho0 with T, in kg m-3 K-1. - real :: drho0_dS; ! Derivative of rho0 with S, kg m-3 psu-1. - real :: dks_dT; ! Derivative of ks with T, in bar K-1. - real :: dks_dS; ! Derivative of ks with S, in bar psu-1. - real :: denom; ! 1.0 / (ks - p1) in bar-1. + real :: t_local, t2, t3, t4, t5 ! Temperature to the 1st - 5th power [degC^n]. + real :: s12, s_local, s32, s2 ! Salinity to the 1/2 - 2nd powers [PSU^n]. + real :: p1, p2 ! Pressure to the 1st & 2nd power [bar] and [bar2]. + real :: rho0 ! Density at 1 bar pressure [kg m-3]. + real :: ks ! The secant bulk modulus [bar]. + real :: drho0_dT ! Derivative of rho0 with T [kg m-3 degC-1]. + real :: drho0_dS ! Derivative of rho0 with S [kg m-3 PSU-1]. + real :: dks_dT ! Derivative of ks with T [bar degC-1]. + real :: dks_dS ! Derivative of ks with S [bar psu-1]. + real :: denom ! 1.0 / (ks - p1) [bar-1]. integer :: j do j=start,start+npts-1 @@ -282,24 +282,24 @@ end subroutine calculate_density_derivs_UNESCO !! salinity, potential temperature, and pressure. subroutine calculate_compress_UNESCO(T, S, pressure, rho, drho_dp, start, npts) real, intent(in), dimension(:) :: T !< Potential temperature relative to the surface - !! in C. - real, intent(in), dimension(:) :: S !< Salinity in PSU. - real, intent(in), dimension(:) :: pressure !< Pressure in Pa. - real, intent(out), dimension(:) :: rho !< In situ density in kg m-3. + !! [degC]. + real, intent(in), dimension(:) :: S !< Salinity [PSU]. + real, intent(in), dimension(:) :: pressure !< Pressure [Pa]. + real, intent(out), dimension(:) :: rho !< In situ density [kg m-3]. real, intent(out), dimension(:) :: drho_dp !< The partial derivative of density with pressure !! (also the inverse of the square of sound speed) - !! in s2 m-2. + !! [s2 m-2]. integer, intent(in) :: start !< The starting point in the arrays. integer, intent(in) :: npts !< The number of values to calculate. ! Local variables - real :: t_local, t2, t3, t4, t5; ! Temperature to the 1st - 5th power. - real :: s_local, s32, s2; ! Salinity to the 1st, 3/2, & 2nd power. - real :: p1, p2; ! Pressure (in bars) to the 1st and 2nd power. - real :: rho0; ! Density at 1 bar pressure [kg m-3]. - real :: ks; ! The secant bulk modulus in bar. + real :: t_local, t2, t3, t4, t5 ! Temperature to the 1st - 5th power [degC^n]. + real :: s_local, s32, s2 ! Salinity to the 1st, 3/2, & 2nd power [PSU^n]. + real :: p1, p2 ! Pressure to the 1st & 2nd power [bar] and [bar2]. + real :: rho0 ! Density at 1 bar pressure [kg m-3]. + real :: ks ! The secant bulk modulus [bar]. real :: ks_0, ks_1, ks_2 - real :: dks_dp; ! The derivative of the secant bulk modulus + real :: dks_dp ! The derivative of the secant bulk modulus ! with pressure, nondimensional. integer :: j diff --git a/src/equation_of_state/MOM_EOS_Wright.F90 b/src/equation_of_state/MOM_EOS_Wright.F90 index ba1b7f436e..899f32b27d 100644 --- a/src/equation_of_state/MOM_EOS_Wright.F90 +++ b/src/equation_of_state/MOM_EOS_Wright.F90 @@ -27,7 +27,7 @@ module MOM_EOS_Wright !> Compute the in situ density of sea water (in [kg m-3]), or its anomaly with respect to -!! a reference density, from salinity (in psu), potential temperature (in deg C), and pressure in Pa, +!! a reference density, from salinity (in psu), potential temperature (in deg C), and pressure [Pa], !! using the expressions from Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740. interface calculate_density_wright module procedure calculate_density_scalar_wright, calculate_density_array_wright @@ -35,7 +35,7 @@ module MOM_EOS_Wright !> Compute the in situ specific volume of sea water (in [m3 kg-1]), or an anomaly with respect !! to a reference specific volume, from salinity (in psu), potential temperature (in deg C), and -!! pressure in Pa, using the expressions from Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740. +!! pressure [Pa], using the expressions from Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740. interface calculate_spec_vol_wright module procedure calculate_spec_vol_scalar_wright, calculate_spec_vol_array_wright end interface calculate_spec_vol_wright @@ -75,19 +75,19 @@ module MOM_EOS_Wright !> This subroutine computes the in situ density of sea water (rho in !! [kg m-3]) from salinity (S [PSU]), potential temperature -!! (T [degC]), and pressure in Pa. It uses the expression from +!! (T [degC]), and pressure [Pa]. It uses the expression from !! Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740. subroutine calculate_density_scalar_wright(T, S, pressure, rho, rho_ref) - real, intent(in) :: T !< Potential temperature relative to the surface in C. - real, intent(in) :: S !< Salinity in PSU. - real, intent(in) :: pressure !< Pressure in Pa. - real, intent(out) :: rho !< In situ density in kg m-3. - real, optional, intent(in) :: rho_ref !< A reference density in kg m-3. + real, intent(in) :: T !< Potential temperature relative to the surface [degC]. + real, intent(in) :: S !< Salinity [PSU]. + real, intent(in) :: pressure !< pressure [Pa]. + real, intent(out) :: rho !< In situ density [kg m-3]. + real, optional, intent(in) :: rho_ref !< A reference density [kg m-3]. ! *====================================================================* ! * This subroutine computes the in situ density of sea water (rho in * ! * [kg m-3]) from salinity (S [PSU]), potential temperature * -! * (T [degC]), and pressure in Pa. It uses the expression from * +! * (T [degC]), and pressure [Pa]. It uses the expression from * ! * Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740. * ! * Coded by R. Hallberg, 7/00 * ! *====================================================================* @@ -105,16 +105,16 @@ end subroutine calculate_density_scalar_wright !> This subroutine computes the in situ density of sea water (rho in !! [kg m-3]) from salinity (S [PSU]), potential temperature -!! (T [degC]), and pressure in Pa. It uses the expression from +!! (T [degC]), and pressure [Pa]. It uses the expression from !! Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740. subroutine calculate_density_array_wright(T, S, pressure, rho, start, npts, rho_ref) - real, dimension(:), intent(in) :: T !< potential temperature relative to the surface in C. - real, dimension(:), intent(in) :: S !< salinity in PSU. - real, dimension(:), intent(in) :: pressure !< pressure in Pa. - real, dimension(:), intent(out) :: rho !< in situ density in kg m-3. + real, dimension(:), intent(in) :: T !< potential temperature relative to the surface [degC]. + real, dimension(:), intent(in) :: S !< salinity [PSU]. + real, dimension(:), intent(in) :: pressure !< pressure [Pa]. + real, dimension(:), intent(out) :: rho !< in situ density [kg m-3]. integer, intent(in) :: start !< the starting point in the arrays. integer, intent(in) :: npts !< the number of values to calculate. - real, optional, intent(in) :: rho_ref !< A reference density in kg m-3. + real, optional, intent(in) :: rho_ref !< A reference density [kg m-3]. ! Original coded by R. Hallberg, 7/00, anomaly coded in 3/18. ! Local variables @@ -144,15 +144,15 @@ end subroutine calculate_density_array_wright !> This subroutine computes the in situ specific volume of sea water (specvol in !! [m3 kg-1]) from salinity (S [PSU]), potential temperature (T [degC]) -!! and pressure in Pa. It uses the expression from +!! and pressure [Pa]. It uses the expression from !! Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740. !! If spv_ref is present, specvol is an anomaly from spv_ref. subroutine calculate_spec_vol_scalar_wright(T, S, pressure, specvol, spv_ref) - real, intent(in) :: T !< potential temperature relative to the surface in C. - real, intent(in) :: S !< salinity in PSU. - real, intent(in) :: pressure !< pressure in Pa. - real, intent(out) :: specvol !< in situ specific volume in m3 kg-1. - real, optional, intent(in) :: spv_ref !< A reference specific volume in m3 kg-1. + real, intent(in) :: T !< potential temperature relative to the surface [degC]. + real, intent(in) :: S !< salinity [PSU]. + real, intent(in) :: pressure !< pressure [Pa]. + real, intent(out) :: specvol !< in situ specific volume [m3 kg-1]. + real, optional, intent(in) :: spv_ref !< A reference specific volume [m3 kg-1]. ! Local variables real, dimension(1) :: T0, S0, pressure0, spv0 @@ -165,18 +165,18 @@ end subroutine calculate_spec_vol_scalar_wright !> This subroutine computes the in situ specific volume of sea water (specvol in !! [m3 kg-1]) from salinity (S [PSU]), potential temperature (T [degC]) -!! and pressure in Pa. It uses the expression from +!! and pressure [Pa]. It uses the expression from !! Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740. !! If spv_ref is present, specvol is an anomaly from spv_ref. subroutine calculate_spec_vol_array_wright(T, S, pressure, specvol, start, npts, spv_ref) - real, dimension(:), intent(in) :: T !< potential temperature relative to the surface - !! in C. - real, dimension(:), intent(in) :: S !< salinity in PSU. - real, dimension(:), intent(in) :: pressure !< pressure in Pa. - real, dimension(:), intent(out) :: specvol !< in situ specific volume in m3 kg-1. + real, dimension(:), intent(in) :: T !< potential temperature relative to the + !! surface [degC]. + real, dimension(:), intent(in) :: S !< salinity [PSU]. + real, dimension(:), intent(in) :: pressure !< pressure [Pa]. + real, dimension(:), intent(out) :: specvol !< in situ specific volume [m3 kg-1]. integer, intent(in) :: start !< the starting point in the arrays. integer, intent(in) :: npts !< the number of values to calculate. - real, optional, intent(in) :: spv_ref !< A reference specific volume in m3 kg-1. + real, optional, intent(in) :: spv_ref !< A reference specific volume [m3 kg-1]. ! Local variables real :: al0, p0, lambda @@ -197,14 +197,14 @@ end subroutine calculate_spec_vol_array_wright !> For a given thermodynamic state, return the thermal/haline expansion coefficients subroutine calculate_density_derivs_array_wright(T, S, pressure, drho_dT, drho_dS, start, npts) - real, intent(in), dimension(:) :: T !< Potential temperature relative to the surface - !! in C. - real, intent(in), dimension(:) :: S !< Salinity in PSU. - real, intent(in), dimension(:) :: pressure !< Pressure in Pa. + real, intent(in), dimension(:) :: T !< Potential temperature relative to the + !! surface [degC]. + real, intent(in), dimension(:) :: S !< Salinity [PSU]. + real, intent(in), dimension(:) :: pressure !< pressure [Pa]. real, intent(out), dimension(:) :: drho_dT !< The partial derivative of density with potential - !! temperature, in kg m-3 K-1. + !! temperature [kg m-3 degC-1]. real, intent(out), dimension(:) :: drho_dS !< The partial derivative of density with salinity, - !! in kg m-3 psu-1. + !! in [kg m-3 PSU-1]. integer, intent(in) :: start !< The starting point in the arrays. integer, intent(in) :: npts !< The number of values to calculate. @@ -232,13 +232,13 @@ end subroutine calculate_density_derivs_array_wright !> The scalar version of calculate_density_derivs which promotes scalar inputs to a 1-element array and then !! demotes the output back to a scalar subroutine calculate_density_derivs_scalar_wright(T, S, pressure, drho_dT, drho_dS) - real, intent(in) :: T !< Potential temperature relative to the surface in C. - real, intent(in) :: S !< Salinity in PSU. - real, intent(in) :: pressure !< Pressure in Pa. + real, intent(in) :: T !< Potential temperature relative to the surface [degC]. + real, intent(in) :: S !< Salinity [PSU]. + real, intent(in) :: pressure !< pressure [Pa]. real, intent(out) :: drho_dT !< The partial derivative of density with potential - !! temperature, in kg m-3 K-1. + !! temperature [kg m-3 degC-1]. real, intent(out) :: drho_dS !< The partial derivative of density with salinity, - !! in kg m-3 psu-1. + !! in [kg m-3 PSU-1]. ! Local variables needed to promote the input/output scalars to 1-element arrays real, dimension(1) :: T0, S0, P0 @@ -256,14 +256,19 @@ end subroutine calculate_density_derivs_scalar_wright !> Second derivatives of density with respect to temperature, salinity, and pressure subroutine calculate_density_second_derivs_array_wright(T, S, P, drho_ds_ds, drho_ds_dt, drho_dt_dt, & drho_ds_dp, drho_dt_dp, start, npts) - real, dimension(:), intent(in ) :: T !< Potential temperature referenced to 0 dbar - real, dimension(:), intent(in ) :: S !< Salinity in PSU - real, dimension(:), intent(in ) :: P !< Pressure in Pa - real, dimension(:), intent( out) :: drho_ds_ds !< Partial derivative of beta with respect to S - real, dimension(:), intent( out) :: drho_ds_dt !< Partial derivative of beta with resepct to T - real, dimension(:), intent( out) :: drho_dt_dt !< Partial derivative of alpha with respect to T - real, dimension(:), intent( out) :: drho_ds_dp !< Partial derivative of beta with respect to pressure - real, dimension(:), intent( out) :: drho_dt_dp !< Partial derivative of alpha with respect to pressure + real, dimension(:), intent(in ) :: T !< Potential temperature referenced to 0 dbar [degC] + real, dimension(:), intent(in ) :: S !< Salinity [PSU] + real, dimension(:), intent(in ) :: P !< Pressure [Pa] + real, dimension(:), intent( out) :: drho_ds_ds !< Partial derivative of beta with respect + !! to S [kg m-3 PSU-2] + real, dimension(:), intent( out) :: drho_ds_dt !< Partial derivative of beta with respcct + !! to T [kg m-3 PSU-1 degC-1] + real, dimension(:), intent( out) :: drho_dt_dt !< Partial derivative of alpha with respect + !! to T [kg m-3 degC-2] + real, dimension(:), intent( out) :: drho_ds_dp !< Partial derivative of beta with respect + !! to pressure [kg m-3 PSU-1 Pa-1] + real, dimension(:), intent( out) :: drho_dt_dp !< Partial derivative of alpha with respect + !! to pressure [kg m-3 degC-1 Pa-1] integer, intent(in ) :: start !< Starting index in T,S,P integer, intent(in ) :: npts !< Number of points to loop over @@ -304,13 +309,18 @@ end subroutine calculate_density_second_derivs_array_wright subroutine calculate_density_second_derivs_scalar_wright(T, S, P, drho_ds_ds, drho_ds_dt, drho_dt_dt, & drho_ds_dp, drho_dt_dp) real, intent(in ) :: T !< Potential temperature referenced to 0 dbar - real, intent(in ) :: S !< Salinity in PSU - real, intent(in ) :: P !< Pressure in Pa - real, intent( out) :: drho_ds_ds !< Partial derivative of beta with respect to S - real, intent( out) :: drho_ds_dt !< Partial derivative of beta with resepct to T - real, intent( out) :: drho_dt_dt !< Partial derivative of alpha with respect to T - real, intent( out) :: drho_ds_dp !< Partial derivative of beta with respect to pressure - real, intent( out) :: drho_dt_dp !< Partial derivative of alpha with respect to pressure + real, intent(in ) :: S !< Salinity [PSU] + real, intent(in ) :: P !< pressure [Pa] + real, intent( out) :: drho_ds_ds !< Partial derivative of beta with respect + !! to S [kg m-3 PSU-2] + real, intent( out) :: drho_ds_dt !< Partial derivative of beta with respcct + !! to T [kg m-3 PSU-1 degC-1] + real, intent( out) :: drho_dt_dt !< Partial derivative of alpha with respect + !! to T [kg m-3 degC-2] + real, intent( out) :: drho_ds_dp !< Partial derivative of beta with respect + !! to pressure [kg m-3 PSU-1 Pa-1] + real, intent( out) :: drho_dt_dp !< Partial derivative of alpha with respect + !! to pressure [kg m-3 degC-1 Pa-1] ! Local variables real, dimension(1) :: T0, S0, P0 real, dimension(1) :: drdsds, drdsdt, drdtdt, drdsdp, drdtdp @@ -330,13 +340,13 @@ end subroutine calculate_density_second_derivs_scalar_wright !> For a given thermodynamic state, return the partial derivatives of specific volume !! with temperature and salinity subroutine calculate_specvol_derivs_wright(T, S, pressure, dSV_dT, dSV_dS, start, npts) - real, intent(in), dimension(:) :: T !< Potential temperature relative to the surface in C. - real, intent(in), dimension(:) :: S !< Salinity in g/kg. - real, intent(in), dimension(:) :: pressure !< Pressure in Pa. + real, intent(in), dimension(:) :: T !< Potential temperature relative to the surface [degC]. + real, intent(in), dimension(:) :: S !< Salinity [PSU]. + real, intent(in), dimension(:) :: pressure !< pressure [Pa]. real, intent(out), dimension(:) :: dSV_dT !< The partial derivative of specific volume with - !! potential temperature, in m3 kg-1 K-1. + !! potential temperature [m3 kg-1 degC-1]. real, intent(out), dimension(:) :: dSV_dS !< The partial derivative of specific volume with - !! salinity, in m3 kg-1 / (g/kg). + !! salinity [m3 kg-1 / Pa]. integer, intent(in) :: start !< The starting point in the arrays. integer, intent(in) :: npts !< The number of values to calculate. @@ -363,17 +373,17 @@ end subroutine calculate_specvol_derivs_wright !> This subroutine computes the in situ density of sea water (rho in !! [kg m-3]) and the compressibility (drho/dp = C_sound^-2) !! (drho_dp [s2 m-2]) from salinity (sal in psu), potential -!! temperature (T [degC]), and pressure in Pa. It uses the expressions +!! temperature (T [degC]), and pressure [Pa]. It uses the expressions !! from Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740. !! Coded by R. Hallberg, 1/01 subroutine calculate_compress_wright(T, S, pressure, rho, drho_dp, start, npts) - real, intent(in), dimension(:) :: T !< Potential temperature relative to the surface in C. - real, intent(in), dimension(:) :: S !< Salinity in PSU. - real, intent(in), dimension(:) :: pressure !< Pressure in Pa. - real, intent(out), dimension(:) :: rho !< In situ density in kg m-3. + real, intent(in), dimension(:) :: T !< Potential temperature relative to the surface [degC]. + real, intent(in), dimension(:) :: S !< Salinity [PSU]. + real, intent(in), dimension(:) :: pressure !< pressure [Pa]. + real, intent(out), dimension(:) :: rho !< In situ density [kg m-3]. real, intent(out), dimension(:) :: drho_dp !< The partial derivative of density with pressure !! (also the inverse of the square of sound speed) - !! in s2 m-2. + !! [s2 m-2]. integer, intent(in) :: start !< The starting point in the arrays. integer, intent(in) :: npts !< The number of values to calculate. @@ -403,17 +413,17 @@ subroutine int_density_dz_wright(T, S, z_t, z_b, rho_ref, rho_0, G_e, HII, HIO, type(hor_index_type), intent(in) :: HIO !< The horizontal index type for the output arrays. real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & intent(in) :: T !< Potential temperature relative to the surface - !! in C. + !! [degC]. real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & - intent(in) :: S !< Salinity in PSU. + intent(in) :: S !< Salinity [PSU]. real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & intent(in) :: z_t !< Height at the top of the layer in depth units [Z ~> m]. real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & intent(in) :: z_b !< Height at the top of the layer [Z ~> m]. - real, intent(in) :: rho_ref !< A mean density, in kg m-3, that is subtracted out + real, intent(in) :: rho_ref !< A mean density [kg m-3], that is subtracted out !! to reduce the magnitude of each of the integrals. !! (The pressure is calucated as p~=-z*rho_0*G_e.) - real, intent(in) :: rho_0 !< Density, in kg m-3, that is used to calculate the + real, intent(in) :: rho_0 !< Density [kg m-3], that is used to calculate the !! pressure (as p~=-z*rho_0*G_e) used in the !! equation of state. real, intent(in) :: G_e !< The Earth's gravitational acceleration [m2 Z-1 s-2 ~> m s-2]. @@ -423,7 +433,7 @@ subroutine int_density_dz_wright(T, S, z_t, z_b, rho_ref, rho_0, G_e, HII, HIO, real, dimension(HIO%isd:HIO%ied,HIO%jsd:HIO%jed), & optional, intent(out) :: intz_dpa !< The integral through the thickness of the layer !! of the pressure anomaly relative to the anomaly - !! at the top of the layer, in Pa Z. + !! at the top of the layer [Pa Z ~> Pa m]. real, dimension(HIO%IsdB:HIO%IedB,HIO%jsd:HIO%jed), & optional, intent(out) :: intx_dpa !< The integral in x of the difference between the !! pressure anomaly at the top and bottom of the @@ -448,7 +458,7 @@ subroutine int_density_dz_wright(T, S, z_t, z_b, rho_ref, rho_0, G_e, HII, HIO, real :: dz ! The layer thickness [Z ~> m]. real :: hWght ! A pressure-thickness below topography [Z ~> m]. real :: hL, hR ! Pressure-thicknesses of the columns to the left and right [Z ~> m]. - real :: iDenom ! The inverse of the denominator in the weights, in m-Z. + real :: iDenom ! The inverse of the denominator in the weights [Z-2 ~> m-2]. real :: hWt_LL, hWt_LR ! hWt_LA is the weighted influence of A on the left column [nondim]. real :: hWt_RL, hWt_RR ! hWt_RA is the weighted influence of A on the right column [nondim]. real :: wt_L, wt_R ! The linear weights of the left and right columns [nondim]. @@ -607,15 +617,15 @@ subroutine int_spec_vol_dp_wright(T, S, p_t, p_b, spv_ref, HI, dza, & type(hor_index_type), intent(in) :: HI !< The ocean's horizontal index type. real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & intent(in) :: T !< Potential temperature relative to the surface - !! in C. + !! [degC]. real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & - intent(in) :: S !< Salinity in PSU. + intent(in) :: S !< Salinity [PSU]. real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & - intent(in) :: p_t !< Pressure at the top of the layer in Pa. + intent(in) :: p_t !< Pressure at the top of the layer [Pa]. real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & - intent(in) :: p_b !< Pressure at the top of the layer in Pa. + intent(in) :: p_b !< Pressure at the top of the layer [Pa]. real, intent(in) :: spv_ref !< A mean specific volume that is subtracted out - !! to reduce the magnitude of each of the integrals, m3 kg-1.The calculation is + !! to reduce the magnitude of each of the integrals [m3 kg-1]. The calculation is !! mathematically identical with different values of spv_ref, but this reduces the !! effects of roundoff. real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & @@ -624,23 +634,21 @@ subroutine int_spec_vol_dp_wright(T, S, p_t, p_b, spv_ref, HI, dza, & real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & optional, intent(out) :: intp_dza !< The integral in pressure through the layer of !! the geopotential anomaly relative to the anomaly - !! at the bottom of the layer, in Pa m2 s-2. + !! at the bottom of the layer [Pa m2 s-2]. real, dimension(HI%IsdB:HI%IedB,HI%jsd:HI%jed), & optional, intent(out) :: intx_dza !< The integral in x of the difference between the !! geopotential anomaly at the top and bottom of - !! the layer divided by the x grid spacing, - !! in m2 s-2. + !! the layer divided by the x grid spacing [m2 s-2]. real, dimension(HI%isd:HI%ied,HI%JsdB:HI%JedB), & optional, intent(out) :: inty_dza !< The integral in y of the difference between the !! geopotential anomaly at the top and bottom of - !! the layer divided by the y grid spacing, - !! in m2 s-2. + !! the layer divided by the y grid spacing [m2 s-2]. integer, optional, intent(in) :: halo_size !< The width of halo points on which to calculate !! dza. real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & optional, intent(in) :: bathyP !< The pressure at the bathymetry [Pa] real, optional, intent(in) :: dP_neglect !< A miniscule pressure change with - !! the same units as p_t (Pa?) + !! the same units as p_t [Pa] logical, optional, intent(in) :: useMassWghtInterp !< If true, uses mass weighting !! to interpolate T/S for top and bottom integrals. @@ -649,11 +657,11 @@ subroutine int_spec_vol_dp_wright(T, S, p_t, p_b, spv_ref, HI, dza, & real :: al0, p0, lambda real :: p_ave real :: rem, eps, eps2 - real :: alpha_anom ! The depth averaged specific density anomaly in m3 kg-1. + real :: alpha_anom ! The depth averaged specific volume anomaly [m3 kg-1]. real :: dp ! The pressure change through a layer [Pa]. real :: hWght ! A pressure-thickness below topography [Pa]. real :: hL, hR ! Pressure-thicknesses of the columns to the left and right [Pa]. - real :: iDenom ! The inverse of the denominator in the weights, in Pa-2. + real :: iDenom ! The inverse of the denominator in the weights [Pa-2]. real :: hWt_LL, hWt_LR ! hWt_LA is the weighted influence of A on the left column [nondim]. real :: hWt_RL, hWt_RR ! hWt_RA is the weighted influence of A on the right column [nondim]. real :: wt_L, wt_R ! The linear weights of the left and right columns [nondim]. diff --git a/src/equation_of_state/MOM_EOS_linear.F90 b/src/equation_of_state/MOM_EOS_linear.F90 index 85fddc284e..a5e123ad4d 100644 --- a/src/equation_of_state/MOM_EOS_linear.F90 +++ b/src/equation_of_state/MOM_EOS_linear.F90 @@ -23,14 +23,14 @@ module MOM_EOS_linear !> Compute the density of sea water (in kg/m^3), or its anomaly from a reference density, !! using a simple linear equation of state from salinity (in psu), potential temperature (in deg C) -!! and pressure in Pa. +!! and pressure [Pa]. interface calculate_density_linear module procedure calculate_density_scalar_linear, calculate_density_array_linear end interface calculate_density_linear !> Compute the specific volume of sea water (in m^3/kg), or its anomaly from a reference value, !! using a simple linear equation of state from salinity (in psu), potential temperature (in deg C) -!! and pressure in Pa. +!! and pressure [Pa]. interface calculate_spec_vol_linear module procedure calculate_spec_vol_scalar_linear, calculate_spec_vol_array_linear end interface calculate_spec_vol_linear @@ -52,19 +52,19 @@ module MOM_EOS_linear !> This subroutine computes the density of sea water with a trivial !! linear equation of state (in kg m-3) from salinity (sal in PSU), -!! potential temperature (T [degC]), and pressure in Pa. +!! potential temperature (T [degC]), and pressure [Pa]. subroutine calculate_density_scalar_linear(T, S, pressure, rho, & Rho_T0_S0, dRho_dT, dRho_dS, rho_ref) - real, intent(in) :: T !< Potential temperature relative to the surface in C. - real, intent(in) :: S !< Salinity in PSU. - real, intent(in) :: pressure !< Pressure in Pa. - real, intent(out) :: rho !< In situ density in kg m-3. + real, intent(in) :: T !< Potential temperature relative to the surface [degC]. + real, intent(in) :: S !< Salinity [PSU]. + real, intent(in) :: pressure !< pressure [Pa]. + real, intent(out) :: rho !< In situ density [kg m-3]. real, intent(in) :: Rho_T0_S0 !< The density at T=0, S=0 [kg m-3]. real, intent(in) :: dRho_dT !< The derivatives of density with temperature - !! in kg m-3 C-1. + !! [kg m-3 degC-1]. real, intent(in) :: dRho_dS !< The derivatives of density with salinity - !! in kg m-3 psu-1. - real, optional, intent(in) :: rho_ref !< A reference density in kg m-3. + !! in [kg m-3 ppt-1]. + real, optional, intent(in) :: rho_ref !< A reference density [kg m-3]. if (present(rho_ref)) then rho = (Rho_T0_S0 - rho_ref) + (dRho_dT*T + dRho_dS*S) @@ -76,21 +76,21 @@ end subroutine calculate_density_scalar_linear !> This subroutine computes the density of sea water with a trivial !! linear equation of state (in kg/m^3) from salinity (sal in psu), -!! potential temperature (T [degC]), and pressure in Pa. +!! potential temperature (T [degC]), and pressure [Pa]. subroutine calculate_density_array_linear(T, S, pressure, rho, start, npts, & Rho_T0_S0, dRho_dT, dRho_dS, rho_ref) - real, dimension(:), intent(in) :: T !< potential temperature relative to the surface in C. - real, dimension(:), intent(in) :: S !< salinity in PSU. - real, dimension(:), intent(in) :: pressure !< pressure in Pa. - real, dimension(:), intent(out) :: rho !< in situ density in kg m-3. + real, dimension(:), intent(in) :: T !< potential temperature relative to the surface [degC]. + real, dimension(:), intent(in) :: S !< salinity [PSU]. + real, dimension(:), intent(in) :: pressure !< pressure [Pa]. + real, dimension(:), intent(out) :: rho !< in situ density [kg m-3]. integer, intent(in) :: start !< the starting point in the arrays. integer, intent(in) :: npts !< the number of values to calculate. real, intent(in) :: Rho_T0_S0 !< The density at T=0, S=0 [kg m-3]. real, intent(in) :: dRho_dT !< The derivatives of density with temperature - !! in kg m-3 C-1. + !! [kg m-3 degC-1]. real, intent(in) :: dRho_dS !< The derivatives of density with salinity - !! in kg m-3 psu-1. - real, optional, intent(in) :: rho_ref !< A reference density in kg m-3. + !! in [kg m-3 ppt-1]. + real, optional, intent(in) :: rho_ref !< A reference density [kg m-3]. ! Local variables integer :: j @@ -104,19 +104,19 @@ end subroutine calculate_density_array_linear !> This subroutine computes the in situ specific volume of sea water (specvol in !! [m3 kg-1]) from salinity (S [PSU]), potential temperature (T [degC]) -!! and pressure in Pa, using a trivial linear equation of state for density. +!! and pressure [Pa], using a trivial linear equation of state for density. !! If spv_ref is present, specvol is an anomaly from spv_ref. subroutine calculate_spec_vol_scalar_linear(T, S, pressure, specvol, & Rho_T0_S0, dRho_dT, dRho_dS, spv_ref) real, intent(in) :: T !< potential temperature relative to the surface - !! in C. - real, intent(in) :: S !< salinity in PSU. - real, intent(in) :: pressure !< pressure in Pa. - real, intent(out) :: specvol !< in situ specific volume in m3 kg-1. + !! [degC]. + real, intent(in) :: S !< Salinity [PSU]. + real, intent(in) :: pressure !< Pressure [Pa]. + real, intent(out) :: specvol !< In situ specific volume [m3 kg-1]. real, intent(in) :: Rho_T0_S0 !< The density at T=0, S=0 [kg m-3]. - real, intent(in) :: dRho_dT !< The derivatives of density with temperature in kg m-3 C-1. - real, intent(in) :: dRho_dS !< The derivatives of density with salinity in kg m-3 psu-1. - real, optional, intent(in) :: spv_ref !< A reference specific volume in m3 kg-1. + real, intent(in) :: dRho_dT !< The derivatives of density with temperature [kg m-3 degC-1]. + real, intent(in) :: dRho_dS !< The derivatives of density with salinity [kg m-3 ppt-1]. + real, optional, intent(in) :: spv_ref !< A reference specific volume [m3 kg-1]. ! Local variables integer :: j @@ -131,21 +131,21 @@ end subroutine calculate_spec_vol_scalar_linear !> This subroutine computes the in situ specific volume of sea water (specvol in !! [m3 kg-1]) from salinity (S [PSU]), potential temperature (T [degC]) -!! and pressure in Pa, using a trivial linear equation of state for density. +!! and pressure [Pa], using a trivial linear equation of state for density. !! If spv_ref is present, specvol is an anomaly from spv_ref. subroutine calculate_spec_vol_array_linear(T, S, pressure, specvol, start, npts, & Rho_T0_S0, dRho_dT, dRho_dS, spv_ref) real, dimension(:), intent(in) :: T !< potential temperature relative to the surface - !! in C. - real, dimension(:), intent(in) :: S !< salinity in PSU. - real, dimension(:), intent(in) :: pressure !< pressure in Pa. - real, dimension(:), intent(out) :: specvol !< in situ specific volume in m3 kg-1. + !! [degC]. + real, dimension(:), intent(in) :: S !< Salinity [PSU]. + real, dimension(:), intent(in) :: pressure !< Pressure [Pa]. + real, dimension(:), intent(out) :: specvol !< in situ specific volume [m3 kg-1]. integer, intent(in) :: start !< the starting point in the arrays. integer, intent(in) :: npts !< the number of values to calculate. real, intent(in) :: Rho_T0_S0 !< The density at T=0, S=0 [kg m-3]. - real, intent(in) :: dRho_dT !< The derivatives of density with temperature in kg m-3 C-1. - real, intent(in) :: dRho_dS !< The derivatives of density with salinity in kg m-3 psu-1. - real, optional, intent(in) :: spv_ref !< A reference specific volume in m3 kg-1. + real, intent(in) :: dRho_dT !< The derivatives of density with temperature [kg m-3 degC-1]. + real, intent(in) :: dRho_dS !< The derivatives of density with salinity [kg m-3 ppt-1]. + real, optional, intent(in) :: spv_ref !< A reference specific volume [m3 kg-1]. ! Local variables integer :: j @@ -163,16 +163,16 @@ end subroutine calculate_spec_vol_array_linear subroutine calculate_density_derivs_array_linear(T, S, pressure, drho_dT_out, & drho_dS_out, Rho_T0_S0, dRho_dT, dRho_dS, start, npts) real, intent(in), dimension(:) :: T !< Potential temperature relative to the surface - !! in C. - real, intent(in), dimension(:) :: S !< Salinity in PSU. - real, intent(in), dimension(:) :: pressure !< Pressure in Pa. + !! [degC]. + real, intent(in), dimension(:) :: S !< Salinity [PSU]. + real, intent(in), dimension(:) :: pressure !< Pressure [Pa]. real, intent(out), dimension(:) :: drho_dT_out !< The partial derivative of density with - !! potential temperature, in kg m-3 K-1. + !! potential temperature [kg m-3 degC-1]. real, intent(out), dimension(:) :: drho_dS_out !< The partial derivative of density with - !! salinity, in kg m-3 psu-1. + !! salinity [kg m-3 ppt-1]. real, intent(in) :: Rho_T0_S0 !< The density at T=0, S=0 [kg m-3]. - real, intent(in) :: dRho_dT !< The derivatives of density with temperature in kg m-3 C-1. - real, intent(in) :: dRho_dS !< The derivatives of density with salinity in kg m-3 psu-1. + real, intent(in) :: dRho_dT !< The derivative of density with temperature [kg m-3 degC-1]. + real, intent(in) :: dRho_dS !< The derivative of density with salinity [kg m-3 ppt-1]. integer, intent(in) :: start !< The starting point in the arrays. integer, intent(in) :: npts !< The number of values to calculate. ! Local variables @@ -190,16 +190,16 @@ end subroutine calculate_density_derivs_array_linear subroutine calculate_density_derivs_scalar_linear(T, S, pressure, drho_dT_out, & drho_dS_out, Rho_T0_S0, dRho_dT, dRho_dS) real, intent(in) :: T !< Potential temperature relative to the surface - !! in C. - real, intent(in) :: S !< Salinity in PSU. - real, intent(in) :: pressure !< Pressure in Pa. + !! [degC]. + real, intent(in) :: S !< Salinity [PSU]. + real, intent(in) :: pressure !< pressure [Pa]. real, intent(out) :: drho_dT_out !< The partial derivative of density with - !! potential temperature, in kg m-3 K-1. + !! potential temperature [kg m-3 degC-1]. real, intent(out) :: drho_dS_out !< The partial derivative of density with - !! salinity, in kg m-3 psu-1. + !! salinity [kg m-3 ppt-1]. real, intent(in) :: Rho_T0_S0 !< The density at T=0, S=0 [kg m-3]. - real, intent(in) :: dRho_dT !< The derivatives of density with temperature in kg m-3 C-1. - real, intent(in) :: dRho_dS !< The derivatives of density with salinity in kg m-3 psu-1. + real, intent(in) :: dRho_dT !< The derivatives of density with temperature [kg m-3 degC-1]. + real, intent(in) :: dRho_dS !< The derivatives of density with salinity [kg m-3 ppt-1]. drho_dT_out = dRho_dT drho_dS_out = dRho_dS @@ -207,17 +207,21 @@ end subroutine calculate_density_derivs_scalar_linear !> This subroutine calculates the five, partial second derivatives of density w.r.t. !! potential temperature and salinity and pressure which for a linear equation of state should all be 0. -subroutine calculate_density_second_derivs_scalar_linear(T, S,pressure, drho_dS_dS, drho_dS_dT, drho_dT_dT,& - drho_dS_dP, drho_dT_dP) - real, intent(in) :: T !< Potential temperature relative to the surface - !! in C. - real, intent(in) :: S !< Salinity in PSU. - real, intent(in) :: pressure !< Pressure in Pa. - real, intent(out) :: drho_dS_dS !< The partial derivative of density with - real, intent(out) :: drho_dS_dT !< The partial derivative of density with - real, intent(out) :: drho_dT_dT !< The partial derivative of density with - real, intent(out) :: drho_dS_dP !< The partial derivative of density with - real, intent(out) :: drho_dT_dP !< The partial derivative of density with +subroutine calculate_density_second_derivs_scalar_linear(T, S, pressure, drho_dS_dS, drho_dS_dT, & + drho_dT_dT, drho_dS_dP, drho_dT_dP) + real, intent(in) :: T !< Potential temperature relative to the surface [degC]. + real, intent(in) :: S !< Salinity [PSU]. + real, intent(in) :: pressure !< pressure [Pa]. + real, intent(out) :: drho_dS_dS !< The second derivative of density with + !! salinity [kg m-3 PSU-2]. + real, intent(out) :: drho_dS_dT !< The second derivative of density with + !! temperature and salinity [kg m-3 ppt-1 degC-1]. + real, intent(out) :: drho_dT_dT !< The second derivative of density with + !! temperature [kg m-3 degC-2]. + real, intent(out) :: drho_dS_dP !< The second derivative of density with + !! salinity and pressure [kg m-3 PSU-1 Pa-1]. + real, intent(out) :: drho_dT_dP !< The second derivative of density with + !! temperature and pressure [kg m-3 degC-1 Pa-1]. drho_dS_dS = 0. drho_dS_dT = 0. @@ -231,15 +235,19 @@ end subroutine calculate_density_second_derivs_scalar_linear !! potential temperature and salinity and pressure which for a linear equation of state should all be 0. subroutine calculate_density_second_derivs_array_linear(T, S,pressure, drho_dS_dS, drho_dS_dT, drho_dT_dT,& drho_dS_dP, drho_dT_dP, start, npts) - real, dimension(:), intent(in) :: T !< Potential temperature relative to the surface - !! in C. - real, dimension(:), intent(in) :: S !< Salinity in PSU. - real, dimension(:), intent(in) :: pressure !< Pressure in Pa. - real, dimension(:), intent(out) :: drho_dS_dS !< The partial derivative of density with - real, dimension(:), intent(out) :: drho_dS_dT !< The partial derivative of density with - real, dimension(:), intent(out) :: drho_dT_dT !< The partial derivative of density with - real, dimension(:), intent(out) :: drho_dS_dP !< The partial derivative of density with - real, dimension(:), intent(out) :: drho_dT_dP !< The partial derivative of density with + real, dimension(:), intent(in) :: T !< Potential temperature relative to the surface [degC]. + real, dimension(:), intent(in) :: S !< Salinity [PSU]. + real, dimension(:), intent(in) :: pressure !< pressure [Pa]. + real, dimension(:), intent(out) :: drho_dS_dS !< The second derivative of density with + !! salinity [kg m-3 PSU-2]. + real, dimension(:), intent(out) :: drho_dS_dT !< The second derivative of density with + !! temperature and salinity [kg m-3 ppt-1 degC-1]. + real, dimension(:), intent(out) :: drho_dT_dT !< The second derivative of density with + !! temperature [kg m-3 degC-2]. + real, dimension(:), intent(out) :: drho_dS_dP !< The second derivative of density with + !! salinity and pressure [kg m-3 PSU-1 Pa-1]. + real, dimension(:), intent(out) :: drho_dT_dP !< The second derivative of density with + !! temperature and pressure [kg m-3 degC-1 Pa-1]. integer, intent(in) :: start !< The starting point in the arrays. integer, intent(in) :: npts !< The number of values to calculate. ! Local variables @@ -258,20 +266,20 @@ end subroutine calculate_density_second_derivs_array_linear subroutine calculate_specvol_derivs_linear(T, S, pressure, dSV_dT, dSV_dS, & start, npts, Rho_T0_S0, dRho_dT, dRho_dS) real, intent(in), dimension(:) :: T !< Potential temperature relative to the surface - !! in C. - real, intent(in), dimension(:) :: S !< Salinity in g/kg. - real, intent(in), dimension(:) :: pressure !< Pressure in Pa. + !! [degC]. + real, intent(in), dimension(:) :: S !< Salinity [PSU]. + real, intent(in), dimension(:) :: pressure !< pressure [Pa]. real, intent(out), dimension(:) :: dSV_dS !< The partial derivative of specific volume with - !! salinity, in m3 kg-1 / (g/kg). + !! salinity [m3 kg-1 PSU-1]. real, intent(out), dimension(:) :: dSV_dT !< The partial derivative of specific volume with - !! potential temperature, in m3 kg-1 K-1. + !! potential temperature [m3 kg-1 degC-1]. integer, intent(in) :: start !< The starting point in the arrays. integer, intent(in) :: npts !< The number of values to calculate. real, intent(in) :: Rho_T0_S0 !< The density at T=0, S=0 [kg m-3]. real, intent(in) :: dRho_dT !< The derivative of density with - !! temperature, in kg m-3 C-1. + !! temperature, [kg m-3 degC-1]. real, intent(in) :: dRho_dS !< The derivative of density with - !! salinity, in kg m-3 psu-1. + !! salinity [kg m-3 ppt-1]. ! Local variables real :: I_rho2 integer :: j @@ -291,20 +299,20 @@ end subroutine calculate_specvol_derivs_linear subroutine calculate_compress_linear(T, S, pressure, rho, drho_dp, start, npts,& Rho_T0_S0, dRho_dT, dRho_dS) real, intent(in), dimension(:) :: T !< Potential temperature relative to the surface - !! in C. - real, intent(in), dimension(:) :: S !< Salinity in PSU. - real, intent(in), dimension(:) :: pressure !< Pressure in Pa. - real, intent(out), dimension(:) :: rho !< In situ density in kg m-3. + !! [degC]. + real, intent(in), dimension(:) :: S !< Salinity [PSU]. + real, intent(in), dimension(:) :: pressure !< pressure [Pa]. + real, intent(out), dimension(:) :: rho !< In situ density [kg m-3]. real, intent(out), dimension(:) :: drho_dp !< The partial derivative of density with pressure !! (also the inverse of the square of sound speed) - !! in s2 m-2. + !! [s2 m-2]. integer, intent(in) :: start !< The starting point in the arrays. integer, intent(in) :: npts !< The number of values to calculate. real, intent(in) :: Rho_T0_S0 !< The density at T=0, S=0 [kg m-3]. real, intent(in) :: dRho_dT !< The derivative of density with - !! temperature, in kg m-3 C-1. + !! temperature [kg m-3 degC-1]. real, intent(in) :: dRho_dS !< The derivative of density with - !! salinity, in kg m-3 psu-1. + !! salinity [kg m-3 ppt-1]. ! Local variables integer :: j @@ -324,33 +332,33 @@ subroutine int_density_dz_linear(T, S, z_t, z_b, rho_ref, rho_0_pres, G_e, HII, type(hor_index_type), intent(in) :: HIO !< The horizontal index type for the output arrays. real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & intent(in) :: T !< Potential temperature relative to the surface - !! in C. + !! [degC]. real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & - intent(in) :: S !< Salinity in PSU. + intent(in) :: S !< Salinity [PSU]. real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & intent(in) :: z_t !< Height at the top of the layer in depth units [Z ~> m]. real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), & intent(in) :: z_b !< Height at the top of the layer [Z ~> m]. - real, intent(in) :: rho_ref !< A mean density, in kg m-3, that is subtracted + real, intent(in) :: rho_ref !< A mean density [kg m-3], that is subtracted !! out to reduce the magnitude of each of the !! integrals. - real, intent(in) :: rho_0_pres !< A density, in kg m-3, that is used to calculate + real, intent(in) :: rho_0_pres !< A density [kg m-3], that is used to calculate !! the pressure (as p~=-z*rho_0_pres*G_e) used in !! the equation of state. rho_0_pres is not used !! here. real, intent(in) :: G_e !< The Earth's gravitational acceleration [m2 Z-1 s-2 ~> m s-2]. real, intent(in) :: Rho_T0_S0 !< The density at T=0, S=0 [kg m-3]. real, intent(in) :: dRho_dT !< The derivative of density with temperature, - !! in kg m-3 C-1. + !! [kg m-3 degC-1]. real, intent(in) :: dRho_dS !< The derivative of density with salinity, - !! in kg m-3 psu-1. + !! in [kg m-3 ppt-1]. real, dimension(HIO%isd:HIO%ied,HIO%jsd:HIO%jed), & intent(out) :: dpa !< The change in the pressure anomaly across the !! layer [Pa]. real, dimension(HIO%isd:HIO%ied,HIO%jsd:HIO%jed), & optional, intent(out) :: intz_dpa !< The integral through the thickness of the layer !! of the pressure anomaly relative to the anomaly - !! at the top of the layer, in Pa Z. + !! at the top of the layer [Pa Z]. real, dimension(HIO%IsdB:HIO%IedB,HIO%jsd:HIO%jed), & optional, intent(out) :: intx_dpa !< The integral in x of the difference between the !! pressure anomaly at the top and bottom of the @@ -497,54 +505,54 @@ subroutine int_spec_vol_dp_linear(T, S, p_t, p_b, alpha_ref, HI, Rho_T0_S0, & type(hor_index_type), intent(in) :: HI !< The ocean's horizontal index type. real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & intent(in) :: T !< Potential temperature relative to the surface - !! in C. + !! [degC]. real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & - intent(in) :: S !< Salinity in PSU. + intent(in) :: S !< Salinity [PSU]. real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & - intent(in) :: p_t !< Pressure at the top of the layer in Pa. + intent(in) :: p_t !< Pressure at the top of the layer [Pa]. real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & - intent(in) :: p_b !< Pressure at the top of the layer in Pa. + intent(in) :: p_b !< Pressure at the top of the layer [Pa]. real, intent(in) :: alpha_ref !< A mean specific volume that is subtracted out !! to reduce the magnitude of each of the integrals, m3 kg-1. The calculation is !! mathematically identical with different values of alpha_ref, but this reduces the !! effects of roundoff. real, intent(in) :: Rho_T0_S0 !< The density at T=0, S=0 [kg m-3]. - real, intent(in) :: dRho_dT !< The derivative of density with temperature, - !! in kg m-3 C-1. + real, intent(in) :: dRho_dT !< The derivative of density with temperature + !! [kg m-3 degC-1]. real, intent(in) :: dRho_dS !< The derivative of density with salinity, - !! in kg m-3 psu-1. + !! in [kg m-3 ppt-1]. real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & intent(out) :: dza !< The change in the geopotential anomaly across !! the layer [m2 s-2]. real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & optional, intent(out) :: intp_dza !< The integral in pressure through the layer of !! the geopotential anomaly relative to the anomaly - !! at the bottom of the layer, in Pa m2 s-2. + !! at the bottom of the layer [Pa m2 s-2]. real, dimension(HI%IsdB:HI%IedB,HI%jsd:HI%jed), & optional, intent(out) :: intx_dza !< The integral in x of the difference between the !! geopotential anomaly at the top and bottom of - !! the layer divided by the x grid spacing, - !! in m2 s-2. + !! the layer divided by the x grid spacing + !! [m2 s-2]. real, dimension(HI%isd:HI%ied,HI%JsdB:HI%JedB), & optional, intent(out) :: inty_dza !< The integral in y of the difference between the !! geopotential anomaly at the top and bottom of - !! the layer divided by the y grid spacing, - !! in m2 s-2. + !! the layer divided by the y grid spacing + !! [m2 s-2]. integer, optional, intent(in) :: halo_size !< The width of halo points on which to calculate dza. real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), & - optional, intent(in) :: bathyP !< The pressure at the bathymetry in Pa + optional, intent(in) :: bathyP !< The pressure at the bathymetry [Pa] real, optional, intent(in) :: dP_neglect !< A miniscule pressure change with - !! the same units as p_t (Pa?) + !! the same units as p_t [Pa] logical, optional, intent(in) :: useMassWghtInterp !< If true, uses mass weighting !! to interpolate T/S for top and bottom integrals. ! Local variables real :: dRho_TS ! The density anomaly due to T and S [kg m-3]. - real :: alpha_anom ! The specific volume anomaly from 1/rho_ref, in m3 kg-1. + real :: alpha_anom ! The specific volume anomaly from 1/rho_ref [m3 kg-1]. real :: aaL, aaR ! rho_anom to the left and right [kg m-3]. - real :: dp, dpL, dpR ! Layer pressure thicknesses in Pa. + real :: dp, dpL, dpR ! Layer pressure thicknesses [Pa]. real :: hWght ! A pressure-thickness below topography [Pa]. real :: hL, hR ! Pressure-thicknesses of the columns to the left and right [Pa]. - real :: iDenom ! The inverse of the denominator in the weights, in Pa-2. + real :: iDenom ! The inverse of the denominator in the weights [Pa-2]. real :: hWt_LL, hWt_LR ! hWt_LA is the weighted influence of A on the left column [nondim]. real :: hWt_RL, hWt_RR ! hWt_RA is the weighted influence of A on the right column [nondim]. real :: wt_L, wt_R ! The linear weights of the left and right columns [nondim]. diff --git a/src/initialization/MOM_coord_initialization.F90 b/src/initialization/MOM_coord_initialization.F90 index f77cdfbfe9..0c26418486 100644 --- a/src/initialization/MOM_coord_initialization.F90 +++ b/src/initialization/MOM_coord_initialization.F90 @@ -124,7 +124,7 @@ end subroutine MOM_initialize_coord !> Sets the layer densities (Rlay) and the interface reduced gravities (g). subroutine set_coord_from_gprime(Rlay, g_prime, GV, US, param_file) real, dimension(:), intent(out) :: Rlay !< The layers' target coordinate values - !! (potential density). + !! (potential density) [kg m-3]. real, dimension(:), intent(out) :: g_prime !< The reduced gravity across the interfaces !! [m2 Z-1 s-2 ~> m s-2]. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. @@ -158,7 +158,7 @@ end subroutine set_coord_from_gprime !> Sets the layer densities (Rlay) and the interface reduced gravities (g). subroutine set_coord_from_layer_density(Rlay, g_prime, GV, US, param_file) real, dimension(:), intent(out) :: Rlay !< The layers' target coordinate values - !! (potential density). + !! (potential density) [kg m-3]. real, dimension(:), intent(out) :: g_prime !< The reduced gravity across the interfaces !! [m2 Z-1 s-2 ~> m s-2]. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure @@ -166,8 +166,8 @@ subroutine set_coord_from_layer_density(Rlay, g_prime, GV, US, param_file) type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters ! Local variables real :: g_fs ! Reduced gravity across the free surface [m s-2]. - real :: Rlay_Ref! The surface layer's target density, in kg m-3. - real :: RLay_range ! The range of densities, in kg m-3. + real :: Rlay_Ref! The surface layer's target density [kg m-3]. + real :: RLay_range ! The range of densities [kg m-3]. character(len=40) :: mdl = "set_coord_from_layer_density" ! This subroutine's name. integer :: k, nz nz = GV%ke @@ -201,7 +201,7 @@ end subroutine set_coord_from_layer_density subroutine set_coord_from_TS_ref(Rlay, g_prime, GV, US, param_file, eqn_of_state, & P_Ref) real, dimension(:), intent(out) :: Rlay !< The layers' target coordinate values - !! (potential density). + !! (potential density) [kg m-3]. real, dimension(:), intent(out) :: g_prime !< The reduced gravity across the interfaces !! [m2 Z-1 s-2 ~> m s-2]. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. @@ -253,7 +253,7 @@ end subroutine set_coord_from_TS_ref subroutine set_coord_from_TS_profile(Rlay, g_prime, GV, US, param_file, & eqn_of_state, P_Ref) real, dimension(:), intent(out) :: Rlay !< The layers' target coordinate values - !! (potential density). + !! (potential density) [kg m-3]. real, dimension(:), intent(out) :: g_prime !< The reduced gravity across the interfaces !! [m2 Z-1 s-2 ~> m s-2]. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. @@ -302,7 +302,7 @@ end subroutine set_coord_from_TS_profile subroutine set_coord_from_TS_range(Rlay, g_prime, GV, US, param_file, & eqn_of_state, P_Ref) real, dimension(:), intent(out) :: Rlay !< The layers' target coordinate values - !! (potential density). + !! (potential density) [kg m-3]. real, dimension(:), intent(out) :: g_prime !< The reduced gravity across the interfaces !! [m2 Z-1 s-2 ~> m s-2]. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. @@ -384,7 +384,7 @@ end subroutine set_coord_from_TS_range ! Sets the layer densities (Rlay) and the interface reduced gravities (g) from data in file. subroutine set_coord_from_file(Rlay, g_prime, GV, US, param_file) real, dimension(:), intent(out) :: Rlay !< The layers' target coordinate values - !! (potential density). + !! (potential density) [kg m-3]. real, dimension(:), intent(out) :: g_prime !< The reduced gravity across the interfaces !! [m2 Z-1 s-2 ~> m s-2]. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. @@ -435,7 +435,7 @@ end subroutine set_coord_from_file !! (defaulting to 2.0 if not defined) subroutine set_coord_linear(Rlay, g_prime, GV, US, param_file) real, dimension(:), intent(out) :: Rlay !< The layers' target coordinate values - !! (potential density). + !! (potential density) [kg m-3]. real, dimension(:), intent(out) :: g_prime !< The reduced gravity across the interfaces !! [m2 Z-1 s-2 ~> m s-2]. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. @@ -479,9 +479,9 @@ end subroutine set_coord_linear !! might be used. subroutine set_coord_to_none(Rlay, g_prime, GV, US, param_file) real, dimension(:), intent(out) :: Rlay !< The layers' target coordinate values - !! (potential density). + !! (potential density) [kg m-3]. real, dimension(:), intent(out) :: g_prime !< The reduced gravity across the interfaces, - !! [m s-2]. + !! [m2 Z-1 s-2 ~> m s-2]. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters diff --git a/src/initialization/MOM_state_initialization.F90 b/src/initialization/MOM_state_initialization.F90 index fed47ca7a0..ba2b29d765 100644 --- a/src/initialization/MOM_state_initialization.F90 +++ b/src/initialization/MOM_state_initialization.F90 @@ -612,7 +612,7 @@ subroutine initialize_thickness_from_file(h, G, GV, US, param_file, file_has_thi 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 m. + 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, intent(in) :: file_has_thickness !< If true, this file contains layer @@ -1073,13 +1073,13 @@ end subroutine depress_surface !! where the hydrostatic pressure matches an imposed surface pressure read from file. subroutine trim_for_ice(PF, G, GV, US, ALE_CSp, tv, h, just_read_params) type(param_file_type), intent(in) :: PF !< Parameter file structure - type(ocean_grid_type), intent(in) :: G !< Ocean grid structure + type(ocean_grid_type), intent(in) :: G !< Ocean grid structure type(verticalGrid_type), intent(in) :: GV !< Vertical grid structure - type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type + type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type type(ALE_CS), pointer :: ALE_CSp !< ALE control structure type(thermo_var_ptrs), intent(inout) :: tv !< Thermodynamics structure real, dimension(SZI_(G),SZJ_(G),SZK_(G)), & - intent(inout) :: h !< Layer thickness (H units, m or Pa) + intent(inout) :: h !< Layer thickness [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 @@ -1412,8 +1412,10 @@ end subroutine initialize_velocity_circular !> Initializes temperature and salinity from file subroutine initialize_temp_salt_from_file(T, S, G, param_file, just_read_params) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure - real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(out) :: T !< The potential temperature that is being initialized. - real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(out) :: S !< The salinity that is being initialized. + real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(out) :: T !< The potential temperature that is + !! being initialized [degC] + real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(out) :: S !< The salinity that is + !! being initialized [ppt] type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters logical, optional, intent(in) :: just_read_params !< If present and true, this call will !! only read parameters without changing h. @@ -1465,12 +1467,14 @@ end subroutine initialize_temp_salt_from_file !> Initializes temperature and salinity from a 1D profile subroutine initialize_temp_salt_from_profile(T, S, G, param_file, just_read_params) - type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure - real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(out) :: T !< The potential temperature that is being initialized. - real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(out) :: S !< The salinity that is being initialized. - type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters + type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure + real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(out) :: T !< The potential temperature that is + !! being initialized [degC] + real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(out) :: S !< The salinity that is + !! being initialized [ppt] + type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + !! only read parameters without changing h. ! Local variables real, dimension(SZK_(G)) :: T0, S0 integer :: i, j, k @@ -1510,23 +1514,26 @@ end subroutine initialize_temp_salt_from_profile subroutine initialize_temp_salt_fit(T, S, G, GV, param_file, eqn_of_state, P_Ref, just_read_params) type(ocean_grid_type), intent(in) :: G !< The ocean's 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 !< The potential temperature that is being initialized. - real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(out) :: S !< The salinity that is being initialized. + real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(out) :: T !< The potential temperature that is + !! being initialized [degC]. + real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(out) :: S !< The salinity that is being + !! initialized [ppt]. type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time !! parameters. type(EOS_type), pointer :: eqn_of_state !< Integer that selects the equatio of state. real, intent(in) :: P_Ref !< The coordinate-density reference pressure - !! in Pa. + !! [Pa]. logical, optional, intent(in) :: just_read_params !< If present and true, this call will !! only read parameters without changing h. ! Local variables - real :: T0(SZK_(G)), S0(SZK_(G)) - real :: T_Ref ! Reference Temperature - real :: S_Ref ! Reference Salinity - real :: pres(SZK_(G)) ! An array of the reference pressure in Pa. - real :: drho_dT(SZK_(G)) ! Derivative of density with temperature in kg m-3 K-1. - real :: drho_dS(SZK_(G)) ! Derivative of density with salinity in kg m-3 PSU-1. - real :: rho_guess(SZK_(G)) ! Potential density at T0 & S0 in kg m-3. + real :: T0(SZK_(G)) ! Layer potential temperatures [degC] + real :: S0(SZK_(G)) ! Layer salinities [degC] + real :: T_Ref ! Reference Temperature [degC] + real :: S_Ref ! Reference Salinity [ppt] + real :: pres(SZK_(G)) ! An array of the reference pressure [Pa]. + real :: drho_dT(SZK_(G)) ! Derivative of density with temperature [kg m-3 degC-1]. + real :: drho_dS(SZK_(G)) ! Derivative of density with salinity [kg m-3 ppt-1]. + real :: rho_guess(SZK_(G)) ! Potential density at T0 & S0 [kg m-3]. logical :: fit_salin ! If true, accept the prescribed temperature and fit the salinity. logical :: just_read ! If true, just read parameters but set nothing. character(len=40) :: mdl = "initialize_temp_salt_fit" ! This subroutine's name. @@ -1599,8 +1606,10 @@ end subroutine initialize_temp_salt_fit !! number, not the physical position). subroutine initialize_temp_salt_linear(T, S, G, param_file, just_read_params) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure - real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(out) :: T !< The potential temperature that is being initialized. - real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(out) :: S !< The salinity that is being initialized. + real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(out) :: T !< The potential temperature that is + !! being initialized [degC] + real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(out) :: S !< The salinity that is + !! being initialized [ppt] type(param_file_type), intent(in) :: param_file !< A structure to parse for !! run-time parameters logical, optional, intent(in) :: just_read_params !< If present and true, diff --git a/src/parameterizations/lateral/MOM_mixed_layer_restrat.F90 b/src/parameterizations/lateral/MOM_mixed_layer_restrat.F90 index e8f16f89c2..d7c47e8b01 100644 --- a/src/parameterizations/lateral/MOM_mixed_layer_restrat.F90 +++ b/src/parameterizations/lateral/MOM_mixed_layer_restrat.F90 @@ -36,28 +36,26 @@ module MOM_mixed_layer_restrat !> Control structure for mom_mixed_layer_restrat type, public :: mixedlayer_restrat_CS ; private - real :: ml_restrat_coef !< A non-dimensional factor by which the - !! instability is enhanced over what would be - !! predicted based on the resolved gradients. This - !! increases with grid spacing^2, up to something + real :: ml_restrat_coef !< A non-dimensional factor by which the instability is enhanced + !! over what would be predicted based on the resolved gradients + !! [nondim]. This increases with grid spacing^2, up to something !! of order 500. - real :: ml_restrat_coef2 !< As for ml_restrat_coef but using the slow filtered MLD. - real :: front_length !< If non-zero, is the frontal-length scale used to calculate the + real :: ml_restrat_coef2 !< As for ml_restrat_coef but using the slow filtered MLD [nondim]. + real :: front_length !< If non-zero, is the frontal-length scale [m] used to calculate the !! upscaling of buoyancy gradients that is otherwise represented !! by the parameter FOX_KEMPER_ML_RESTRAT_COEF. If MLE_FRONT_LENGTH is !! non-zero, it is recommended to set FOX_KEMPER_ML_RESTRAT_COEF=1.0. logical :: MLE_use_PBL_MLD !< If true, use the MLD provided by the PBL parameterization. !! if false, MLE will calculate a MLD based on a density difference !! based on the parameter MLE_DENSITY_DIFF. - real :: MLE_MLD_decay_time !< Time-scale to use in a running-mean when MLD is retreating (s). - real :: MLE_MLD_decay_time2 !< Time-scale to use in a running-mean when filtered MLD is retreating (s). - real :: MLE_density_diff !< Density difference used in detecting mixed-layer - !! depth (kg/m3). + real :: MLE_MLD_decay_time !< Time-scale to use in a running-mean when MLD is retreating [s]. + real :: MLE_MLD_decay_time2 !< Time-scale to use in a running-mean when filtered MLD is retreating [s]. + real :: MLE_density_diff !< Density difference used in detecting mixed-layer depth [kgm-3]. real :: MLE_tail_dh !< Fraction by which to extend the mixed-layer restratification !! depth used for a smoother stream function at the base of - !! the mixed-layer. - real :: MLE_MLD_stretch !< A scaling coefficient for stretching/shrinking the MLD - !! used in the MLE scheme. This simply multiplies MLD wherever used. + !! the mixed-layer [nondim]. + real :: MLE_MLD_stretch !< A scaling coefficient for stretching/shrinking the MLD used in + !! the MLE scheme [nondim]. This simply multiplies MLD wherever used. logical :: MLE_use_MLD_ave_bug !< If true, do not account for MLD mismatch to interface positions. logical :: debug = .false. !< If true, calculate checksums of fields for debugging. type(diag_ctrl), pointer :: diag !< A structure that is used to regulate the @@ -567,14 +565,13 @@ subroutine mixedlayer_restrat_BML(h, uhtr, vhtr, tv, forces, dt, G, GV, US, CS) real :: vhml(SZI_(G),SZJB_(G),SZK_(G)) ! merid mixed layer transport [H m2 s-1 ~> m3 s-1 or kg s-1] real, dimension(SZI_(G),SZJ_(G),SZK_(G)) :: & h_avail ! The volume available for diffusion out of each face of each - ! sublayer of the mixed layer, divided by dt, in units - ! of H m2 s-1 (i.e., m3 s-1 or kg s-1). + ! sublayer of the mixed layer, divided by dt [H m2 s-1 ~> m3 s-1 or kg s-1]. real, dimension(SZI_(G),SZJ_(G)) :: & htot, & ! The sum of the thicknesses of layers in the mixed layer [H ~> m or kg m-2] Rml_av ! g_Rho0 times the average mixed layer density [m s-2] real :: g_Rho0 ! G_Earth/Rho0 [m5 Z-1 s-2 kg-1 ~> m4 s-2 kg-1] - real :: Rho0(SZI_(G)) ! Potential density relative to the surface (kg m-3) - real :: p0(SZI_(G)) ! A pressure of 0 (Pa) + real :: Rho0(SZI_(G)) ! Potential density relative to the surface [kg m-3] + real :: p0(SZI_(G)) ! A pressure of 0 [Pa] real :: h_vel ! htot interpolated onto velocity points [Z ~> m]. (The units are not H.) real :: absf ! absolute value of f, interpolated to velocity points [s-1] diff --git a/src/parameterizations/lateral/MOM_thickness_diffuse.F90 b/src/parameterizations/lateral/MOM_thickness_diffuse.F90 index 073fd1d099..d9837e1875 100644 --- a/src/parameterizations/lateral/MOM_thickness_diffuse.F90 +++ b/src/parameterizations/lateral/MOM_thickness_diffuse.F90 @@ -411,15 +411,17 @@ subroutine thickness_diffuse_full(h, e, Kh_u, Kh_v, tv, uhD, vhD, cg1, dt, G, GV real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(in) :: h !< Layer thickness [H ~> m or kg m-2] real, dimension(SZI_(G),SZJ_(G),SZK_(G)+1), intent(in) :: e !< Interface positions [Z ~> m] real, dimension(SZIB_(G),SZJ_(G),SZK_(G)+1), intent(in) :: Kh_u !< Thickness diffusivity on interfaces - !! at u points (m2/s) + !! at u points [m2 s-1] real, dimension(SZI_(G),SZJB_(G),SZK_(G)+1), intent(in) :: Kh_v !< Thickness diffusivity on interfaces - !! at v points (m2/s) + !! at v points [m2 s-1] type(thermo_var_ptrs), intent(in) :: tv !< Thermodynamics structure - real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(out) :: uhD !< Zonal mass fluxes (m2 H s-1) - real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(out) :: vhD !< Meridional mass fluxes (m2 H s-1) + real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(out) :: uhD !< Zonal mass fluxes + !! [H m2 s-1 ~> m3 s-1 or kg s-1] + real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(out) :: vhD !< Meridional mass fluxes + !! [H m2 s-1 ~> m3 s-1 or kg s-1] real, dimension(:,:), pointer :: cg1 !< Wave speed [m s-1] - real, intent(in) :: dt !< Time increment (s) - type(MEKE_type), pointer :: MEKE !< MEKE control structue + real, intent(in) :: dt !< Time increment [s] + type(MEKE_type), pointer :: MEKE !< MEKE control structure type(thickness_diffuse_CS), pointer :: CS !< Control structure for thickness diffusion real, dimension(SZIB_(G),SZJ_(G),SZK_(G)+1), optional, intent(in) :: int_slope_u !< Ratio that determine how much of !! the isopycnal slopes are taken directly from the @@ -434,11 +436,11 @@ subroutine thickness_diffuse_full(h, e, Kh_u, Kh_v, tv, uhD, vhD, cg1, dt, G, GV ! Local variables real, dimension(SZI_(G), SZJ_(G), SZK_(G)) :: & - T, & ! The temperature (or density) in C, with the values in + T, & ! The temperature (or density) [degC], with the values in ! in massless layers filled vertically by diffusion. - S, & ! The filled salinity, in PSU, with the values in + S, & ! The filled salinity [ppt], with the values in ! in massless layers filled vertically by diffusion. - Rho, & ! Density itself, when a nonlinear equation of state is + Rho, & ! Density itself [kg m-3], when a nonlinear equation of state is ! not in use. h_avail, & ! The mass available for diffusion out of each face, divided ! by dt [H m2 s-1 ~> m3 s-1 or kg s-1]. @@ -448,29 +450,31 @@ subroutine thickness_diffuse_full(h, e, Kh_u, Kh_v, tv, uhD, vhD, cg1, dt, G, GV pres, & ! The pressure at an interface [Pa]. h_avail_rsum ! The running sum of h_avail above an interface [H m2 s-1 ~> m3 s-1 or kg s-1]. real, dimension(SZIB_(G)) :: & - drho_dT_u, & ! The derivatives of density with temperature and - drho_dS_u ! salinity at u points, in kg m-3 K-1 and kg m-3 psu-1. + drho_dT_u, & ! The derivative of density with temperature at u points [kg m-3 degC-1] + drho_dS_u ! The derivative of density with salinity at u points [kg m-3 ppt-1]. real, dimension(SZI_(G)) :: & - drho_dT_v, & ! The derivatives of density with temperature and - drho_dS_v ! salinity at v points, in kg m-3 K-1 and kg m-3 psu-1. - real :: uhtot(SZIB_(G), SZJ_(G)) ! The vertical sum of uhD, in m3 s-1. - real :: vhtot(SZI_(G), SZJB_(G)) ! The vertical sum of vhD, in m3 s-1. + drho_dT_v, & ! The derivative of density with temperature at v points [kg m-3 degC-1] + drho_dS_v ! The derivative of density with salinity at v points [kg m-3 ppt-1]. + real :: uhtot(SZIB_(G), SZJ_(G)) ! The vertical sum of uhD [H m2 s-1 ~> m3 s-1 or kg s-1]. + real :: vhtot(SZI_(G), SZJB_(G)) ! The vertical sum of vhD [H m2 s-1 ~> m3 s-1 or kg s-1]. real, dimension(SZIB_(G)) :: & - T_u, S_u, & ! Temperature, salinity, and pressure on the interface at - pres_u ! the u-point in the horizontal. + T_u, & ! Temperature on the interface at the u-point [degC]. + S_u, & ! Salinity on the interface at the u-point [ppt]. + pres_u ! Pressure on the interface at the u-point [Pa]. real, dimension(SZI_(G)) :: & - T_v, S_v, & ! Temperature, salinity, and pressure on the interface at - pres_v ! the v-point in the horizontal. + T_v, & ! Temperature on the interface at the v-point [degC]. + S_v, & ! Salinity on the interface at the v-point [ppt]. + pres_v ! Pressure on the interface at the v-point [Pa]. real :: Work_u(SZIB_(G), SZJ_(G)) ! The work being done by the thickness - real :: Work_v(SZI_(G), SZJB_(G)) ! diffusion integrated over a cell, in W. - real :: Work_h ! The work averaged over an h-cell in W m-2. + real :: Work_v(SZI_(G), SZJB_(G)) ! diffusion integrated over a cell [W]. + real :: Work_h ! The work averaged over an h-cell [W m-2]. real :: I4dt ! 1 / 4 dt [s-1]. real :: drdiA, drdiB ! Along layer zonal- and meridional- potential density real :: drdjA, drdjB ! gradients in the layers above (A) and below(B) the ! interface times the grid spacing [kg m-3]. real :: drdkL, drdkR ! Vertical density differences across an interface [kg m-3]. - real :: drdi_u(SZIB_(G), SZK_(G)+1) ! Copy of drdi at u-points in kg m-3. - real :: drdj_v(SZI_(G), SZK_(G)+1) ! Copy of drdj at v-points in kg m-3. + real :: drdi_u(SZIB_(G), SZK_(G)+1) ! Copy of drdi at u-points [kg m-3]. + real :: drdj_v(SZI_(G), SZK_(G)+1) ! Copy of drdj at v-points [kg m-3]. real :: drdkDe_u(SZIB_(G),SZK_(G)+1) ! Lateral difference of product of drdk and e at u-points ! [Z kg m-3 ~> kg m-2]. real :: drdkDe_v(SZI_(G),SZK_(G)+1) ! Lateral difference of product of drdk and e at v-points @@ -479,7 +483,7 @@ subroutine thickness_diffuse_full(h, e, Kh_u, Kh_v, tv, uhD, vhD, cg1, dt, G, GV real :: haA, haB, haL, haR ! Arithmetic mean thicknesses [H ~> m or kg m-2]. real :: dzaL, dzaR ! Temporary thicknesses [Z ~> m]. real :: wtA, wtB, wtL, wtR ! Unscaled weights, with various units. - real :: drdx, drdy ! Zonal and meridional density gradients, in kg m-4. + real :: drdx, drdy ! Zonal and meridional density gradients [kg m-4]. real :: drdz ! Vertical density gradient [kg m-3 Z-1 ~> kg m-4]. real :: h_harm ! Harmonic mean layer thickness [H ~> m or kg m-2]. real :: c2_h_u(SZIB_(G), SZK_(G)+1) ! Wave speed squared divided by h at u-points [m2 Z-1 s-2 ~> m s-2]. @@ -498,7 +502,7 @@ subroutine thickness_diffuse_full(h, e, Kh_u, Kh_v, tv, uhD, vhD, cg1, dt, G, GV ! good thing to use when the slope is so large as to be meaningless [Z m2 s-1 ~> m3 s-1]. real :: Slope ! The slope of density surfaces, calculated in a way ! that is always between -1 and 1, nondimensional. - real :: mag_grad2 ! The squared magnitude of the 3-d density gradient, in kg2 m-8. + real :: mag_grad2 ! The squared magnitude of the 3-d density gradient [kg2 m-8]. real :: I_slope_max2 ! The inverse of slope_max squared, nondimensional. 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]. @@ -510,11 +514,10 @@ subroutine thickness_diffuse_full(h, e, Kh_u, Kh_v, tv, uhD, vhD, cg1, dt, G, GV logical :: use_EOS ! If true, density is calculated from T & S using an ! equation of state. logical :: find_work ! If true, find the change in energy due to the fluxes. - integer :: nk_linear ! The number of layers over which the streamfunction - ! goes to 0. + integer :: nk_linear ! The number of layers over which the streamfunction goes to 0. real :: G_rho0 ! g/Rho0 [m5 Z-1 s-2 ~> m4 s-2]. real :: N2_floor ! A floor for N2 to avoid degeneracy in the elliptic solver - ! times unit conversion factors (s-2 m2 Z-2) + ! times unit conversion factors [s-2 m2 Z-2 ~> s-2] real, dimension(SZIB_(G), SZJ_(G), SZK_(G)+1) :: diag_sfn_x, diag_sfn_unlim_x ! Diagnostics real, dimension(SZI_(G), SZJB_(G), SZK_(G)+1) :: diag_sfn_y, diag_sfn_unlim_y ! Diagnostics logical :: present_int_slope_u, present_int_slope_v diff --git a/src/parameterizations/vertical/MOM_CVMix_ddiff.F90 b/src/parameterizations/vertical/MOM_CVMix_ddiff.F90 index 7dd4ad7675..07d6216be1 100644 --- a/src/parameterizations/vertical/MOM_CVMix_ddiff.F90 +++ b/src/parameterizations/vertical/MOM_CVMix_ddiff.F90 @@ -179,8 +179,8 @@ subroutine compute_ddiff_coeffs(h, tv, G, GV, US, j, Kd_T, Kd_S, CS) ! Local variables real, dimension(SZK_(G)) :: & cellHeight, & !< Height of cell centers (m) - dRho_dT, & !< partial derivatives of density wrt temp (kg m-3 degC-1) - dRho_dS, & !< partial derivatives of density wrt saln (kg m-3 PPT-1) + dRho_dT, & !< partial derivatives of density wrt temp [kg m-3 degC-1] + dRho_dS, & !< partial derivatives of density wrt saln [kg m-3 ppt-1] pres_int, & !< pressure at each interface (Pa) temp_int, & !< temp and at interfaces (degC) salt_int, & !< salt at at interfaces diff --git a/src/parameterizations/vertical/MOM_bulk_mixed_layer.F90 b/src/parameterizations/vertical/MOM_bulk_mixed_layer.F90 index ca3974be8d..4bf30a5a60 100644 --- a/src/parameterizations/vertical/MOM_bulk_mixed_layer.F90 +++ b/src/parameterizations/vertical/MOM_bulk_mixed_layer.F90 @@ -284,11 +284,11 @@ subroutine bulkmixedlayer(h_3d, u_3d, v_3d, tv, fluxes, dt, ea, eb, G, GV, US, C dR0_dT, & ! Partial derivative of the mixed layer potential density with ! temperature [kg m-3 degC-1]. dRcv_dT, & ! Partial derivative of the coordinate variable potential - ! density in the mixed layer with temperature, in kg m-3 K-1. + ! density in the mixed layer with temperature [kg m-3 degC-1]. dR0_dS, & ! Partial derivative of the mixed layer potential density with ! salinity [kg m-3 PSU-1]. dRcv_dS, & ! Partial derivative of the coordinate variable potential - ! density in the mixed layer with salinity, in kg m-3 psu-1. + ! density in the mixed layer with salinity [kg m-3 ppt-1]. TKE_river ! The turbulent kinetic energy available for mixing at rivermouths over a ! time step [Z m2 s-2 ~> m3 s-2]. @@ -969,13 +969,13 @@ subroutine mixedlayer_convection(h, d_eb, htot, Ttot, Stot, uhtot, vhtot, & intent(in) :: eps !< The negligibly small amount of water !! that will be left in each layer [H ~> m or kg m-2]. real, dimension(SZI_(G)), intent(in) :: dR0_dT !< The partial derivative of R0 with respect to - !! temperature, in kg m-3 degC-1. + !! temperature [kg m-3 degC-1]. real, dimension(SZI_(G)), intent(in) :: dRcv_dT !< The partial derivative of Rcv with respect to - !! temperature, in kg m-3 degC-1. + !! temperature [kg m-3 degC-1]. real, dimension(SZI_(G)), intent(in) :: dR0_dS !< The partial derivative of R0 with respect to - !! salinity, in kg m-3 psu-1. + !! salinity [kg m-3 ppt-1]. real, dimension(SZI_(G)), intent(in) :: dRcv_dS !< The partial derivative of Rcv with respect to - !! salinity, in kg m-3 psu-1. + !! salinity [kg m-3 ppt-1]. real, dimension(SZI_(G)), intent(in) :: netMassInOut !< The net mass flux (if non-Boussinesq) !! or volume flux (if Boussinesq) into the ocean !! within a time step [H ~> m or kg m-2]. (I.e. P+R-E.) @@ -1044,18 +1044,18 @@ subroutine mixedlayer_convection(h, d_eb, htot, Ttot, Stot, uhtot, vhtot, & ! h_ent between iterations [H ~> m or kg m-2]. real :: g_H2_2Rho0 ! Half the gravitational acceleration times the square of ! the conversion from H to Z divided by the mean density, - ! in m7 s-2 Z-1 H-2 kg-1. !### CHECK UNITS + ! [m7 s-2 Z-1 H-2 kg-1 ~> m4 s-2 kg-1 or m10 s-2 kg-3]. real :: Angstrom ! The minimum layer thickness [H ~> m or kg m-2]. - real :: opacity ! The opacity converted to units of H-1. + real :: opacity ! The opacity converted to inverse thickness units [H-1 ~> m-1 or m2 kg-1] real :: sum_Pen_En ! The potential energy change due to penetrating - ! shortwave radiation, integrated over a layer, in - ! H kg m-3. - real :: Idt ! 1.0/dt + ! shortwave radiation, integrated over a layer + ! [H kg m-3 ~> kg m-2 or kg2 m-5]. + real :: Idt ! 1.0/dt [s-1] real :: netHeatOut ! accumulated heat content of mass leaving ocean integer :: is, ie, nz, i, k, ks, itt, n real, dimension(max(nsw,1)) :: & - C2, & ! Temporary variable with units of kg m-3 H-1. - r_SW_top ! Temporary variables with units of H kg m-3. + C2, & ! Temporary variable [kg m-3 H-1 ~> kg m-4 or m-1]. + r_SW_top ! Temporary variables [H kg m-3 ~> kg m-2 or kg2 m-5]. Angstrom = GV%Angstrom_H C1_3 = 1.0/3.0 ; C1_6 = 1.0/6.0 @@ -1524,22 +1524,22 @@ subroutine mechanical_entrainment(h, d_eb, htot, Ttot, Stot, uhtot, vhtot, & intent(in) :: eps !< The negligibly small amount of water !! that will be left in each layer [H ~> m or kg m-2]. real, dimension(SZI_(G)), intent(in) :: dR0_dT !< The partial derivative of R0 with respect to - !! temperature, in kg m-3 degC-1. + !! temperature [kg m-3 degC-1]. real, dimension(SZI_(G)), intent(in) :: dRcv_dT !< The partial derivative of Rcv with respect to - !! temperature, in kg m-3 degC-1. + !! temperature [kg m-3 degC-1]. real, dimension(2,SZI_(G)), intent(in) :: cMKE !< Coefficients of HpE and HpE^2 used in calculating !! the denominator of MKE_rate, in m-1 and m-2. real, intent(in) :: Idt_diag !< The inverse of the accumulated diagnostic !! time interval [s-1]. integer, intent(in) :: nsw !< The number of bands of penetrating !! shortwave radiation. - real, dimension(:,:), intent(inout) :: Pen_SW_bnd !< The penetrating shortwave - !! heating at the sea surface in each - !! penetrating band, in K H, + real, dimension(:,:), intent(inout) :: Pen_SW_bnd !< The penetrating shortwave heating at the + !! sea surface in each penetrating band + !! [degC H ~> degC m or degC kg m-2], !! size nsw x SZI_(G). real, dimension(:,:,:), intent(in) :: opacity_band !< The opacity in each band of penetrating !! shortwave radiation [H-1 ~> m-1 or m2 kg-1]. - !! The indicies of opacity_band are band, i, k. + !! The indicies of opacity_band are (band, i, k). real, dimension(SZI_(G)), intent(inout) :: TKE !< The turbulent kinetic energy !! available for mixing over a time !! step [Z m2 s-2 ~> m3 s-2]. @@ -1555,7 +1555,7 @@ subroutine mechanical_entrainment(h, d_eb, htot, Ttot, Stot, uhtot, vhtot, & real :: SW_trans ! The fraction of shortwave radiation that is not ! absorbed in a layer, nondimensional. real :: Pen_absorbed ! The amount of penetrative shortwave radiation - ! that is absorbed in a layer, in units of K m. + ! that is absorbed in a layer [degC H ~> degC m or degC kg m-2]. real :: h_avail ! The thickness in a layer available for entrainment [H ~> m or kg m-2]. real :: h_ent ! The thickness from a layer that is entrained [H ~> m or kg m-2]. real :: h_min, h_max ! Limits on the solution for h_ent [H ~> m or kg m-2]. @@ -1564,12 +1564,12 @@ subroutine mechanical_entrainment(h, d_eb, htot, Ttot, Stot, uhtot, vhtot, & real :: MKE_rate ! The fraction of the energy in resolved shears ! within the mixed layer that will be eliminated ! within a timestep, nondim, 0 to 1. - real :: HpE ! The current thickness plus entrainment, H. + real :: HpE ! The current thickness plus entrainment [H ~> m or kg m-2]. real :: g_H_2Rho0 ! Half the gravitational acceleration times the ! conversion from H to m divided by the mean density, ! in m5 s-2 H-1 kg-1. - real :: TKE_full_ent ! The TKE remaining if a layer is fully entrained, - ! in units of Z m2 s-2. + real :: TKE_full_ent ! The TKE remaining if a layer is fully entrained + ! [Z m2 s-2 ~> m3 s-2]. real :: dRL ! Work required to mix water from the next layer ! across the mixed layer [m2 s-2]. real :: Pen_En_Contrib ! Penetrating SW contributions to the changes in @@ -1906,19 +1906,19 @@ subroutine resort_ML(h, T, S, R0, Rcv, RcvTgt, eps, d_ea, d_eb, ksort, G, GV, CS real, dimension(SZI_(G)), intent(in) :: dR0_dT !< The partial derivative of !! potential density referenced !! to the surface with potential - !! temperature, in kg m-3 K-1. + !! temperature [kg m-3 degC-1]. real, dimension(SZI_(G)), intent(in) :: dR0_dS !< The partial derivative of !! cpotential density referenced !! to the surface with salinity, - !! in kg m-3 psu-1. + !! [kg m-3 ppt-1]. real, dimension(SZI_(G)), intent(in) :: dRcv_dT !< The partial derivative of !! coordinate defining potential !! density with potential - !! temperature, in kg m-3 K-1. + !! temperature [kg m-3 degC-1]. real, dimension(SZI_(G)), intent(in) :: dRcv_dS !< The partial derivative of !! coordinate defining potential !! density with salinity, - !! in kg m-3 psu-1. + !! [kg m-3 ppt-1]. ! If there are no massive light layers above the deepest of the mixed- and ! buffer layers, do nothing (except perhaps to reshuffle these layers). @@ -2203,7 +2203,7 @@ subroutine mixedlayer_detrain_2(h, T, S, R0, Rcv, RcvTgt, dt, dt_diag, d_ea, j, type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: h !< Layer thickness [H ~> m or kg m-2]. !! Layer 0 is the new mixed layer. - real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: T !< Potential temperature, in C. + real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: T !< Potential temperature [degC]. real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: S !< Salinity [PSU]. real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: R0 !< Potential density referenced to !! surface pressure [kg m-3]. @@ -2223,18 +2223,18 @@ subroutine mixedlayer_detrain_2(h, T, S, R0, Rcv, RcvTgt, dt, dt_diag, d_ea, j, real, dimension(SZI_(G)), intent(in) :: dR0_dT !< The partial derivative of !! potential density referenced to the !! surface with potential temperature, - !! in kg m-3 K-1. + !! [kg m-3 degC-1]. real, dimension(SZI_(G)), intent(in) :: dR0_dS !< The partial derivative of !! cpotential density referenced to the - !! surface with salinity, - !! in kg m-3 psu-1. + !! surface with salinity + !! [kg m-3 ppt-1]. real, dimension(SZI_(G)), intent(in) :: dRcv_dT !< The partial derivative of !! coordinate defining potential density !! with potential temperature, - !! in kg m-3 K-1. + !! [kg m-3 degC-1]. real, dimension(SZI_(G)), intent(in) :: dRcv_dS !< The partial derivative of !! coordinate defining potential density - !! with salinity, in kg m-3 psu-1. + !! with salinity [kg m-3 ppt-1]. real, dimension(SZI_(G)), intent(in) :: max_BL_det !< If non-negative, the maximum !! detrainment permitted from the buffer !! layers [H ~> m or kg m-2]. @@ -3103,7 +3103,7 @@ subroutine mixedlayer_detrain_1(h, T, S, R0, Rcv, RcvTgt, dt, dt_diag, d_ea, d_e type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: h !< Layer thickness [H ~> m or kg m-2]. !! Layer 0 is the new mixed layer. - real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: T !< Potential temperature, in C. + real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: T !< Potential temperature [degC]. real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: S !< Salinity [PSU]. real, dimension(SZI_(G),SZK0_(GV)), intent(inout) :: R0 !< Potential density referenced to !! surface pressure [kg m-3]. @@ -3127,11 +3127,11 @@ subroutine mixedlayer_detrain_1(h, T, S, R0, Rcv, RcvTgt, dt, dt_diag, d_ea, d_e !! previous call to mixedlayer_init. real, dimension(SZI_(G)), intent(in) :: dRcv_dT !< The partial derivative of !! coordinate defining potential density - !! with potential temperature, - !! in kg m-3 K-1. + !! with potential temperature + !! [kg m-3 degC-1]. real, dimension(SZI_(G)), intent(in) :: dRcv_dS !< The partial derivative of !! coordinate defining potential density - !! with salinity, in kg m-3 psu-1. + !! with salinity [kg m-3 ppt-1]. real, dimension(SZI_(G)), intent(in) :: max_BL_det !< If non-negative, the maximum !! detrainment permitted from the buffer !! layers [H ~> m or kg m-2]. @@ -3145,15 +3145,15 @@ subroutine mixedlayer_detrain_1(h, T, S, R0, Rcv, RcvTgt, dt, dt_diag, d_ea, d_e ! from the mixed layer [H ~> m or kg m-2]. real :: Idt ! The inverse of the timestep [s-1]. real :: dT_dR, dS_dR, dRml, dR0_dRcv, dT_dS_wt2 - real :: I_denom ! A work variable with units of psu2 m6 kg-2. + real :: I_denom ! A work variable [ppt2 m6 kg-2]. real :: Sdown, Tdown real :: dt_Time, Timescale = 86400.0*30.0! *365.0/12.0 - real :: g_H2_2Rho0dt ! Half the gravitational acceleration times the square of - ! the conversion from H to m divided by the mean - ! density times the time step, in m7 s-3 Z-1 H-2 kg-1. !### CHECK UNITS - real :: g_H2_2dt ! Half the gravitational acceleration times the - ! square of the conversion from H to m divided - ! by the diagnostic time step, in m4 Z-1 H-2 s-3. + real :: g_H2_2Rho0dt ! Half the gravitational acceleration times the square of the + ! conversion from H to m divided by the mean density times the time + ! step [m7 s-3 Z-1 H-2 kg-1 ~> m4 s-3 kg-1 or m10 s-3 kg-3]. + real :: g_H2_2dt ! Half the gravitational acceleration times the square of the + ! conversion from H to m divided by the diagnostic time step + ! [m4 Z-1 H-2 s-3 ~> m s-3 or m7 kg-2 s-3]. logical :: splittable_BL(SZI_(G)), orthogonal_extrap real :: x1 diff --git a/src/parameterizations/vertical/MOM_entrain_diffusive.F90 b/src/parameterizations/vertical/MOM_entrain_diffusive.F90 index 5bebd8ea60..e31b078922 100644 --- a/src/parameterizations/vertical/MOM_entrain_diffusive.F90 +++ b/src/parameterizations/vertical/MOM_entrain_diffusive.F90 @@ -33,7 +33,8 @@ module MOM_entrain_diffusive !! their target variables by the diapycnal mixing. integer :: max_ent_it !< The maximum number of iterations that may be used to !! calculate the diapycnal entrainment. - real :: Tolerance_Ent !< The tolerance with which to solve for entrainment values, in m. + real :: Tolerance_Ent !< The tolerance with which to solve for entrainment values + !! [H ~> m or kg m-2]. type(diag_ctrl), pointer :: diag => NULL() !< A structure that is used to !! regulate the timing of diagnostic output. integer :: id_Kd = -1 !< Diagnostic ID for diffusivity @@ -125,7 +126,7 @@ subroutine entrainment_diffusive(u, v, h, tv, fluxes, dt, G, GV, US, CS, ea, eb, htot, & ! The total thickness above or below a layer [H ~> m or kg m-2]. Rcv, & ! Value of the coordinate variable (potential density) ! based on the simulated T and S and P_Ref [kg m-3]. - pres, & ! Reference pressure (P_Ref) in Pa. + pres, & ! Reference pressure (P_Ref) [Pa]. eakb, & ! The entrainment from above by the layer below the buffer ! layer (i.e. layer kb) [H ~> m or kg m-2]. ea_kbp1, & ! The entrainment from above by layer kb+1 [H ~> m or kg m-2]. @@ -140,7 +141,7 @@ subroutine entrainment_diffusive(u, v, h, tv, fluxes, dt, G, GV, US, CS, ea, eb, ! [H2 ~> m2 or kg2 m-4]. maxF_correct, & ! An amount by which to correct maxF due to excessive ! surface heat loss [H ~> m or kg m-2]. - zeros, & ! An array of all zeros. (Usually used with units of H.) + zeros, & ! An array of all zeros. (Usually used with [H ~> m or kg m-2].) max_eakb, & ! The maximum value of eakb that might be realized [H ~> m or kg m-2]. min_eakb, & ! The minimum value of eakb that might be realized [H ~> m or kg m-2]. err_max_eakb0, & ! The value of error returned by determine_Ea_kb @@ -1041,7 +1042,7 @@ subroutine set_Ent_bl(h, dtKd_int, tv, kb, kmb, do_i, G, GV, CS, j, Ent_bl, Sref intent(out) :: Ent_bl !< The average entrainment upward and !! downward across each interface around !! the buffer layers [H ~> m or kg m-2]. - real, dimension(SZI_(G),SZK_(G)), intent(out) :: Sref !< The coordinate potential density - + real, dimension(SZI_(G),SZK_(G)), intent(out) :: Sref !< The coordinate potential density minus !! 1000 for each layer [kg m-3]. real, dimension(SZI_(G),SZK_(G)), intent(out) :: h_bl !< The thickness of each layer [H ~> m or kg m-2]. @@ -1053,10 +1054,10 @@ subroutine set_Ent_bl(h, dtKd_int, tv, kb, kmb, do_i, G, GV, CS, j, Ent_bl, Sref ! Local variables real, dimension(SZI_(G)) :: & - b1, d1, & ! Variables used by the tridiagonal solver, in H-1 and ND. + b1, d1, & ! Variables used by the tridiagonal solver [H-1 ~> m-1 or m2 kg-1] and [nondim]. Rcv, & ! Value of the coordinate variable (potential density) - ! based on the simulated T and S and P_Ref, kg m-3. - pres, & ! Reference pressure (P_Ref) in Pa. + ! based on the simulated T and S and P_Ref [kg m-3]. + pres, & ! Reference pressure (P_Ref) [Pa]. frac_rem, & ! The fraction of the diffusion remaining [nondim]. h_interior ! The interior thickness available for entrainment [H ~> m or kg m-2]. real, dimension(SZI_(G), SZK_(G)) :: & @@ -1213,12 +1214,12 @@ subroutine determine_dSkb(h_bl, Sref, Ent_bl, E_kb, is, ie, kmb, G, GV, limit, & !! and the topmost interior layer. !! dSkb > 0. real, dimension(SZI_(G)), optional, intent(inout) :: ddSkb_dE !< The partial derivative of dSkb - !! with E, in kg m-3 H-1. + !! with E [kg m-3 H-1 ~> kg m-4 or m-1]. real, dimension(SZI_(G)), optional, intent(inout) :: dSlay !< The limited potential density !! difference across the topmost !! interior layer. 0 < dSkb real, dimension(SZI_(G)), optional, intent(inout) :: ddSlay_dE !< The partial derivative of dSlay - !! with E, in kg m-3 H-1. + !! with E [kg m-3 H-1 ~> kg m-4 or m-1]. real, dimension(SZI_(G)), optional, intent(inout) :: dS_anom_lim !< A limiting value to use for !! the density anomalies below the !! buffer layer [kg m-3]. @@ -1626,8 +1627,8 @@ subroutine determine_Ea_kb(h_bl, dtKd_kb, Sref, I_dSkbp1, Ent_bl, ea_kbp1, & dS_Lay, & ! The coordinate-density difference across layer ! kb, limited to ensure that it is positive and not ! too much bigger than dS_kb or dS_kbp1 [kg m-3]. - ddSkb_dE, ddSlay_dE, & ! The derivatives of dS_kb and dS_Lay with E, - ! in kg m-3 H-1. + ddSkb_dE, ddSlay_dE, & ! The derivatives of dS_kb and dS_Lay with E + ! [kg m-3 H-1 ~> kg m-4 or m-1]. derror_dE, & ! The derivative of err with E [H ~> m or kg m-2]. err, & ! The "error" whose zero is being sought [H2 ~> m2 or kg2 m-4]. E_min, E_max, & ! The minimum and maximum values of E [H ~> m or kg m-2]. diff --git a/src/parameterizations/vertical/MOM_full_convection.F90 b/src/parameterizations/vertical/MOM_full_convection.F90 index 7851e4806c..866dd16114 100644 --- a/src/parameterizations/vertical/MOM_full_convection.F90 +++ b/src/parameterizations/vertical/MOM_full_convection.F90 @@ -39,7 +39,7 @@ subroutine full_convection(G, GV, h, tv, T_adj, S_adj, p_surf, Kddt_smooth, & ! Local variables real, dimension(SZI_(G),SZK_(G)+1) :: & drho_dT, & ! The derivatives of density with temperature and - drho_dS ! salinity, in kg m-3 K-1 and kg m-3 psu-1. + drho_dS ! salinity [kg m-3 degC-1] and [kg m-3 ppt-1]. real :: h_neglect, h0 ! A thickness that is so small it is usually lost ! in roundoff and can be neglected [H ~> m or kg m-2]. ! logical :: use_EOS ! If true, density is calculated from T & S using an equation of state. @@ -281,8 +281,8 @@ end subroutine full_convection !! above and below, including partial calculations from a tridiagonal solver. function is_unstable(dRho_dT, dRho_dS, h_a, h_b, mix_A, mix_B, T_a, T_b, S_a, S_b, & Te_aa, Te_bb, Se_aa, Se_bb, d_A, d_B) - real, intent(in) :: dRho_dT !< The derivative of in situ density with temperature in kg m-3 degC-1 - real, intent(in) :: dRho_dS !< The derivative of in situ density with salinity in kg m-3 ppt-1 + real, intent(in) :: dRho_dT !< The derivative of in situ density with temperature [kg m-3 degC-1] + real, intent(in) :: dRho_dS !< The derivative of in situ density with salinity [kg m-3 ppt-1] real, intent(in) :: h_a !< The thickness of the layer above [H ~> m or kg m-2] real, intent(in) :: h_b !< The thickness of the layer below [H ~> m or kg m-2] real, intent(in) :: mix_A !< The time integrated mixing rate of the interface above [H ~> m or kg m-2] @@ -327,10 +327,10 @@ subroutine smoothed_dRdT_dRdS(h, tv, Kddt, dR_dT, dR_dS, G, GV, j, p_surf, halo) real, intent(in) :: Kddt !< A diffusivity times a time increment [H2 ~> m2 or kg2 m-4]. real, dimension(SZI_(G),SZK_(G)+1), & intent(out) :: dR_dT !< Derivative of locally referenced - !! potential density with temperature, kg m-3 K-1 + !! potential density with temperature [kg m-3 degC-1] real, dimension(SZI_(G),SZK_(G)+1), & intent(out) :: dR_dS !< Derivative of locally referenced - !! potential density with salinity, kg m-3 ppt-1 + !! potential density with salinity [kg m-3 ppt-1] integer, intent(in) :: j !< The j-point to work on. real, dimension(:,:), pointer :: p_surf !< The pressure at the ocean surface in Pa (or NULL). integer, optional, intent(in) :: halo !< Halo width over which to compute diff --git a/src/parameterizations/vertical/MOM_internal_tide_input.F90 b/src/parameterizations/vertical/MOM_internal_tide_input.F90 index 5f00086e17..daf6ae043c 100644 --- a/src/parameterizations/vertical/MOM_internal_tide_input.F90 +++ b/src/parameterizations/vertical/MOM_internal_tide_input.F90 @@ -153,7 +153,7 @@ subroutine find_N2_bottom(h, tv, T_f, S_f, h2, fluxes, G, GV, US, N2_bot) hb, & ! The depth below a layer [Z ~> m]. z_from_bot, & ! The height of a layer center above the bottom [Z ~> m]. dRho_dT, & ! The partial derivatives of density with temperature and - dRho_dS ! salinity, in kg m-3 degC-1 and kg m-3 PSU-1. + dRho_dS ! salinity [kg m-3 degC-1] and [kg m-3 ppt-1]. real :: dz_int ! The thickness associated with an interface [Z ~> m]. real :: G_Rho0 ! The gravitation acceleration divided by the Boussinesq diff --git a/src/parameterizations/vertical/MOM_set_diffusivity.F90 b/src/parameterizations/vertical/MOM_set_diffusivity.F90 index 714a58e238..c717689140 100644 --- a/src/parameterizations/vertical/MOM_set_diffusivity.F90 +++ b/src/parameterizations/vertical/MOM_set_diffusivity.F90 @@ -892,8 +892,8 @@ subroutine find_N2(h, tv, T_f, S_f, fluxes, j, G, GV, US, CS, dRho_int, & ! Local variables real, dimension(SZI_(G),SZK_(G)+1) :: & dRho_int_unfilt, & ! unfiltered density differences across interfaces - dRho_dT, & ! partial derivative of density wrt temp (kg m-3 degC-1) - dRho_dS ! partial derivative of density wrt saln (kg m-3 PPT-1) + dRho_dT, & ! partial derivative of density wrt temp [kg m-3 degC-1] + dRho_dS ! partial derivative of density wrt saln [kg m-3 ppt-1] real, dimension(SZI_(G)) :: & pres, & ! pressure at each interface (Pa) @@ -1063,8 +1063,8 @@ subroutine double_diffusion(tv, h, T_f, S_f, j, G, GV, US, CS, Kd_T_dd, Kd_S_dd) !! diffusivity for saln [Z2 s-1 ~> m2 s-1]. real, dimension(SZI_(G)) :: & - dRho_dT, & ! partial derivatives of density wrt temp (kg m-3 degC-1) - dRho_dS, & ! partial derivatives of density wrt saln (kg m-3 PPT-1) + dRho_dT, & ! partial derivatives of density wrt temp [kg m-3 degC-1] + dRho_dS, & ! partial derivatives of density wrt saln [kg m-3 ppt-1] pres, & ! pressure at each interface (Pa) Temp_int, & ! temp and saln at interfaces Salin_int diff --git a/src/parameterizations/vertical/MOM_set_viscosity.F90 b/src/parameterizations/vertical/MOM_set_viscosity.F90 index d5fc24f16d..caf6c52ee5 100644 --- a/src/parameterizations/vertical/MOM_set_viscosity.F90 +++ b/src/parameterizations/vertical/MOM_set_viscosity.F90 @@ -125,15 +125,15 @@ subroutine set_viscous_BBL(u, v, h, tv, visc, G, GV, US, CS, symmetrize) ! Local variables real, dimension(SZIB_(G)) :: & - ustar, & ! The bottom friction velocity [m s-1]. + ustar, & ! The bottom friction velocity [Z s-1 ~> m s-1]. T_EOS, & ! The temperature used to calculate the partial derivatives ! of density with T and S [degC]. S_EOS, & ! The salinity used to calculate the partial derivatives - ! of density with T and S [PSU]. + ! of density with T and S [ppt]. dR_dT, & ! Partial derivative of the density in the bottom boundary ! layer with temperature [kg m-3 degC-1]. dR_dS, & ! Partial derivative of the density in the bottom boundary - ! layer with salinity [kg m-3 PSU-1]. + ! layer with salinity [kg m-3 ppt-1]. press ! The pressure at which dR_dT and dR_dS are evaluated [Pa]. real :: htot ! Sum of the layer thicknesses up to some point [H ~> m or kg m-2]. real :: htot_vel ! Sum of the layer thicknesses up to some point [H ~> m or kg m-2]. @@ -165,7 +165,7 @@ subroutine set_viscous_BBL(u, v, h, tv, visc, G, GV, US, CS, symmetrize) ! plus H_neglect to avoid 0 values [H ~> m or kg m-2]. real :: ustarsq ! 400 times the square of ustar, times ! Rho0 divided by G_Earth and the conversion - ! from m to thickness units, in kg m-2 or kg2 m-5. + ! from m to thickness units [H kg m-3 ~> kg m-2 or kg2 m-5]. real :: cdrag_sqrt_Z ! Square root of the drag coefficient, times a unit conversion ! factor from lateral lengths to vertical depths [Z m-1 ~> 1]. real :: cdrag_sqrt ! Square root of the drag coefficient [nondim]. diff --git a/src/parameterizations/vertical/MOM_sponge.F90 b/src/parameterizations/vertical/MOM_sponge.F90 index 758f15e2e2..eaa2faf765 100644 --- a/src/parameterizations/vertical/MOM_sponge.F90 +++ b/src/parameterizations/vertical/MOM_sponge.F90 @@ -56,7 +56,7 @@ module MOM_sponge integer, pointer :: col_j(:) => NULL() !< Array of the j-indicies of each of the columns being damped. real, pointer :: Iresttime_col(:) => NULL() !< The inverse restoring time of each column. real, pointer :: Rcv_ml_ref(:) => NULL() !< The value toward which the mixed layer - !! coordinate-density is being damped, in kg m-3. + !! coordinate-density is being damped [kg m-3]. real, pointer :: Ref_eta(:,:) => NULL() !< The value toward which the interface !! heights are being damped [Z ~> m]. type(p3d) :: var(MAX_FIELDS_) !< Pointers to the fields that are being damped. @@ -66,7 +66,7 @@ module MOM_sponge real, pointer :: Iresttime_im(:) => NULL() !< The inverse restoring time of !! each row for i-mean sponges. real, pointer :: Rcv_ml_ref_im(:) => NULL() !! The value toward which the i-mean - !< mixed layer coordinate-density is being damped, in kg m-3. + !< mixed layer coordinate-density is being damped [kg m-3]. real, pointer :: Ref_eta_im(:,:) => NULL() !< The value toward which the i-mean !! interface heights are being damped [Z ~> m]. type(p2d) :: Ref_val_im(MAX_FIELDS_) !< The values toward which the i-means of @@ -273,12 +273,12 @@ end subroutine set_up_sponge_field subroutine set_up_sponge_ML_density(sp_val, G, CS, sp_val_i_mean) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure real, dimension(SZI_(G),SZJ_(G)), & - intent(in) :: sp_val !< The reference values of the mixed layer density, in kg m-3 + intent(in) :: sp_val !< The reference values of the mixed layer density [kg m-3] type(sponge_CS), pointer :: CS !< A pointer to the control structure for this module that is !! set by a previous call to initialize_sponge. real, dimension(SZJ_(G)), & optional, intent(in) :: sp_val_i_mean !< the reference values of the zonal mean mixed - !! layer density in kg m-3, for use if Iresttime_i_mean > 0. + !! layer density [kg m-3], for use if Iresttime_i_mean > 0. ! This subroutine stores the reference value for mixed layer density. It is ! handled differently from other values because it is only used in determining ! which layers can be inflated. diff --git a/src/tracer/MOM_offline_main.F90 b/src/tracer/MOM_offline_main.F90 index 5b395d4a58..4f6ce6b5bb 100644 --- a/src/tracer/MOM_offline_main.F90 +++ b/src/tracer/MOM_offline_main.F90 @@ -208,9 +208,9 @@ subroutine offline_advection_ale(fluxes, Time_start, time_interval, CS, id_clock intent(inout) :: h_pre !< layer thicknesses before advection !! [H ~> m or kg m-2] real, dimension(SZIB_(CS%G),SZJ_(CS%G),SZK_(CS%G)), & - intent(inout) :: uhtr !< Zonal mass transport in m3 or kg + intent(inout) :: uhtr !< Zonal mass transport [H m2 ~> m3 or kg] real, dimension(SZI_(CS%G),SZJB_(CS%G),SZK_(CS%G)), & - intent(inout) :: vhtr !< Meridional mass transport in m3 or kg + intent(inout) :: vhtr !< Meridional mass transport [H m2 ~> m3 or kg] logical, intent( out) :: converged !< True if the iterations have converged ! Local pointers @@ -649,9 +649,9 @@ subroutine offline_diabatic_ale(fluxes, Time_start, Time_end, CS, h_pre, eatr, e real, dimension(SZI_(CS%G),SZJ_(CS%G),SZK_(CS%G)), & intent(inout) :: h_pre !< layer thicknesses before advection [H ~> m or kg m-2] real, dimension(SZI_(CS%G),SZJ_(CS%G),SZK_(CS%G)), & - intent(inout) :: eatr !< Entrainment from layer above in m or kg-2 + intent(inout) :: eatr !< Entrainment from layer above [H ~> m or kg m-2] real, dimension(SZI_(CS%G),SZJ_(CS%G),SZK_(CS%G)), & - intent(inout) :: ebtr !< Entrainment from layer below in m or kg-2 + intent(inout) :: ebtr !< Entrainment from layer below [H ~> m or kg m-2] real, dimension(SZI_(CS%G),SZJ_(CS%G)) :: sw, sw_vis, sw_nir !< Save old value of shortwave radiation real :: hval diff --git a/src/tracer/MOM_tracer_hor_diff.F90 b/src/tracer/MOM_tracer_hor_diff.F90 index bc212617a0..7884823acc 100644 --- a/src/tracer/MOM_tracer_hor_diff.F90 +++ b/src/tracer/MOM_tracer_hor_diff.F90 @@ -133,13 +133,13 @@ subroutine tracer_hordiff(h, dt, MEKE, VarMix, G, GV, CS, Reg, tv, do_online_fla khdt_x, & ! The value of Khtr*dt times the open face width divided by ! the distance between adjacent tracer points, in m2. Coef_x, & ! The coefficients relating zonal tracer differences - ! to time-integrated fluxes, in m3 or kg. + ! to time-integrated fluxes [H m2 ~> m3 or kg]. Kh_u ! Tracer mixing coefficient at u-points, in m2 s-1. real, dimension(SZI_(G),SZJB_(G)) :: & khdt_y, & ! The value of Khtr*dt times the open face width divided by ! the distance between adjacent tracer points, in m2. Coef_y, & ! The coefficients relating meridional tracer differences - ! to time-integrated fluxes, in m3 or kg. + ! to time-integrated fluxes [H m2 ~> m3 or kg]. Kh_v ! Tracer mixing coefficient at u-points, in m2 s-1. real :: khdt_max ! The local limiting value of khdt_x or khdt_y, in m2. diff --git a/src/user/BFB_surface_forcing.F90 b/src/user/BFB_surface_forcing.F90 index 687cabcfb3..811d8ca5b6 100644 --- a/src/user/BFB_surface_forcing.F90 +++ b/src/user/BFB_surface_forcing.F90 @@ -71,9 +71,9 @@ subroutine BFB_buoyancy_forcing(state, fluxes, day, dt, G, CS) real :: Salin_restore ! The salinity that is being restored toward [PSU]. real :: density_restore ! The potential density that is being restored ! toward [kg m-3]. - real :: rhoXcp ! The mean density times the heat capacity, in J m-3 K-1. + real :: rhoXcp ! The mean density times the heat capacity [J m-3 degC-1]. real :: buoy_rest_const ! A constant relating density anomalies to the - ! restoring buoyancy flux, in m5 s-3 kg-1. + ! restoring buoyancy flux [m5 s-3 kg-1]. integer :: i, j, is, ie, js, je integer :: isd, ied, jsd, jed @@ -156,7 +156,7 @@ subroutine BFB_buoyancy_forcing(state, fluxes, day, dt, G, CS) Temp_restore = 0.0 do j=js,je ; do i=is,ie ! Set density_restore to an expression for the surface potential - ! density in kg m-3 that is being restored toward. + ! density [kg m-3] that is being restored toward. if (G%geoLatT(i,j) < CS%lfrslat) then Temp_restore = CS%SST_s elseif (G%geoLatT(i,j) > CS%lfrnlat) then diff --git a/src/user/DOME_initialization.F90 b/src/user/DOME_initialization.F90 index cf492cf99e..98f142ff74 100644 --- a/src/user/DOME_initialization.F90 +++ b/src/user/DOME_initialization.F90 @@ -259,10 +259,10 @@ subroutine DOME_set_OBC_data(OBC, tv, G, GV, US, param_file, tr_Reg) ! Local variables ! The following variables are used to set the target temperature and salinity. real :: T0(SZK_(G)), S0(SZK_(G)) - real :: pres(SZK_(G)) ! An array of the reference pressure in Pa. - real :: drho_dT(SZK_(G)) ! Derivative of density with temperature in kg m-3 K-1. ! - real :: drho_dS(SZK_(G)) ! Derivative of density with salinity in kg m-3 PSU-1. ! - real :: rho_guess(SZK_(G)) ! Potential density at T0 & S0 in kg m-3. + real :: pres(SZK_(G)) ! An array of the reference pressure [Pa]. + real :: drho_dT(SZK_(G)) ! Derivative of density with temperature [kg m-3 degC-1]. + real :: drho_dS(SZK_(G)) ! Derivative of density with salinity [kg m-3 ppt-1]. + real :: rho_guess(SZK_(G)) ! Potential density at T0 & S0 [kg m-3]. ! The following variables are used to set up the transport in the DOME example. real :: tr_0, y1, y2, tr_k, rst, rsb, rc, v_k, lon_im1 real :: D_edge ! The thickness [Z ~> m], of the dense fluid at the diff --git a/src/user/ISOMIP_initialization.F90 b/src/user/ISOMIP_initialization.F90 index bd2ad1f1d6..dfa9b1d892 100644 --- a/src/user/ISOMIP_initialization.F90 +++ b/src/user/ISOMIP_initialization.F90 @@ -252,8 +252,8 @@ subroutine ISOMIP_initialize_temperature_salinity ( T, S, h, G, GV, param_file, eqn_of_state, just_read_params) type(ocean_grid_type), intent(in) :: G !< Ocean grid structure type(verticalGrid_type), intent(in) :: GV !< Vertical grid structure - 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(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 !< Layer thickness [H ~> m or kg m-2] type(param_file_type), intent(in) :: param_file !< Parameter file structure type(EOS_type), pointer :: eqn_of_state !< Equation of state structure @@ -263,19 +263,21 @@ subroutine ISOMIP_initialize_temperature_salinity ( T, S, h, G, GV, param_file, integer :: i, j, k, is, ie, js, je, nz, itt real :: x, ds, dt, rho_sur, rho_bot real :: xi0, xi1 ! Heights in depth units [Z ~> m]. - real :: S_sur, T_sur, S_bot, T_bot - real :: dT_dz, dS_dz ! Gradients of T and S in degC/Z and PPT/Z. - real :: z ! vertical position in z space - character(len=256) :: mesg ! The text of an error message + real :: S_sur, S_bot ! Salinity at the surface and bottom [ppt] + real :: T_sur, T_bot ! Temperature at the bottom [degC] + real :: dT_dz ! Vertical gradient of temperature [degC Z-1 ~> degC m-1]. + real :: dS_dz ! Vertical gradient of salinity [ppt Z-1 ~> ppt m-1]. + real :: z ! vertical position in z space [Z ~> m] + character(len=256) :: mesg ! The text of an error message character(len=40) :: verticalCoordinate, density_profile real :: rho_tmp - logical :: just_read ! If true, just read parameters but set nothing. + logical :: just_read ! If true, just read parameters but set nothing. logical :: fit_salin ! If true, accept the prescribed temperature and fit the salinity. real :: T0(SZK_(G)), S0(SZK_(G)) - real :: drho_dT(SZK_(G)) ! Derivative of density with temperature in kg m-3 K-1. ! - real :: drho_dS(SZK_(G)) ! Derivative of density with salinity in kg m-3 PSU-1. ! - real :: rho_guess(SZK_(G)) ! Potential density at T0 & S0 in kg m-3. - real :: pres(SZK_(G)) ! An array of the reference pressure in Pa. (zero here) + real :: drho_dT(SZK_(G)) ! Derivative of density with temperature [kg m-3 degC-1]. + real :: drho_dS(SZK_(G)) ! Derivative of density with salinity [kg m-3 ppt-1]. + real :: rho_guess(SZK_(G)) ! Potential density at T0 & S0 [kg m-3]. + real :: pres(SZK_(G)) ! An array of the reference pressure [Pa]. (zero here) real :: drho_dT1, drho_dS1, T_Ref, S_Ref is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = G%ke pres(:) = 0.0 diff --git a/src/user/Phillips_initialization.F90 b/src/user/Phillips_initialization.F90 index ef9ebdf46e..357396b794 100644 --- a/src/user/Phillips_initialization.F90 +++ b/src/user/Phillips_initialization.F90 @@ -354,10 +354,10 @@ end subroutine Phillips_initialize_topography !! D - Basin depth in m. (Must be positive.) !! f - The Coriolis parameter [s-1]. !! g - The reduced gravity at each interface [m s-2] -!! Rlay - Layer potential density (coordinate variable) in kg m-3. +!! Rlay - Layer potential density (coordinate variable) [kg m-3]. !! If ENABLE_THERMODYNAMICS is defined: -!! T - Temperature in C. -!! S - Salinity in psu. +!! T - Temperature [degC]. +!! S - Salinity [ppt]. !! If SPONGE is defined: !! A series of subroutine calls are made to set up the damping !! rates and reference profiles for all variables that are damped diff --git a/src/user/benchmark_initialization.F90 b/src/user/benchmark_initialization.F90 index cfbad108f2..859a878446 100644 --- a/src/user/benchmark_initialization.F90 +++ b/src/user/benchmark_initialization.F90 @@ -94,7 +94,7 @@ subroutine benchmark_initialize_thickness(h, G, GV, US, param_file, eqn_of_state type(EOS_type), pointer :: eqn_of_state !< integer that selects the !! equation of state. real, intent(in) :: P_Ref !< The coordinate-density - !! reference pressure in Pa. + !! reference pressure [Pa]. logical, optional, intent(in) :: just_read_params !< If present and true, this call will !! only read parameters without changing h. ! Local variables @@ -222,17 +222,15 @@ subroutine benchmark_init_temperature_salinity(T, S, G, GV, param_file, & type(EOS_type), pointer :: eqn_of_state !< integer that selects the !! equation of state. real, intent(in) :: P_Ref !< The coordinate-density - !! reference pressure in Pa. + !! reference pressure [Pa]. logical, optional, intent(in) :: just_read_params !< If present and true, this call will !! only read parameters without changing h. ! Local variables real :: T0(SZK_(G)), S0(SZK_(G)) - real :: pres(SZK_(G)) ! Reference pressure in kg m-3. ! - real :: drho_dT(SZK_(G)) ! Derivative of density with temperature in ! - ! kg m-3 K-1. ! - real :: drho_dS(SZK_(G)) ! Derivative of density with salinity in ! - ! kg m-3 PSU-1. ! - real :: rho_guess(SZK_(G)) ! Potential density at T0 & S0 in kg m-3. ! + real :: pres(SZK_(G)) ! Reference pressure [kg m-3]. + real :: drho_dT(SZK_(G)) ! Derivative of density with temperature [kg m-3 degC-1]. + real :: drho_dS(SZK_(G)) ! Derivative of density with salinity [kg m-3 ppt-1]. + real :: rho_guess(SZK_(G)) ! Potential density at T0 & S0 [kg m-3]. real :: PI ! 3.1415926... calculated as 4*atan(1) real :: SST ! The initial sea surface temperature [degC]. real :: lat diff --git a/src/user/dumbbell_surface_forcing.F90 b/src/user/dumbbell_surface_forcing.F90 index 2f9f52e49c..340a34c2db 100644 --- a/src/user/dumbbell_surface_forcing.F90 +++ b/src/user/dumbbell_surface_forcing.F90 @@ -32,7 +32,7 @@ module dumbbell_surface_forcing real :: Flux_const !< The restoring rate at the surface [m s-1]. real :: gust_const !< A constant unresolved background gustiness !! that contributes to ustar [Pa]. - real :: slp_amplitude !< The amplitude of pressure loading (in Pa) applied + real :: slp_amplitude !< The amplitude of pressure loading [Pa] applied !! to the reservoirs real :: slp_period !< Period of sinusoidal pressure wave real, dimension(:,:), allocatable :: & @@ -60,13 +60,13 @@ subroutine dumbbell_buoyancy_forcing(state, fluxes, day, dt, G, CS) type(dumbbell_surface_forcing_CS), pointer :: CS !< A control structure returned by a previous !! call to dumbbell_surface_forcing_init ! Local variables - real :: Temp_restore ! The temperature that is being restored toward, in C. + real :: Temp_restore ! The temperature that is being restored toward [degC]. real :: Salin_restore ! The salinity that is being restored toward [PSU]. real :: density_restore ! The potential density that is being restored ! toward [kg m-3]. - real :: rhoXcp ! The mean density times the heat capacity, in J m-3 K-1. + real :: rhoXcp ! The mean density times the heat capacity [J m-3 degC-1]. real :: buoy_rest_const ! A constant relating density anomalies to the - ! restoring buoyancy flux, in m5 s-3 kg-1. + ! restoring buoyancy flux [m5 s-3 kg-1]. integer :: i, j, is, ie, js, je integer :: isd, ied, jsd, jed @@ -123,7 +123,7 @@ subroutine dumbbell_buoyancy_forcing(state, fluxes, day, dt, G, CS) if (CS%use_temperature .and. CS%restorebuoy) then do j=js,je ; do i=is,ie ! Set density_restore to an expression for the surface potential - ! density in kg m-3 that is being restored toward. + ! density [kg m-3] that is being restored toward. if (CS%forcing_mask(i,j)>0.) then fluxes%vprec(i,j) = - (G%mask2dT(i,j) * (CS%Rho0*CS%Flux_const)) * & ((CS%S_restore(i,j) - state%SSS(i,j)) / & diff --git a/src/user/user_change_diffusivity.F90 b/src/user/user_change_diffusivity.F90 index 9438e0d4f9..4d9fb72a4e 100644 --- a/src/user/user_change_diffusivity.F90 +++ b/src/user/user_change_diffusivity.F90 @@ -26,12 +26,12 @@ module user_change_diffusivity !> Control structure for user_change_diffusivity type, public :: user_change_diff_CS ; private real :: Kd_add !< The scale of a diffusivity that is added everywhere - !! without any filtering or scaling, in m2 s-1. + !! without any filtering or scaling [Z2 s-1 ~> m2 s-1]. real :: lat_range(4) !< 4 values that define the latitude range over which - !! a diffusivity scaled by Kd_add is added, in deg. + !! a diffusivity scaled by Kd_add is added [degLat]. real :: rho_range(4) !< 4 values that define the coordinate potential !! density range over which a diffusivity scaled by - !! Kd_add is added, in kg m-3. + !! Kd_add is added [kg m-3]. logical :: use_abs_lat !< If true, use the absolute value of latitude when !! setting lat_range. type(diag_ctrl), pointer :: diag => NULL() !< A structure that is used to @@ -57,14 +57,14 @@ subroutine user_change_diff(h, tv, G, GV, CS, Kd_lay, Kd_int, T_f, S_f, Kd_int_a real, dimension(SZI_(G),SZJ_(G),SZK_(G)+1), optional, intent(inout) :: Kd_int !< The diapycnal diffusivity !! at each interface [Z2 s-1 ~> m2 s-1]. real, dimension(SZI_(G),SZJ_(G),SZK_(G)), optional, intent(in) :: T_f !< Temperature with massless - !! layers filled in vertically. + !! layers filled in vertically [degC]. real, dimension(SZI_(G),SZJ_(G),SZK_(G)), optional, intent(in) :: S_f !< Salinity with massless - !! layers filled in vertically. + !! layers filled in vertically [ppt]. real, dimension(:,:,:), optional, pointer :: Kd_int_add !< The diapycnal !! diffusivity that is being added at !! each interface [Z2 s-1 ~> m2 s-1]. ! Local variables - real :: Rcv(SZI_(G),SZK_(G)) ! The coordinate density in layers in kg m-3. + real :: Rcv(SZI_(G),SZK_(G)) ! The coordinate density in layers [kg m-3]. real :: p_ref(SZI_(G)) ! An array of tv%P_Ref pressures. real :: rho_fn ! The density dependence of the input function, 0-1, ND. real :: lat_fn ! The latitude dependence of the input function, 0-1, ND.