MOM6
mom_eos_linear Module Reference

Data Types

interface  calculate_density_linear
 

Functions/Subroutines

subroutine, public calculate_density_scalar_linear (T, S, pressure, rho, Rho_T0_S0, dRho_dT, dRho_dS)
 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 in deg C), and pressure in Pa. More...
 
subroutine, public calculate_density_array_linear (T, S, pressure, rho, start, npts, Rho_T0_S0, dRho_dT, dRho_dS)
 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 in deg C), and pressure in Pa. More...
 
subroutine, public calculate_density_derivs_linear (T, S, pressure, drho_dT_out, drho_dS_out, start, npts, Rho_T0_S0, dRho_dT, dRho_dS)
 This subroutine calculates the partial derivatives of density * with potential temperature and salinity. More...
 
subroutine, public calculate_specvol_derivs_linear (T, S, pressure, dSV_dT, dSV_dS, start, npts, Rho_T0_S0, dRho_dT, dRho_dS)
 
subroutine, public calculate_compress_linear (T, S, pressure, rho, drho_dp, start, npts, Rho_T0_S0, dRho_dT, dRho_dS)
 This subroutine computes the in situ density of sea water (rho) and the compressibility (drho/dp == C_sound^-2) at the given salinity, potential temperature, and pressure. More...
 
subroutine, public int_density_dz_linear (T, S, z_t, z_b, rho_ref, rho_0_pres, G_e, HII, HIO, Rho_T0_S0, dRho_dT, dRho_dS, dpa, intz_dpa, intx_dpa, inty_dpa)
 This subroutine calculates analytical and nearly-analytical integrals of pressure anomalies across layers, which are required for calculating the finite-volume form pressure accelerations in a Boussinesq model. More...
 
subroutine, public int_spec_vol_dp_linear (T, S, p_t, p_b, alpha_ref, HI, Rho_T0_S0, dRho_dT, dRho_dS, dza, intp_dza, intx_dza, inty_dza, halo_size)
 This subroutine calculates analytical and nearly-analytical integrals in pressure across layers of geopotential anomalies, which are required for calculating the finite-volume form pressure accelerations in a non-Boussinesq model. Specific volume is assumed to vary linearly between adjacent points. More...
 

Function/Subroutine Documentation

◆ calculate_compress_linear()

subroutine, public mom_eos_linear::calculate_compress_linear ( real, dimension(:), intent(in)  T,
real, dimension(:), intent(in)  S,
real, dimension(:), intent(in)  pressure,
real, dimension(:), intent(out)  rho,
real, dimension(:), intent(out)  drho_dp,
integer, intent(in)  start,
integer, intent(in)  npts,
real, intent(in)  Rho_T0_S0,
real, intent(in)  dRho_dT,
real, intent(in)  dRho_dS 
)

This subroutine computes the in situ density of sea water (rho) and the compressibility (drho/dp == C_sound^-2) at the given salinity, potential temperature, and pressure.

Parameters
[in]tPotential temperature relative to the surface in C.
[in]sSalinity in PSU.
[in]pressurePressure in Pa.
[out]rhoIn situ density in kg m-3.
[out]drho_dpThe partial derivative of density with pressure (also the inverse of the square of sound speed) in s2 m-2.
[in]startThe starting point in the arrays.
[in]nptsThe number of values to calculate.
[in]rho_t0_s0The density at T=0, S=0, in kg m-3.
[in]drho_dsThe derivatives of density with temperature and salinity, in kg m-3 C-1 and kg m-3 psu-1.

Definition at line 203 of file MOM_EOS_linear.F90.

Referenced by mom_eos::calculate_compress().

