For a given thermodynamic state, return the second derivatives of density with various combinations of temperature, salinity, and pressure.
Definition at line 50 of file MOM_EOS_Wright.F90.
|
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) |
| Second derivatives of density with respect to temperature, salinity, and pressure for scalar inputs. Inputs promoted to 1-element array and output demoted to scalar. More...
|
|
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) |
| Second derivatives of density with respect to temperature, salinity, and pressure. More...
|
|
◆ calculate_density_second_derivs_array_wright()
subroutine mom_eos_wright::calculate_density_second_derivs_wright::calculate_density_second_derivs_array_wright |
( |
real, dimension(:), intent(in) |
T, |
|
|
real, dimension(:), intent(in) |
S, |
|
|
real, dimension(:), intent(in) |
P, |
|
|
real, dimension(:), intent(out) |
drho_ds_ds, |
|
|
real, dimension(:), intent(out) |
drho_ds_dt, |
|
|
real, dimension(:), intent(out) |
drho_dt_dt, |
|
|
real, dimension(:), intent(out) |
drho_ds_dp, |
|
|
real, dimension(:), intent(out) |
drho_dt_dp, |
|
|
integer, intent(in) |
start, |
|
|
integer, intent(in) |
npts |
|
) |
| |
|
private |
Second derivatives of density with respect to temperature, salinity, and pressure.
- Parameters
-
[in] | t | Potential temperature referenced to 0 dbar [degC] |
[in] | s | Salinity [PSU] |
[in] | p | Pressure [Pa] |
[out] | drho_ds_ds | Partial derivative of beta with respect to S [kg m-3 PSU-2] |
[out] | drho_ds_dt | Partial derivative of beta with respcct to T [kg m-3 PSU-1 degC-1] |
[out] | drho_dt_dt | Partial derivative of alpha with respect to T [kg m-3 degC-2] |
[out] | drho_ds_dp | Partial derivative of beta with respect to pressure [kg m-3 PSU-1 Pa-1] |
[out] | drho_dt_dp | Partial derivative of alpha with respect to pressure [kg m-3 degC-1 Pa-1] |
[in] | start | Starting index in T,S,P |
[in] | npts | Number of points to loop over |
Definition at line 259 of file MOM_EOS_Wright.F90.
259 real,
dimension(:),
intent(in ) :: T
260 real,
dimension(:),
intent(in ) :: S
261 real,
dimension(:),
intent(in ) :: P
262 real,
dimension(:),
intent( out) :: drho_ds_ds
264 real,
dimension(:),
intent( out) :: drho_ds_dt
266 real,
dimension(:),
intent( out) :: drho_dt_dt
268 real,
dimension(:),
intent( out) :: drho_ds_dp
270 real,
dimension(:),
intent( out) :: drho_dt_dp
272 integer,
intent(in ) :: start
273 integer,
intent(in ) :: npts
276 real :: z0, z1, z2, z3, z4, z5, z6 ,z7, z8, z9, z10, z11, z2_2, z2_3
281 do j = start,start+npts-1
282 z0 = t(j)*(b1 + b5*s(j) + t(j)*(b2 + b3*t(j)))
283 z1 = (b0 + p(j) + b4*s(j) + z0)
284 z3 = (b1 + b5*s(j) + t(j)*(2.*b2 + 2.*b3*t(j)))
285 z4 = (c0 + c4*s(j) + t(j)*(c1 + c5*s(j) + t(j)*(c2 + c3*t(j))))
286 z5 = (b1 + b5*s(j) + t(j)*(b2 + b3*t(j)) + t(j)*(b2 + 2.*b3*t(j)))
287 z6 = c1 + c5*s(j) + t(j)*(c2 + c3*t(j)) + t(j)*(c2 + 2.*c3*t(j))
288 z7 = (c4 + c5*t(j) + a2*z1)
289 z8 = (c1 + c5*s(j) + t(j)*(2.*c2 + 3.*c3*t(j)) + a1*z1)
290 z9 = (a0 + a2*s(j) + a1*t(j))
292 z11 = (z10*z4 - z1*z7)
293 z2 = (c0 + c4*s(j) + t(j)*(c1 + c5*s(j) + t(j)*(c2 + c3*t(j))) + z9*z1)
297 drho_ds_ds(j) = (z10*(c4 + c5*t(j)) - a2*z10*z1 - z10*z7)/z2_2 - (2.*(c4 + c5*t(j) + z9*z10 + a2*z1)*z11)/z2_3
298 drho_ds_dt(j) = (z10*z6 - z1*(c5 + a2*z5) + b5*z4 - z5*z7)/z2_2 - (2.*(z6 + z9*z5 + a1*z1)*z11)/z2_3
299 drho_dt_dt(j) = (z3*z6 - z1*(2.*c2 + 6.*c3*t(j) + a1*z5) + (2.*b2 + 4.*b3*t(j))*z4 - z5*z8)/z2_2 - &
300 (2.*(z6 + z9*z5 + a1*z1)*(z3*z4 - z1*z8))/z2_3
301 drho_ds_dp(j) = (-c4 - c5*t(j) - 2.*a2*z1)/z2_2 - (2.*z9*z11)/z2_3
302 drho_dt_dp(j) = (-c1 - c5*s(j) - t(j)*(2.*c2 + 3.*c3*t(j)) - 2.*a1*z1)/z2_2 - (2.*z9*(z3*z4 - z1*z8))/z2_3
◆ calculate_density_second_derivs_scalar_wright()
subroutine mom_eos_wright::calculate_density_second_derivs_wright::calculate_density_second_derivs_scalar_wright |
( |
real, intent(in) |
T, |
|
|
real, intent(in) |
S, |
|
|
real, intent(in) |
P, |
|
|
real, intent(out) |
drho_ds_ds, |
|
|
real, intent(out) |
drho_ds_dt, |
|
|
real, intent(out) |
drho_dt_dt, |
|
|
real, intent(out) |
drho_ds_dp, |
|
|
real, intent(out) |
drho_dt_dp |
|
) |
| |
|
private |
Second derivatives of density with respect to temperature, salinity, and pressure for scalar inputs. Inputs promoted to 1-element array and output demoted to scalar.
- Parameters
-
[in] | t | Potential temperature referenced to 0 dbar |
[in] | s | Salinity [PSU] |
[in] | p | pressure [Pa] |
[out] | drho_ds_ds | Partial derivative of beta with respect to S [kg m-3 PSU-2] |
[out] | drho_ds_dt | Partial derivative of beta with respcct to T [kg m-3 PSU-1 degC-1] |
[out] | drho_dt_dt | Partial derivative of alpha with respect to T [kg m-3 degC-2] |
[out] | drho_ds_dp | Partial derivative of beta with respect to pressure [kg m-3 PSU-1 Pa-1] |
[out] | drho_dt_dp | Partial derivative of alpha with respect to pressure [kg m-3 degC-1 Pa-1] |
Definition at line 311 of file MOM_EOS_Wright.F90.
311 real,
intent(in ) :: T
312 real,
intent(in ) :: S
313 real,
intent(in ) :: P
314 real,
intent( out) :: drho_ds_ds
316 real,
intent( out) :: drho_ds_dt
318 real,
intent( out) :: drho_dt_dt
320 real,
intent( out) :: drho_ds_dp
322 real,
intent( out) :: drho_dt_dp
325 real,
dimension(1) :: T0, S0, P0
326 real,
dimension(1) :: drdsds, drdsdt, drdtdt, drdsdp, drdtdp
331 call calculate_density_second_derivs_array_wright(t0, s0, p0, drdsds, drdsdt, drdtdt, drdsdp, drdtdp, 1, 1)
332 drho_ds_ds = drdsds(1)
333 drho_ds_dt = drdsdt(1)
334 drho_dt_dt = drdtdt(1)
335 drho_ds_dp = drdsdp(1)
336 drho_dt_dp = drdtdp(1)
The documentation for this interface was generated from the following file:
- /glade/work/altuntas/cesm.sandboxes/cesm2_2_alpha_X_mom/components/mom/MOM6/src/equation_of_state/MOM_EOS_Wright.F90