rho_from_theta

INTERFACE:

    subroutine rho_from_theta(s,th,p,dens0,densp)
DESCRIPTION:

Here, the equation of state is calculated Uses Jackett ea 2006 algorithm specific for potential temperature Checkvalue S=35 T=25 p=10000 rho_from_theta = 1062.53817

s : salinity (psu) th : potential temperature (deg C, ITS-90) p : gauge pressure (dbar) (absolute pressure - 10.1325 dbar)

rho_from_theta : in-situ density (kg m$^{-3}$)

check value : rho_from_theta(20,20,1000) = 1017.728868019642

based on DRJ on 10/12/03 USES:

    IMPLICIT NONE
INPUT PARAMETERS:
    REALTYPE, intent(in)      :: th  ! potential temperature degC
    REALTYPE, intent(in)      :: s  ! in situ salinity PSU
    REALTYPE, intent(in)      :: p  ! pressure in dbars
OUTPUT PARAMETERS:
    REALTYPE, intent(out)     :: dens0  ! density at 0.0 dbars
    REALTYPE, intent(out)     :: densp  ! density at p dbars
REVISION HISTORY:
    AS 2009 based on code provided by Jackett 2005
    See the log for the module
   !LOCAL VARIABLES
    REALTYPE th2,sqrts,anum,aden,pth