203  real, intent(in), dimension(:) :: t !< Potential temperature relative to the surface
204  !! in C.
205  real, intent(in), dimension(:) :: s !< Salinity in PSU.
206  real, intent(in), dimension(:) :: pressure !< Pressure in Pa.
207  real, intent(out), dimension(:) :: rho !< In situ density in kg m-3.
208  real, intent(out), dimension(:) :: drho_dp !< The partial derivative of density with pressure
209  !! (also the inverse of the square of sound speed)
210  !! in s2 m-2.
211  integer, intent(in) :: start !< The starting point in the arrays.
212  integer, intent(in) :: npts !< The number of values to calculate.
213  real, intent(in) :: rho_t0_s0 !< The density at T=0, S=0, in kg m-3.
214  real, intent(in) :: drho_dt, drho_ds !< The derivatives of density with
215  !! temperature and salinity, in kg m-3 C-1
216  !! and kg m-3 psu-1.
217 
218 ! * This subroutine computes the in situ density of sea water (rho) *
219 ! * and the compressibility (drho/dp == C_sound^-2) at the given *
220 ! * salinity, potential temperature, and pressure. *
221 ! * *
222 ! * Arguments: T - potential temperature relative to the surface in C. *
223 ! * (in) S - salinity in PSU. *
224 ! * (in) pressure - pressure in Pa. *
225 ! * (out) rho - in situ density in kg m-3. *
226 ! * (out) drho_dp - the partial derivative of density with *
227 ! * pressure (also the inverse of the square of *
228 ! * sound speed) in s2 m-2. *
229 ! * (in) start - the starting point in the arrays. *
230 ! * (in) npts - the number of values to calculate. *
231 ! * (in) Rho_T0_S0 - The density at T=0, S=0, in kg m-3. *
232 ! * (in) dRho_dT - The derivatives of density with temperature *
233 ! * (in) dRho_dS - and salinity, in kg m-3 C-1 and kg m-3 psu-1. *
234 
235  integer :: j
236 
237  do j=start,start+npts-1
238  rho(j) = rho_t0_s0 + drho_dt*t(j) + drho_ds*s(j)
239  drho_dp(j) = 0.0
240  enddo
Here is the caller graph for this function:

◆ calculate_density_array_linear()

subroutine, public mom_eos_linear::calculate_density_array_linear ( real, dimension(:), intent(in)  T,
real, dimension(:), intent(in)  S,
real, dimension(:), intent(in)  pressure,
real, dimension(:), intent(out)  rho,
integer, intent(in)  start,
integer, intent(in)  npts,
real, intent(in)  Rho_T0_S0,
real, intent(in)  dRho_dT,
real, intent(in)  dRho_dS 
)

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 in deg C), and pressure in Pa.

Parameters
[in]tPotential temperature relative to the surface in C.
[in]sSalinity in PSU.
[in]pressurePressure in Pa.
[out]rhoIn situ density in kg m-3.
[in]startThe starting point in the arrays.
[in]nptsThe number of values to calculate.
[in]rho_t0_s0The density at T=0, S=0, in kg m-3.
[in]drho_dsThe derivatives of density with temperature and salinity, in kg m-3 C-1 and kg m-3 psu-1.

Definition at line 83 of file MOM_EOS_linear.F90.

83  real, intent(in), dimension(:) :: t !< Potential temperature relative to the surface
84  !! in C.
85  real, intent(in), dimension(:) :: s !< Salinity in PSU.
86  real, intent(in), dimension(:) :: pressure !< Pressure in Pa.
87  real, intent(out), dimension(:) :: rho !< In situ density in kg m-3.
88  integer, intent(in) :: start !< The starting point in the arrays.
89  integer, intent(in) :: npts !< The number of values to calculate.
90  real, intent(in) :: rho_t0_s0 !< The density at T=0, S=0, in kg m-3.
91  real, intent(in) :: drho_dt, drho_ds !< The derivatives of density with
92  !! temperature and salinity, in kg m-3 C-1
93  !! and kg m-3 psu-1.
94 
95 ! * This subroutine computes the density of sea water with a trivial *
96 ! * linear equation of state (in kg/m^3) from salinity (sal in psu), *
97 ! * potential temperature (T in deg C), and pressure in Pa. *
98 ! * *
99 ! * Arguments: T - potential temperature relative to the surface in C. *
100 ! * (in) S - salinity in PSU. *
101 ! * (in) pressure - pressure in Pa. *
102 ! * (out) rho - in situ density in kg m-3. *
103 ! * (in) start - the starting point in the arrays. *
104 ! * (in) npts - the number of values to calculate. *
105 ! * (in) Rho_T0_S0 - The density at T=0, S=0, in kg m-3. *
106 ! * (in) dRho_dT - The derivatives of density with temperature *
107 ! * (in) dRho_dS - and salinity, in kg m-3 C-1 and kg m-3 psu-1. *
108  real :: al0, p0, lambda
109  integer :: j
110 
111  do j=start,start+npts-1
112  rho(j) = rho_t0_s0 + drho_dt*t(j) + drho_ds*s(j)
113  enddo

◆ calculate_density_derivs_linear()

subroutine, public mom_eos_linear::calculate_density_derivs_linear ( real, dimension(:), intent(in)  T,
real, dimension(:), intent(in)  S,
real, dimension(:), intent(in)  pressure,
real, dimension(:), intent(out)  drho_dT_out,
real, dimension(:), intent(out)  drho_dS_out,
integer, intent(in)  start,
integer, intent(in)  npts,
real, intent(in)  Rho_T0_S0,
real, intent(in)  dRho_dT,
real, intent(in)  dRho_dS 
)

This subroutine calculates the partial derivatives of density * with potential temperature and salinity.

