eos_nemo.pro 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. function eos_nemo, t_in, psal
  2. ;------------------------------------------------------------------------------
  3. ;
  4. ; Purpose:
  5. ; To calculate the density using the equation of state used in NEMO.
  6. ; This is based on the Jackett and McDougall (1994) equation of state
  7. ; for calculating the in situ density based on potential temperature
  8. ; and salinity.
  9. ;
  10. ; Inputs:
  11. ; temperature => 1d array potential temperature (deg C)
  12. ; salinity => 1d array salinity (PSU)
  13. ;
  14. ; Outputs:
  15. ; rhop => 1d array pot density (kg/m**3)
  16. ;
  17. ; could add use a difference reference pressure
  18. ; observations are in-situ temperature?
  19. ;
  20. ; Author:
  21. ; D. J. Lea. Dec 2006.
  22. ;------------------------------------------------------------------------------
  23. zws = SQRT( ABS( psal ) )
  24. sz=size(t_in)
  25. ndim=sz(0)
  26. NO_LEVS=sz(ndim)
  27. prhop=psal*0.
  28. ;
  29. for jk = 0L, NO_LEVS-1 do begin
  30. zt = T_IN(jk)
  31. zs = psal(jk)
  32. ; * depth
  33. ; zh = O_DEP_LEVS(jk) ;used in calculating insitu density only
  34. zsr= zws(jk)
  35. ; * compute volumic mass pure water at atm pressure
  36. zr1= ( ( ( ( 6.536332e-9*zt-1.120083e-6 )*zt+1.001685e-4)*zt $
  37. -9.095290e-3 )*zt+6.793952e-2 )*zt+999.842594
  38. ; * seawater volumic mass atm pressure
  39. zr2= ( ( ( 5.3875e-9*zt-8.2467e-7 ) *zt+7.6438e-5 ) *zt $
  40. -4.0899e-3 ) *zt+0.824493
  41. zr3= ( -1.6546e-6*zt+1.0227e-4 ) *zt-5.72466e-3
  42. zr4= 4.8314e-4
  43. ; * potential volumic mass (reference to the surface)
  44. zrhop= ( zr4*zs + zr3*zsr + zr2 ) *zs + zr1
  45. ; * save potential volumic mass
  46. prhop(jk) = zrhop
  47. ; * add the compression terms
  48. ze = ( -3.508914e-8*zt-1.248266e-8 ) *zt-2.595994e-6
  49. zbw= ( 1.296821e-6*zt-5.782165e-9 ) *zt+1.045941e-4
  50. zb = zbw + ze * zs
  51. zd = -2.042967e-2
  52. zc = (-7.267926e-5*zt+2.598241e-3 ) *zt+0.1571896
  53. zaw= ( ( 5.939910e-6*zt+2.512549e-3 ) *zt-0.1028859 ) *zt - 4.721788
  54. za = ( zd*zsr + zc ) *zs + zaw
  55. zb1= (-0.1909078*zt+7.390729 ) *zt-55.87545
  56. za1= ( ( 2.326469e-3*zt+1.553190)*zt-65.00517 ) *zt+1044.077
  57. zkw= ( ( (-1.361629e-4*zt-1.852732e-2 ) *zt-30.41638 ) *zt + 2098.925 ) *zt+190925.6
  58. zk0= ( zb1*zsr + za1 )*zs + zkw
  59. ; ; in situ density anomaly
  60. ; prd(jk) = zrhop / ( 1.0 - zh / ( zk0 - zh * ( za - zh * zb ) ) )
  61. ;
  62. endfor
  63. return, prhop
  64. END