ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c The set of real functions of real arguments: c c sdens12, sdens14, sdens17 (temp, sal, pres) - c IN SITU density as a function of IN SITU temperature, salinity & presure c (in kg/m**3) c c pdens12, pdens14, pdens17 (temp, sal, pres) - c IN SITU density as a function of potential temperature (pref= 0dB), c salinity & presure c (in kg/m**3) c c if compiled with flag -DSIGMA (defining SIGMA for "cpp"), then density, c computed by the functions is in "sigma" units: sigma = (rho - 1000) kg/m**3 c if flag -DDOUBLE_PRCISION used, then double precision arithmetics are using c in computation of density, but result will be still in sinlge precision. c c FILES: senq_dens.f c dens.h c c AUTHOR: Senya Basin, 1992 c senya@rainbow.ldgo.columbia.edu c ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc real function sdens12 (t, s, p) c------------------------------------------- real t, s, p #define SDENS12 #include "dens.h" #if defined (DOUBL_PRES) at = dble(t) as = dble(s) ap = dble(p) sdens12 = real (a0 + * at*(a1 + as*a2 + at*(a3 + as*a4 + at*a6)) + * as*(a7 + ap*a8) + * ap*(a9 + at*(a10 + at*a5) + ap*(a11 + at*a12)) ) #else sdens12 = a0 + * t*(a1 + s*a2 + t*(a3 + s*a4 + t*a6)) + * s*(a7 + p*a8) + * p*(a9 + t*(a10 + t*a5) + p*(a11 + t*a12)) #endif #undef SDENS12 return end real function sdens14 (t, s, p) c------------------------------------------- real t, s, p #define SDENS14 #include "dens.h" #if defined (DOUBL_PRES) bt = dble(t) bs = dble(s) bp = dble(p) sdens14 = real ( b0 + * bt*(b1 + bs*b2 + * bt*(b3 + bs*b4 + bp*b5 + bt*(b6 + bp*b7 + bt*b8))) + * bs*(b9 + bp*b10) + * bp*(b11 + bt*b12 + bp*(b13 + bt*b14)) ) #else sdens14 = b0 + * t*(b1 + s*b2 + * t*(b3 + s*b4 + p*b5 + t*(b6 + p*b7 + t*b8))) + * s*(b9 + p*b10) + * p*(b11 + t*b12 + p*(b13 + t*b14)) #endif #undef SDENS14 return end real function sdens17 (t, s, p) c------------------------------------------- real t, s, p #define SDENS17 #include "dens.h" #if defined (DOUBL_PRES) ct = dble(t) cs = dble(s) cp = dble(p) sdens17 = real ( c0 + * ct*(c1 + cs*c2 + * ct*(c3 + cs*c4 + cp*c5 + * ct*(c6 + cs*c7 + cp*c8 + ct*c9))) + * cs*(c10 + cp*(c11 + ct*c12)) + * cp*(c13 + ct*c14 + cp*(c15 + ct*(c16 + ct*c17))) ) #else sdens17 = c0 + * t*(c1 + s*c2 + * t*(c3 + s*c4 + p*c5 + * t*(c6 + s*c7 + p*c8 + t*c9))) + * s*(c10 + p*(c11 + t*c12)) + * p*(c13 + t*c14 + p*(c15 + t*(c16 + t*c17))) #endif #undef SDENS17 return end real function pdens12 (t, s, p) c------------------------------------------- real t, s, p #define PDENS12 #include "dens.h" #if defined (DOUBL_PRES) at = dble(t) as = dble(s) ap = dble(p) pdens12 = real (a0 + * at*(a1 + as*a2 + at*(a3 + as*a4 + at*a6)) + * as*(a7 + ap*a8) + * ap*(a9 + at*(a10 + at*a5) + ap*(a11 + at*a12)) ) #else pdens12 = a0 + * t*(a1 + s*a2 + t*(a3 + s*a4 + t*a6)) + * s*(a7 + p*a8) + * p*(a9 + t*(a10 + t*a5) + p*(a11 + t*a12)) #endif #undef PDENS12 return end real function pdens14 (t, s, p) c------------------------------------------- real t, s, p #define PDENS14 #include "dens.h" #if defined (DOUBL_PRES) bt = dble(t) bs = dble(s) bp = dble(p) pdens14 = real ( b0 + * bt*(b1 + bs*b2 + * bt*(b3 + bs*b4 + bp*b5 + bt*(b6 + bp*b7 + bt*b8))) + * bs*(b9 + bp*b10) + * bp*(b11 + bt*b12 + bp*(b13 + bt*b14)) ) #else pdens14 = b0 + * t*(b1 + s*b2 + * t*(b3 + s*b4 + p*b5 + t*(b6 + p*b7 + t*b8))) + * s*(b9 + p*b10) + * p*(b11 + t*b12 + p*(b13 + t*b14)) #endif #undef PDENS14 return end real function pdens17 (t, s, p) c------------------------------------------- real t, s, p #define PDENS17 #include "dens.h" #if defined (DOUBL_PRES) ct = dble(t) cs = dble(s) cp = dble(p) pdens17 = real ( c0 + * ct*(c1 + cs*c2 + * ct*(c3 + cs*c4 + cp*c5 + * ct*(c6 + cs*c7 + cp*c8 + ct*c9))) + * cs*(c10 + cp*(c11 + ct*c12)) + * cp*(c13 + ct*c14 + cp*(c15 + ct*(c16 + ct*c17))) ) #else pdens17 = c0 + * t*(c1 + s*c2 + * t*(c3 + s*c4 + p*c5 + * t*(c6 + s*c7 + p*c8 + t*c9))) + * s*(c10 + p*(c11 + t*c12)) + * p*(c13 + t*c14 + p*(c15 + t*(c16 + t*c17))) #endif #undef PDENS17 return end real function sdens012 (t, s) c------------------------------------------- real t, s #define SDENS12 #include "dens.h" #if defined (DOUBL_PRES) at = dble(t) as = dble(s) sdens012 = real(a0 + at*(a1 + as*a2 + at*(a3 + as*a4 + at*a6)) + as*a7) #else sdens012 = a0 + t*(a1 + s*a2 + t*(a3 + s*a4 + t*a6)) + s*a7 #endif #undef SDENS12 return end real function sdens014 (t, s) c------------------------------------------- real t, s #define SDENS14 #include "dens.h" #if defined (DOUBL_PRES) bt = dble(t) bs = dble(s) sdens014 = real(b0 + * bt*(b1 + bs*b2 + bt*(b3 + bs*b4 + bt*(b6 + bt*b8))) + bs*b9) #else sdens014 = b0 + t*(b1 + s*b2 + t*(b3 + s*b4 + t*(b6 + t*b8))) + s*b9 #endif #undef SDENS14 return end real function sdens017 (t, s) c------------------------------------------- real t, s #define SDENS17 #include "dens.h" #if defined (DOUBL_PRES) ct = dble(t) cs = dble(s) sdens017 = c0 + cs*c10 + * ct*(c1 + cs*c2 + ct*(c3 + cs*c4 + ct*(c6 + cs*c7 + ct*c9))) #else sdens017 = c0 + s*c10 + * t*(c1 + s*c2 + t*(c3 + s*c4 + t*(c6 + s*c7 + t*c9))) #endif #undef SDENS17 return end real function pdens012 (t, s) c------------------------------------------- real t, s #define PDENS12 #include "dens.h" #if defined (DOUBL_PRES) at = dble(t) as = dble(s) pdens012 = real(a0 + at*(a1 + as*a2 + at*(a3 + as*a4 + at*a6)) + as*a7) #else pdens012 = a0 + t*(a1 + s*a2 + t*(a3 + s*a4 + t*a6)) + s*a7 #endif #undef PDENS12 return end real function pdens014 (t, s) c------------------------------------------- real t, s #define PDENS14 #include "dens.h" #if defined (DOUBL_PRES) bt = dble(t) bs = dble(s) c pdens014 = real(b0 + * bt*(b1 + bs*b2 + bt*(b3 + bs*b4 + bt*(b6 + bt*b8))) + bs*b9) #else pdens014 = b0 + t*(b1 + s*b2 + t*(b3 + s*b4 + t*(b6 + t*b8))) + s*b9 #endif #undef PDENS14 return end real function pdens017 (t, s) c------------------------------------------- real t, s #define PDENS17 #include "dens.h" #if defined (DOUBL_PRES) ct = dble(t) cs = dble(s) pdens017 = c0 + cs*c10 + * ct*(c1 + cs*c2 + ct*(c3 + cs*c4 + ct*(c6 + cs*c7 + ct*c9))) #else pdens017 = c0 + s*c10 + * t*(c1 + s*c2 + t*(c3 + s*c4 + t*(c6 + s*c7 + t*c9))) #endif #undef PDENS17 return end real function pdens1 (t) c------------------------------------------------------------------ pdens1 = 42.48 - .8383 * t return end real function pdens4 (t,s,p) c------------------------------------------------------------------- pdens4 = .01191 - (.1281 + .003073*t)*t + .7912*s + .004429*p return end real function dens_marina (t) c------------------------------------------------------------------ dens_marina = 50.29 - 1.615 * t return end