Parameters
[in]tPotential temperature relative to the surface in C.
[in]sSalinity in PSU.
[in]pressurePressure in Pa.
[out]drho_dt_outThe partial derivative of density with potential temperature, in kg m-3 K-1.
[out]drho_ds_outThe partial derivative of density with salinity, in kg m-3 psu-1.
[in]startThe starting point in the arrays.
[in]nptsThe number of values to calculate.
[in]rho_t0_s0The density at T=0, S=0, in kg m-3.
[in]drho_dsThe derivatives of density with temperature and salinity, in kg m-3 C-1 and kg m-3 psu-1.

Definition at line 120 of file MOM_EOS_linear.F90.

120  real, intent(in), dimension(:) :: t !< Potential temperature relative to the surface
121  !! in C.
122  real, intent(in), dimension(:) :: s !< Salinity in PSU.
123  real, intent(in), dimension(:) :: pressure !< Pressure in Pa.
124  real, intent(out), dimension(:) :: drho_dt_out !< The partial derivative of density with
125  !! potential temperature, in kg m-3 K-1.
126  real, intent(out), dimension(:) :: drho_ds_out !< The partial derivative of density with
127  !! salinity, in kg m-3 psu-1.
128  integer, intent(in) :: start !< The starting point in the arrays.
129  integer, intent(in) :: npts !< The number of values to calculate.
130  real, intent(in) :: rho_t0_s0 !< The density at T=0, S=0, in kg m-3.
131  real, intent(in) :: drho_dt, drho_ds !< The derivatives of density with
132  !! temperature and salinity, in kg m-3 C-1
133  !! and kg m-3 psu-1.
134 
135 ! * This subroutine calculates the partial derivatives of density *
136 ! * with potential temperature and salinity. *
137 ! * *
138 ! * Arguments: T - potential temperature relative to the surface in C. *
139 ! * (in) S - salinity in PSU. *
140 ! * (in) pressure - pressure in Pa. *
141 ! * (out) drho_dT_out - the partial derivative of density with *
142 ! * potential temperature, in kg m-3 K-1. *
143 ! * (out) drho_dS_out - the partial derivative of density with *
144 ! * salinity, in kg m-3 psu-1. *
145 ! * (in) start - the starting point in the arrays. *
146 ! * (in) npts - the number of values to calculate. *
147 ! * (in) Rho_T0_S0 - The density at T=0, S=0, in kg m-3. *
148 ! * (in) dRho_dT - The derivatives of density with temperature *
149 ! * (in) dRho_dS - and salinity, in kg m-3 C-1 and kg m-3 psu-1. *
150  integer :: j
151 
152  do j=start,start+npts-1
153  drho_dt_out(j) = drho_dt
154  drho_ds_out(j) = drho_ds
155  enddo
156 

◆ calculate_density_scalar_linear()

subroutine, public mom_eos_linear::calculate_density_scalar_linear ( real, intent(in)  T,
real, intent(in)  S,
real, intent(in)  pressure,
real, intent(out)  rho,
real, intent(in)  Rho_T0_S0,
real, intent(in)  dRho_dT,
real, intent(in)  dRho_dS 
)

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 in deg C), and pressure in Pa.

Parameters
[in]tPotential temperature relative to the surface in C.
[in]sSalinity in PSU.
[in]pressurePressure in Pa.
[out]rhoIn situ density in kg m-3.
[in]rho_t0_s0The density at T=0, S=0, in kg m-3.
[in]drho_dtThe derivatives of density with temperature and salinity, in kg m-3 C-1 and kg m-3 psu-1.
[in]drho_dsThe derivatives of density with temperature and salinity, in kg m-3 C-1 and kg m-3 psu-1.

Definition at line 50 of file MOM_EOS_linear.F90.

50  real, intent(in) :: t !< Potential temperature relative to the surface in C.
51  real, intent(in) :: s !< Salinity in PSU.
52  real, intent(in) :: pressure !< Pressure in Pa.
53  real, intent(out) :: rho !< In situ density in kg m-3.
54  real, intent(in) :: rho_t0_s0 !< The density at T=0, S=0, in kg m-3.
55  real, intent(in) :: drho_dt !< The derivatives of density with temperature and salinity,
56  !! in kg m-3 C-1 and kg m-3 psu-1.
57  real, intent(in) :: drho_ds !< The derivatives of density with temperature and salinity,
58  !! in kg m-3 C-1 and kg m-3 psu-1.
59 
60 ! * This subroutine computes the density of sea water with a trivial *
61 ! * linear equation of state (in kg/m^3) from salinity (sal in psu), *
62 ! * potential temperature (T in deg C), and pressure in Pa. *
63 ! * *
64 ! * Arguments: T - potential temperature relative to the surface in C. *
65 ! * (in) S - salinity in PSU. *
66 ! * (in) pressure - pressure in Pa. *
67 ! * (out) rho - in situ density in kg m-3. *
68 ! * (in) start - the starting point in the arrays. *
69 ! * (in) npts - the number of values to calculate. *
70 ! * (in) Rho_T0_S0 - The density at T=0, S=0, in kg m-3. *
71 ! * (in) dRho_dT - The derivatives of density with temperature *
72 ! * (in) dRho_dS - and salinity, in kg m-3 C-1 and kg m-3 psu-1. *
73 
74  rho = rho_t0_s0 + drho_dt*t + drho_ds*s
75 

