*INTERFACE:*

REALTYPE function eqstate1(S,T,p,g,rho_0)

Calculates the in-situ buoyancy according to the selected method.
`S` is salinity in psu, `T` is
potential temperature in C (ITS-90), `p` is
gauge pressure (absolute pressure - 10.1325 bar), `g` is the
gravitational acceleration in ms and `rho_0` the reference
density in kgm. `eqstate1` is the in-situ-density
in kgm.
For `eq_state_method`=1, the UNESCO equation of state is used,
for `eq_state_method`=2, the Jackett et al. (2005) equation
of state is used. Here, some care is needed, since the UNESCO equation
used bar for pressure and the Jackett et al. (2005) uses dbar for pressure.
For values of
`eq_state_method` ranging from 1 to 4, one of the following methods
will be used.

- the full equation of state for sea water including pressure dependence.
- the equation of state for sea water with the pressure evaluated at the sea surface as reference level. This is the choice for computations based on potential temperature and density.
- a linearised equation of state.
The parameters
`T0`,`S0`and`p0`have to be specified in the namelist. - a linear equation of state with prescribed
`rho0`,`T0`,`S0`,`dtr0`,`dsr0`according to

*USES:*

IMPLICIT NONE

REALTYPE,intent(in) :: S,T,p REALTYPE,optional,intent(in) :: g,rho_0

Original author(s): Hans Burchard & Karsten Bolding

Karsten Bolding 2012-12-28