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 [Pa], using the expressions from Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740.
Definition at line 32 of file MOM_EOS_Wright.F90.
|
subroutine | calculate_density_scalar_wright (T, S, pressure, rho, rho_ref) |
| 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 [Pa]. It uses the expression from Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740. More...
|
|
subroutine | calculate_density_array_wright (T, S, pressure, rho, start, npts, rho_ref) |
| 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 [Pa]. It uses the expression from Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740. More...
|
|
subroutine mom_eos_wright::calculate_density_wright::calculate_density_array_wright |
( |
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), optional |
rho_ref |
|
) |
| |
|
private |
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 [Pa]. It uses the expression from Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740.
- Parameters
-
[in] | t | potential temperature relative to the surface [degC]. |
[in] | s | salinity [PSU]. |
[in] | pressure | pressure [Pa]. |
[out] | rho | in situ density [kg m-3]. |
[in] | start | the starting point in the arrays. |
[in] | npts | the number of values to calculate. |
[in] | rho_ref | A reference density [kg m-3]. |
Definition at line 111 of file MOM_EOS_Wright.F90.
111 real,
dimension(:),
intent(in) :: T
112 real,
dimension(:),
intent(in) :: S
113 real,
dimension(:),
intent(in) :: pressure
114 real,
dimension(:),
intent(out) :: rho
115 integer,
intent(in) :: start
116 integer,
intent(in) :: npts
117 real,
optional,
intent(in) :: rho_ref
121 real :: al0, p0, lambda
122 real :: al_TS, p_TSp, lam_TS, pa_000
125 if (
present(rho_ref)) pa_000 = (b0*(1.0 - a0*rho_ref) - rho_ref*c0)
126 if (
present(rho_ref))
then ;
do j=start,start+npts-1
127 al_ts = a1*t(j) +a2*s(j)
129 p_tsp = pressure(j) + (b4*s(j) + t(j) * (b1 + (t(j)*(b2 + b3*t(j)) + b5*s(j))))
130 lam_ts = c4*s(j) + t(j) * (c1 + (t(j)*(c2 + c3*t(j)) + c5*s(j)))
134 rho(j) = (pa_000 + (p_tsp - rho_ref*(p_tsp*al0 + (b0*al_ts + lam_ts)))) / &
135 ( (c0 + lam_ts) + al0*(b0 + p_tsp) )
136 enddo ;
else ;
do j=start,start+npts-1
137 al0 = (a0 + a1*t(j)) +a2*s(j)
138 p0 = (b0 + b4*s(j)) + t(j) * (b1 + t(j)*(b2 + b3*t(j)) + b5*s(j))
139 lambda = (c0 +c4*s(j)) + t(j) * (c1 + t(j)*(c2 + c3*t(j)) + c5*s(j))
140 rho(j) = (pressure(j) + p0) / (lambda + al0*(pressure(j) + p0))
subroutine mom_eos_wright::calculate_density_wright::calculate_density_scalar_wright |
( |
real, intent(in) |
T, |
|
|
real, intent(in) |
S, |
|
|
real, intent(in) |
pressure, |
|
|
real, intent(out) |
rho, |
|
|
real, intent(in), optional |
rho_ref |
|
) |
| |
|
private |
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 [Pa]. It uses the expression from Wright, 1997, J. Atmos. Ocean. Tech., 14, 735-740.
- Parameters
-
[in] | t | Potential temperature relative to the surface [degC]. |
[in] | s | Salinity [PSU]. |
[in] | pressure | pressure [Pa]. |
[out] | rho | In situ density [kg m-3]. |
[in] | rho_ref | A reference density [kg m-3]. |
Definition at line 81 of file MOM_EOS_Wright.F90.
83 real,
intent(in) :: pressure
84 real,
intent(out) :: rho
85 real,
optional,
intent(in) :: rho_ref
95 real,
dimension(1) :: T0, S0, pressure0, rho0
99 pressure0(1) = pressure
101 call calculate_density_array_wright(t0, s0, pressure0, rho0, 1, 1, rho_ref)