◆ calculate_specvol_derivs_linear()

subroutine, public mom_eos_linear::calculate_specvol_derivs_linear ( real, dimension(:), intent(in)  T,
real, dimension(:), intent(in)  S,
real, dimension(:), intent(in)  pressure,
real, dimension(:), intent(out)  dSV_dT,
real, dimension(:), intent(out)  dSV_dS,
integer, intent(in)  start,
integer, intent(in)  npts,
real, intent(in)  Rho_T0_S0,
real, intent(in)  dRho_dT,
real, intent(in)  dRho_dS 
)
Parameters
[in]tPotential temperature relative to the surface in C.
[in]sSalinity in g/kg.
[in]pressurePressure in Pa.
[out]dsv_dsThe partial derivative of specific volume with salinity, in m3 kg-1 / (g/kg).
[out]dsv_dtThe partial derivative of specific volume with potential temperature, in m3 kg-1 K-1.
[in]startThe starting point in the arrays.
[in]nptsThe number of values to calculate.
[in]rho_t0_s0The density at T=0, S=0, in kg m-3.
[in]drho_dsThe derivatives of density with temperature and salinity, in kg m-3 C-1 and kg m-3 psu-1.

Definition at line 162 of file MOM_EOS_linear.F90.

162  real, intent(in), dimension(:) :: t !< Potential temperature relative to the surface
163  !! in C.
164  real, intent(in), dimension(:) :: s !< Salinity in g/kg.
165  real, intent(in), dimension(:) :: pressure !< Pressure in Pa.
166  real, intent(out), dimension(:) :: dsv_ds !< The partial derivative of specific volume with
167  !! salinity, in m3 kg-1 / (g/kg).
168  real, intent(out), dimension(:) :: dsv_dt !< The partial derivative of specific volume with
169  !! potential temperature, in m3 kg-1 K-1.
170  integer, intent(in) :: start !< The starting point in the arrays.
171  integer, intent(in) :: npts !< The number of values to calculate.
172  real, intent(in) :: rho_t0_s0 !< The density at T=0, S=0, in kg m-3.
173  real, intent(in) :: drho_dt, drho_ds !< The derivatives of density with
174  !! temperature and salinity, in kg m-3 C-1
175  !! and kg m-3 psu-1.
176 
177 ! * Arguments: T - potential temperature relative to the surface in C. *
178 ! * (in) S - salinity in g/kg. *
179 ! * (in) pressure - pressure in Pa. *
180 ! * (out) dSV_dT - the partial derivative of specific volume with *
181 ! * potential temperature, in m3 kg-1 K-1. *
182 ! * (out) dSV_dS - the partial derivative of specific volume with *
183 ! * salinity, in m3 kg-1 / (g/kg). *
184 ! * (in) start - the starting point in the arrays. *
185 ! * (in) npts - the number of values to calculate. *
186  real :: i_rho2
187  integer :: j
188 
189  do j=start,start+npts-1
190  ! Sv = 1.0 / (Rho_T0_S0 + dRho_dT*T(j) + dRho_dS*S(j))
191  i_rho2 = 1.0 / (rho_t0_s0 + (drho_dt*t(j) + drho_ds*s(j)))**2
192  dsv_dt(j) = -drho_dt * i_rho2
193  dsv_ds(j) = -drho_ds * i_rho2
194  enddo
195 

◆ int_density_dz_linear()

subroutine, public mom_eos_linear::int_density_dz_linear ( real, dimension(hii%isd:hii%ied,hii%jsd:hii%jed), intent(in)  T,
real, dimension(hii%isd:hii%ied,hii%jsd:hii%jed), intent(in)  S,
real, dimension(hii%isd:hii%ied,hii%jsd:hii%jed), intent(in)  z_t,
real, dimension(hii%isd:hii%ied,hii%jsd:hii%jed), intent(in)  z_b,
real, intent(in)  rho_ref,
real, intent(in)  rho_0_pres,
real, intent(in)  G_e,
type(hor_index_type), intent(in)  HII,
type(hor_index_type), intent(in)  HIO,
real, intent(in)  Rho_T0_S0,
real, intent(in)  dRho_dT,
real, intent(in)  dRho_dS,
real, dimension(hio%isd:hio%ied,hio%jsd:hio%jed), intent(out)  dpa,
real, dimension(hio%isd:hio%ied,hio%jsd:hio%jed), intent(out), optional  intz_dpa,
real, dimension(hio%isdb:hio%iedb,hio%jsd:hio%jed), intent(out), optional  intx_dpa,
real, dimension(hio%isd:hio%ied,hio%jsdb:hio%jedb), intent(out), optional  inty_dpa 
)

