c-------------------------------------------
c in situ density (kg/m^3) as a function of
c potential temperature, salinity & pressure.
      data a0  /  9.9984495075397717E+02 /
      data a1  /  4.7242360502556559E-02 /
      data a2  / -2.9355135788249624E-03 /
      data a3  / -7.4801638387318654E-03 /
      data a4  /  3.3806262972062488E-05 /
      data a5  /  3.6995743312330793E-07 /
      data a6  /  3.5589087697669534E-05 /
      data a7  /  8.0747615263133631E-01 /
      data a8  / -8.0022984647632515E-06 /
      data a9  /  5.0377429128311419E-03 /
      data a10 / -2.9566247219662127E-05 /
      data a11 / -5.1678728359375112E-08 /
      data a12 /  3.7388128423099962E-10 /

c   polynomial approximation function for density

      pdens12(tq,sq,pq) = a0 +   
     *     tq*(a1 + sq*a2  + tq*(a3  + sq*a4 + tq*a6)) +
     *     sq*(a7 + pq*a8) + 
     *     pq*(a9 + tq*(a10 + tq*a5) + pq*(a11 + tq*a12)) 

      alpha12(tq,sq,pq) = a1 + sq*a2  + pq*(a10 + qq*a12) + 
     *     tq*(2.*(a3 + sq*a4 + pq*a5) + tq*3.*tq*a6)

      beta12(tq,sq,pq) =  a7 + tq*(a2 + tq*a4) + pq*a8

      print*,pdens12(0,30,0),alpha12(0,30,0),beta12(0,30,0)

      print*,pdens12(30,36,200),alpha12(30,36,200),beta12(30,36,200)

      print*,pdens12(0,36,5000),alpha12(0,36,5000),beta12(0,36,5000)

      stop
      end