This subroutine calculates analytical and nearly-analytical integrals of pressure anomalies across layers, which are required for calculating the finite-volume form pressure accelerations in a Boussinesq model.

Parameters
[in]tPotential temperature relative to the surface
[in]sSalinity in PSU.
[in]z_tHeight at the top of the layer in m.
[in]z_bHeight at the top of the layer in m.
[in]rho_refA mean density, in kg m-3, that is subtracted out to reduce the magnitude of each of the integrals.
[in]rho_0_presA density, in 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.
[in]g_eThe Earth's gravitational acceleration, in m s-2.
[in]rho_t0_s0The density at T=0, S=0, in kg m-3.
[in]drho_dtThe derivative of density with temperature, in kg m-3 C-1.
[in]drho_dsThe derivative of density with salinity, in kg m-3 psu-1.
[out]dpaThe change in the pressure anomaly across the
[out]intz_dpaThe integral through the thickness of the layer
[out]intx_dpaThe integral in x of the difference between the
[out]inty_dpaThe integral in y of the difference between the

Definition at line 248 of file MOM_EOS_linear.F90.

248  type(hor_index_type), intent(in) :: hii, hio
249  real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), &
250  intent(in) :: t !< Potential temperature relative to the surface
251  !! in C.
252  real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), &
253  intent(in) :: s !< Salinity in PSU.
254  real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), &
255  intent(in) :: z_t !< Height at the top of the layer in m.
256  real, dimension(HII%isd:HII%ied,HII%jsd:HII%jed), &
257  intent(in) :: z_b !< Height at the top of the layer in m.
258  real, intent(in) :: rho_ref !< A mean density, in kg m-3, that is subtracted
259  !! out to reduce the magnitude of each of the
260  !! integrals.
261  real, intent(in) :: rho_0_pres !< A density, in kg m-3, that is used to calculate
262  !! the pressure (as p~=-z*rho_0_pres*G_e) used in
263  !! the equation of state. rho_0_pres is not used
264  !! here.
265  real, intent(in) :: g_e !< The Earth's gravitational acceleration,
266  !! in m s-2.
267  real, intent(in) :: rho_t0_s0 !< The density at T=0, S=0, in kg m-3.
268  real, intent(in) :: drho_dt !< The derivative of density with temperature,
269  !! in kg m-3 C-1.
270  real, intent(in) :: drho_ds !< The derivative of density with salinity,
271  !! in kg m-3 psu-1.
272  real, dimension(HIO%isd:HIO%ied,HIO%jsd:HIO%jed), &
273  intent(out) :: dpa !< The change in the pressure anomaly across the
274  !! layer, in Pa.
275  real, dimension(HIO%isd:HIO%ied,HIO%jsd:HIO%jed), &
276  optional, intent(out) :: intz_dpa !< The integral through the thickness of the layer
277  !! of the pressure anomaly relative to the anomaly
278  !! at the top of the layer, in Pa m.
279  real, dimension(HIO%IsdB:HIO%IedB,HIO%jsd:HIO%jed), &
280  optional, intent(out) :: intx_dpa !< The integral in x of the difference between the
281  !! pressure anomaly at the top and bottom of the
282  !! layer divided by the x grid spacing, in Pa.
283  real, dimension(HIO%isd:HIO%ied,HIO%JsdB:HIO%JedB), &
284  optional, intent(out) :: inty_dpa !< The integral in y of the difference between the
285  !! pressure anomaly at the top and bottom of the
286  !! layer divided by the y grid spacing, in Pa.
287 
288 ! This subroutine calculates analytical and nearly-analytical integrals of
289 ! pressure anomalies across layers, which are required for calculating the
290 ! finite-volume form pressure accelerations in a Boussinesq model.
291 !
292 ! Arguments: T - potential temperature relative to the surface in C.
293 ! (in) S - salinity in PSU.
294 ! (in) z_t - height at the top of the layer in m.
295 ! (in) z_b - height at the top of the layer in m.
296 ! (in) rho_ref - A mean density, in kg m-3, that is subtracted out to reduce
297 ! the magnitude of each of the integrals.
298 ! (in) rho_0_pres - A density, in kg m-3, that is used to calculate the
299 ! pressure (as p~=-z*rho_0_pres*G_e) used in the equation of
300 ! state. rho_0_pres is not used here.
301 ! (in) G_e - The Earth's gravitational acceleration, in m s-2.
302 ! (in) G - The ocean's grid structure.
303 ! (in) Rho_T0_S0 - The density at T=0, S=0, in kg m-3.
304 ! (in) dRho_dT - The derivative of density with temperature in kg m-3 C-1.
305 ! (in) dRho_dS - The derivative of density with salinity, in kg m-3 psu-1.
306 ! (out) dpa - The change in the pressure anomaly across the layer, in Pa.
307 ! (out,opt) intz_dpa - The integral through the thickness of the layer of the
308 ! pressure anomaly relative to the anomaly at the top of
309 ! the layer, in Pa m.
310 ! (out,opt) intx_dpa - The integral in x of the difference between the
311 ! pressure anomaly at the top and bottom of the layer
312 ! divided by the x grid spacing, in Pa.
313 ! (out,opt) inty_dpa - The integral in y of the difference between the
314 ! pressure anomaly at the top and bottom of the layer
315 ! divided by the y grid spacing, in Pa.
316  real :: rho_anom ! The density anomaly from rho_ref, in kg m-3.
317  real :: ral, rar ! rho_anom to the left and right, in kg m-3.
318  real :: dz, dzl, dzr ! Layer thicknesses in m.
319  real :: c1_6
320  integer :: is, ie, js, je, isq, ieq, jsq, jeq, i, j, ioff, joff
321 
322  ioff = hio%idg_offset - hii%idg_offset
323  joff = hio%jdg_offset - hii%jdg_offset
324 
325  ! These array bounds work for the indexing convention of the input arrays, but
326  ! on the computational domain defined for the output arrays.
327  isq = hio%IscB + ioff ; ieq = hio%IecB + ioff
328  jsq = hio%JscB + joff ; jeq = hio%JecB + joff
329  is = hio%isc + ioff ; ie = hio%iec + ioff
330  js = hio%jsc + joff ; je = hio%jec + joff
331  c1_6 = 1.0 / 6.0
332 
333  do j=jsq,jeq+1 ; do i=isq,ieq+1
334  dz = z_t(i,j) - z_b(i,j)
335  rho_anom = (rho_t0_s0 - rho_ref) + drho_dt*t(i,j) + drho_ds*s(i,j)
336  dpa(i-ioff,j-joff) = g_e*rho_anom*dz
337  if (present(intz_dpa)) intz_dpa(i-ioff,j-joff) = 0.5*g_e*rho_anom*dz**2
338  enddo ; enddo
339 
340  if (present(intx_dpa)) then ; do j=js,je ; do i=isq,ieq
341  dzl = z_t(i,j) - z_b(i,j) ; dzr = z_t(i+1,j) - z_b(i+1,j)
342  ral = (rho_t0_s0 - rho_ref) + (drho_dt*t(i,j) + drho_ds*s(i,j))
343  rar = (rho_t0_s0 - rho_ref) + (drho_dt*t(i+1,j) + drho_ds*s(i+1,j))
344 
345  intx_dpa(i-ioff,j-joff) = g_e*c1_6 * (dzl*(2.0*ral + rar) + dzr*(2.0*rar + ral))
346  enddo ; enddo ; endif
347 
348  if (present(inty_dpa)) then ; do j=jsq,jeq ; do i=is,ie
349  dzl = z_t(i,j) - z_b(i,j) ; dzr = z_t(i,j+1) - z_b(i,j+1)
350  ral = (rho_t0_s0 - rho_ref) + (drho_dt*t(i,j) + drho_ds*s(i,j))
351  rar = (rho_t0_s0 - rho_ref) + (drho_dt*t(i,j+1) + drho_ds*s(i,j+1))
352 
353  inty_dpa(i-ioff,j-joff) = g_e*c1_6 * (dzl*(2.0*ral + rar) + dzr*(2.0*rar + ral))
354  enddo ; enddo ; endif

◆ int_spec_vol_dp_linear()

subroutine, public mom_eos_linear::int_spec_vol_dp_linear ( real, dimension(hi%isd:hi%ied,hi%jsd:hi%jed), intent(in)  T,
real, dimension(hi%isd:hi%ied,hi%jsd:hi%jed), intent(in)  S,
real, dimension(hi%isd:hi%ied,hi%jsd:hi%jed), intent(in)  p_t,
real, dimension(hi%isd:hi%ied,hi%jsd:hi%jed), intent(in)  p_b,
real, intent(in)  alpha_ref,
type(hor_index_type), intent(in)  HI,
real, intent(in)  Rho_T0_S0,
real, intent(in)  dRho_dT,
real, intent(in)  dRho_dS,
real, dimension(hi%isd:hi%ied,hi%jsd:hi%jed), intent(out)  dza,
real, dimension(hi%isd:hi%ied,hi%jsd:hi%jed), intent(out), optional  intp_dza,
real, dimension(hi%isdb:hi%iedb,hi%jsd:hi%jed), intent(out), optional  intx_dza,
real, dimension(hi%isd:hi%ied,hi%jsdb:hi%jedb), intent(out), optional  inty_dza,
integer, intent(in), optional  halo_size 
)

This subroutine calculates analytical and nearly-analytical integrals in pressure across layers of geopotential anomalies, which are required for calculating the finite-volume form pressure accelerations in a non-Boussinesq model. Specific volume is assumed to vary linearly between adjacent points.

Parameters
[in]hiThe ocean's horizontal index type.
[in]tPotential temperature relative to the surface
[in]sSalinity in PSU.
[in]p_tPressure at the top of the layer in Pa.
[in]p_bPressure at the top of the layer in Pa.
[in]alpha_refA 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.
[in]rho_t0_s0The density at T=0, S=0, in kg m-3.
[in]drho_dtThe derivative of density with temperature, in kg m-3 C-1.
[in]drho_dsThe derivative of density with salinity, in kg m-3 psu-1.
[out]dzaThe change in the geopotential anomaly across
[out]intp_dzaThe integral in pressure through the layer of
[out]intx_dzaThe integral in x of the difference between the
[out]inty_dzaThe integral in y of the difference between the

Definition at line 363 of file MOM_EOS_linear.F90.

Referenced by mom_eos::int_specific_vol_dp().

363  type(hor_index_type), intent(in) :: hi !< The ocean's horizontal index type.
364  real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), &
365  intent(in) :: t !< Potential temperature relative to the surface
366  !! in C.
367  real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), &
368  intent(in) :: s !< Salinity in PSU.
369  real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), &
370  intent(in) :: p_t !< Pressure at the top of the layer in Pa.
371  real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), &
372  intent(in) :: p_b !< Pressure at the top of the layer in Pa.
373  real, intent(in) :: alpha_ref !< A mean specific volume that is subtracted out
374  !! to reduce the magnitude of each of the integrals, m3 kg-1. The calculation is
375  !! mathematically identical with different values of alpha_ref, but this reduces the
376  !! effects of roundoff.
377  real, intent(in) :: rho_t0_s0 !< The density at T=0, S=0, in kg m-3.
378  real, intent(in) :: drho_dt !< The derivative of density with temperature,
379  !! in kg m-3 C-1.
380  real, intent(in) :: drho_ds !< The derivative of density with salinity,
381  !! in kg m-3 psu-1.
382  real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), &
383  intent(out) :: dza !< The change in the geopotential anomaly across
384  !! the layer, in m2 s-2.
385  real, dimension(HI%isd:HI%ied,HI%jsd:HI%jed), &
386  optional, intent(out) :: intp_dza !< The integral in pressure through the layer of
387  !! the geopotential anomaly relative to the anomaly
388  !! at the bottom of the layer, in Pa m2 s-2.
389  real, dimension(HI%IsdB:HI%IedB,HI%jsd:HI%jed), &
390  optional, intent(out) :: intx_dza !< The integral in x of the difference between the
391  !! geopotential anomaly at the top and bottom of
392  !! the layer divided by the x grid spacing,
393  !! in m2 s-2.
394  real, dimension(HI%isd:HI%ied,HI%JsdB:HI%JedB), &
395  optional, intent(out) :: inty_dza !< The integral in y of the difference between the
396  !! geopotential anomaly at the top and bottom of
397  !! the layer divided by the y grid spacing,
398  !! in m2 s-2.
399  integer, optional, intent(in) :: halo_size
400 
401 ! This subroutine calculates analytical and nearly-analytical integrals in
402 ! pressure across layers of geopotential anomalies, which are required for
403 ! calculating the finite-volume form pressure accelerations in a non-Boussinesq
404 ! model. Specific volume is assumed to vary linearly between adjacent points.
405 !
406 ! Arguments: T - potential temperature relative to the surface in C.
407 ! (in) S - salinity in PSU.
408 ! (in) p_t - pressure at the top of the layer in Pa.
409 ! (in) p_b - pressure at the top of the layer in Pa.
410 ! (in) alpha_ref - A mean specific volume that is subtracted out to reduce
411 ! the magnitude of each of the integrals, m3 kg-1.
412 ! The calculation is mathematically identical with
413 ! different values of alpha_ref, but this reduces the
414 ! effects of roundoff.
415 ! (in) HI - The ocean's horizontal index type.
416 ! (in) Rho_T0_S0 - The density at T=0, S=0, in kg m-3.
417 ! (in) dRho_dT - The derivative of density with temperature in kg m-3 C-1.
418 ! (in) dRho_dS - The derivative of density with salinity, in kg m-3 psu-1.
419 ! (out) dza - The change in the geopotential anomaly across the layer,
420 ! in m2 s-2.
421 ! (out,opt) intp_dza - The integral in pressure through the layer of the
422 ! geopotential anomaly relative to the anomaly at the
423 ! bottom of the layer, in Pa m2 s-2.
424 ! (out,opt) intx_dza - The integral in x of the difference between the
425 ! geopotential anomaly at the top and bottom of the layer
426 ! divided by the x grid spacing, in m2 s-2.
427 ! (out,opt) inty_dza - The integral in y of the difference between the
428 ! geopotential anomaly at the top and bottom of the layer
429 ! divided by the y grid spacing, in m2 s-2.
430  real :: drho_ts ! The density anomaly due to T and S, in kg m-3.
431  real :: alpha_anom ! The specific volume anomaly from 1/rho_ref, in m3 kg-1.
432  real :: aal, aar ! rho_anom to the left and right, in kg m-3.
433  real :: dp, dpl, dpr ! Layer pressure thicknesses in Pa.
434  real :: c1_6
435  integer :: isq, ieq, jsq, jeq, ish, ieh, jsh, jeh, i, j, halo
436 
437  isq = hi%IscB ; ieq = hi%IecB ; jsq = hi%JscB ; jeq = hi%JecB
438  halo = 0 ; if (present(halo_size)) halo = max(halo_size,0)
439  ish = hi%isc-halo ; ieh = hi%iec+halo ; jsh = hi%jsc-halo ; jeh = hi%jec+halo
440  if (present(intx_dza)) then ; ish = min(isq,ish) ; ieh = max(ieq+1,ieh); endif
441  if (present(inty_dza)) then ; jsh = min(jsq,jsh) ; jeh = max(jeq+1,jeh); endif
442  c1_6 = 1.0 / 6.0
443 
444  do j=jsh,jeh ; do i=ish,ieh
445  dp = p_b(i,j) - p_t(i,j)
446  drho_ts = drho_dt*t(i,j) + drho_ds*s(i,j)
447  ! alpha_anom = 1.0/(Rho_T0_S0 + dRho_TS)) - alpha_ref
448  alpha_anom = ((1.0-rho_t0_s0*alpha_ref) - drho_ts*alpha_ref) / (rho_t0_s0 + drho_ts)
449  dza(i,j) = alpha_anom*dp
450  if (present(intp_dza)) intp_dza(i,j) = 0.5*alpha_anom*dp**2
451  enddo ; enddo
452 
453  if (present(intx_dza)) then ; do j=hi%jsc,hi%jec ; do i=isq,ieq
454  dpl = p_b(i,j) - p_t(i,j) ; dpr = p_b(i+1,j) - p_t(i+1,j)
455  drho_ts = drho_dt*t(i,j) + drho_ds*s(i,j)
456  aal = ((1.0 - rho_t0_s0*alpha_ref) - drho_ts*alpha_ref) / (rho_t0_s0 + drho_ts)
457  drho_ts = drho_dt*t(i+1,j) + drho_ds*s(i+1,j)
458  aar = ((1.0 - rho_t0_s0*alpha_ref) - drho_ts*alpha_ref) / (rho_t0_s0 + drho_ts)
459 
460  intx_dza(i,j) = c1_6 * (2.0*(dpl*aal + dpr*aar) + (dpl*aar + dpr*aal))
461  enddo ; enddo ; endif
462 
463  if (present(inty_dza)) then ; do j=jsq,jeq ; do i=hi%isc,hi%iec
464  dpl = p_b(i,j) - p_t(i,j) ; dpr = p_b(i,j+1) - p_t(i,j+1)
465  drho_ts = drho_dt*t(i,j) + drho_ds*s(i,j)
466  aal = ((1.0 - rho_t0_s0*alpha_ref) - drho_ts*alpha_ref) / (rho_t0_s0 + drho_ts)
467  drho_ts = drho_dt*t(i,j+1) + drho_ds*s(i,j+1)
468  aar = ((1.0 - rho_t0_s0*alpha_ref) - drho_ts*alpha_ref) / (rho_t0_s0 + drho_ts)
469 
470  inty_dza(i,j) = c1_6 * (2.0*(dpl*aal + dpr*aar) + (dpl*aar + dpr*aal))
471  enddo ; enddo ; endif
Here is the caller graph for this function: