\hypertarget{namespacemom__eos__unesco}{}\section{mom\+\_\+eos\+\_\+unesco Module Reference}
\label{namespacemom__eos__unesco}\index{mom\+\_\+eos\+\_\+unesco@{mom\+\_\+eos\+\_\+unesco}}


\subsection{Detailed Description}
The equation of state using the Jackett and Mc\+Dougall fits to the U\+N\+E\+S\+CO E\+OS. \subsection*{Data Types}
\begin{DoxyCompactItemize}
\item 
interface \hyperlink{interfacemom__eos__unesco_1_1calculate__density__unesco}{calculate\+\_\+density\+\_\+unesco}
\begin{DoxyCompactList}\small\item\em Compute the in situ density of sea water (in \mbox{[}kg m-\/3\mbox{]}), or its anomaly with respect to a reference density, from salinity \mbox{[}P\+SU\mbox{]}, potential temperature \mbox{[}degC\mbox{]}, and pressure \mbox{[}Pa\mbox{]}, using the U\+N\+E\+S\+CO (1981) equation of state. \end{DoxyCompactList}\item 
interface \hyperlink{interfacemom__eos__unesco_1_1calculate__spec__vol__unesco}{calculate\+\_\+spec\+\_\+vol\+\_\+unesco}
\begin{DoxyCompactList}\small\item\em Compute the in situ specific volume of sea water (in \mbox{[}m3 kg-\/1\mbox{]}), or an anomaly with respect to a reference specific volume, from salinity \mbox{[}P\+SU\mbox{]}, potential temperature \mbox{[}degC\mbox{]}, and pressure \mbox{[}Pa\mbox{]}, using the U\+N\+E\+S\+CO (1981) equation of state. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \hyperlink{namespacemom__eos__unesco_a5b0789ed1bfd40e09ba994b656c14f47}{calculate\+\_\+density\+\_\+scalar\+\_\+unesco} (T, S, pressure, rho, rho\+\_\+ref)
\begin{DoxyCompactList}\small\item\em This subroutine computes the in situ density of sea water (rho in \mbox{[}kg m-\/3\mbox{]}) from salinity (S \mbox{[}P\+SU\mbox{]}), potential temperature (T \mbox{[}degC\mbox{]}), and pressure \mbox{[}Pa\mbox{]}, using the U\+N\+E\+S\+CO (1981) equation of state. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacemom__eos__unesco_a2a6110741c62f2f3a2df31fa88a63ce5}{calculate\+\_\+density\+\_\+array\+\_\+unesco} (T, S, pressure, rho, start, npts, rho\+\_\+ref)
\begin{DoxyCompactList}\small\item\em This subroutine computes the in situ density of sea water (rho in \mbox{[}kg m-\/3\mbox{]}) from salinity (S \mbox{[}P\+SU\mbox{]}), potential temperature (T \mbox{[}degC\mbox{]}), and pressure \mbox{[}Pa\mbox{]}, using the U\+N\+E\+S\+CO (1981) equation of state. \end{DoxyCompactList}\item 
subroutine \hyperlink{namespacemom__eos__unesco_a79b131a4287b138ebf37883d60b334be}{calculate\+\_\+spec\+\_\+vol\+\_\+scalar\+\_\+unesco} (T, S, pressure, specvol, spv\+\_\+ref)
\begin{DoxyCompactList}\small\item\em This subroutine computes the in situ specific volume of sea water (specvol in \mbox{[}m3 kg-\/1\mbox{]}) from salinity (S \mbox{[}P\+SU\mbox{]}), potential temperature (T \mbox{[}degC\mbox{]}) and pressure \mbox{[}Pa\mbox{]}, using the U\+N\+E\+S\+CO (1981) equation of state. If spv\+\_\+ref is present, specvol is an anomaly from spv\+\_\+ref. \end{DoxyCompactList}\item 
subroutine \hyperlink{namespacemom__eos__unesco_ad8670960a4b8e83186468a7a8cfa860c}{calculate\+\_\+spec\+\_\+vol\+\_\+array\+\_\+unesco} (T, S, pressure, specvol, start, npts, spv\+\_\+ref)
\begin{DoxyCompactList}\small\item\em This subroutine computes the in situ specific volume of sea water (specvol in \mbox{[}m3 kg-\/1\mbox{]}) from salinity (S \mbox{[}P\+SU\mbox{]}), potential temperature (T \mbox{[}degC\mbox{]}) and pressure \mbox{[}Pa\mbox{]}, using the U\+N\+E\+S\+CO (1981) equation of state. If spv\+\_\+ref is present, specvol is an anomaly from spv\+\_\+ref. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacemom__eos__unesco_af8666837abadea54c016bf59838f96cc}{calculate\+\_\+density\+\_\+derivs\+\_\+unesco} (T, S, pressure, drho\+\_\+dT, drho\+\_\+dS, start, npts)
\begin{DoxyCompactList}\small\item\em This subroutine calculates the partial derivatives of density with potential temperature and salinity. \end{DoxyCompactList}\item 
subroutine, public \hyperlink{namespacemom__eos__unesco_a4a125f4eb70d4b2517dadd2f9446f261}{calculate\+\_\+compress\+\_\+unesco} (T, S, pressure, rho, drho\+\_\+dp, start, npts)
\begin{DoxyCompactList}\small\item\em This subroutine computes the in situ density of sea water (rho) and the compressibility (drho/dp == C\+\_\+sound$^\wedge$-\/2) at the given salinity, potential temperature, and pressure. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\textbf{ }\par
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_aec6e084959be0e936944d0ad891c6d62}\label{namespacemom__eos__unesco_aec6e084959be0e936944d0ad891c6d62}} 
real, parameter \hyperlink{namespacemom__eos__unesco_aec6e084959be0e936944d0ad891c6d62}{r00} = 999.\+842594
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a2cd01e2f6b03ef7e9f83ff295760a9b9}\label{namespacemom__eos__unesco_a2cd01e2f6b03ef7e9f83ff295760a9b9}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a2cd01e2f6b03ef7e9f83ff295760a9b9}{r10} = 6.\+793952e-\/2
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a03cdfbb6ffe1295f75a0962f210264f0}\label{namespacemom__eos__unesco_a03cdfbb6ffe1295f75a0962f210264f0}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a03cdfbb6ffe1295f75a0962f210264f0}{r20} = -\/9.\+095290e-\/3
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a53ab5287961e5e6329d3ed6fc1d37a81}\label{namespacemom__eos__unesco_a53ab5287961e5e6329d3ed6fc1d37a81}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a53ab5287961e5e6329d3ed6fc1d37a81}{r30} = 1.\+001685e-\/4
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a6125e25418335e03aa90a9a2b2d4828c}\label{namespacemom__eos__unesco_a6125e25418335e03aa90a9a2b2d4828c}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a6125e25418335e03aa90a9a2b2d4828c}{r40} = -\/1.\+120083e-\/6
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_afd464f37d2585d9b9d19a502f31da143}\label{namespacemom__eos__unesco_afd464f37d2585d9b9d19a502f31da143}} 
real, parameter \hyperlink{namespacemom__eos__unesco_afd464f37d2585d9b9d19a502f31da143}{r50} = 6.\+536332e-\/9
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a21cbd62d7d5b2c82ad779a78d8b2ea5f}\label{namespacemom__eos__unesco_a21cbd62d7d5b2c82ad779a78d8b2ea5f}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a21cbd62d7d5b2c82ad779a78d8b2ea5f}{r01} = 0.\+824493
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a471b5c27e02179d06204389c943c3cc9}\label{namespacemom__eos__unesco_a471b5c27e02179d06204389c943c3cc9}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a471b5c27e02179d06204389c943c3cc9}{r11} = -\/4.\+0899e-\/3
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_aa4f16455d8e01cd15bf0a70b1c99bfee}\label{namespacemom__eos__unesco_aa4f16455d8e01cd15bf0a70b1c99bfee}} 
real, parameter \hyperlink{namespacemom__eos__unesco_aa4f16455d8e01cd15bf0a70b1c99bfee}{r21} = 7.\+6438e-\/5
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a5b5aa71cbb00ec747a5aa4a5de47552c}\label{namespacemom__eos__unesco_a5b5aa71cbb00ec747a5aa4a5de47552c}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a5b5aa71cbb00ec747a5aa4a5de47552c}{r31} = -\/8.\+2467e-\/7
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_af249a1551c05c88ec890d670d5f5a134}\label{namespacemom__eos__unesco_af249a1551c05c88ec890d670d5f5a134}} 
real, parameter \hyperlink{namespacemom__eos__unesco_af249a1551c05c88ec890d670d5f5a134}{r41} = 5.\+3875e-\/9
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a19bb4cf1c40cdc4d11f1b2b0b5ae85be}\label{namespacemom__eos__unesco_a19bb4cf1c40cdc4d11f1b2b0b5ae85be}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a19bb4cf1c40cdc4d11f1b2b0b5ae85be}{r032} = -\/5.\+72466e-\/3
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_acd0b5c8a3f0d0fe2410293a8aef56715}\label{namespacemom__eos__unesco_acd0b5c8a3f0d0fe2410293a8aef56715}} 
real, parameter \hyperlink{namespacemom__eos__unesco_acd0b5c8a3f0d0fe2410293a8aef56715}{r132} = 1.\+0227e-\/4
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a8b7723564316382dbceef38208f70de7}\label{namespacemom__eos__unesco_a8b7723564316382dbceef38208f70de7}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a8b7723564316382dbceef38208f70de7}{r232} = -\/1.\+6546e-\/6
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a94bb3f3888f682d53543ee30ef028260}\label{namespacemom__eos__unesco_a94bb3f3888f682d53543ee30ef028260}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a94bb3f3888f682d53543ee30ef028260}{r02} = 4.\+8314e-\/4
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_acd7297cabc3b57e9b1721f0f91225569}\label{namespacemom__eos__unesco_acd7297cabc3b57e9b1721f0f91225569}} 
real, parameter \hyperlink{namespacemom__eos__unesco_acd7297cabc3b57e9b1721f0f91225569}{s00} = 1.\+965933e4
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a99bec4e2325df9ce1090e921c11da721}\label{namespacemom__eos__unesco_a99bec4e2325df9ce1090e921c11da721}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a99bec4e2325df9ce1090e921c11da721}{s10} = 1.\+444304e2
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_aeb15ea9fc69a5b7d8e5fec943800e700}\label{namespacemom__eos__unesco_aeb15ea9fc69a5b7d8e5fec943800e700}} 
real, parameter \hyperlink{namespacemom__eos__unesco_aeb15ea9fc69a5b7d8e5fec943800e700}{s20} = -\/1.\+706103
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_aa6ee6c8687a061a4e41a1170bb292984}\label{namespacemom__eos__unesco_aa6ee6c8687a061a4e41a1170bb292984}} 
real, parameter \hyperlink{namespacemom__eos__unesco_aa6ee6c8687a061a4e41a1170bb292984}{s30} = 9.\+648704e-\/3
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_ab08e679ce5233cfd9f9b0d8f07be2871}\label{namespacemom__eos__unesco_ab08e679ce5233cfd9f9b0d8f07be2871}} 
real, parameter \hyperlink{namespacemom__eos__unesco_ab08e679ce5233cfd9f9b0d8f07be2871}{s40} = -\/4.\+190253e-\/5
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a7c8bf673dc04d9eff9de82b46ece1da1}\label{namespacemom__eos__unesco_a7c8bf673dc04d9eff9de82b46ece1da1}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a7c8bf673dc04d9eff9de82b46ece1da1}{s01} = 52.\+84855
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a6eea431cb8c60088ff34612a2c21a345}\label{namespacemom__eos__unesco_a6eea431cb8c60088ff34612a2c21a345}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a6eea431cb8c60088ff34612a2c21a345}{s11} = -\/3.\+101089e-\/1
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_af61b6fbd31740834ef24351d837af709}\label{namespacemom__eos__unesco_af61b6fbd31740834ef24351d837af709}} 
real, parameter \hyperlink{namespacemom__eos__unesco_af61b6fbd31740834ef24351d837af709}{s21} = 6.\+283263e-\/3
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a21cfa26bb3b1c8548ac83de8f23c4eb4}\label{namespacemom__eos__unesco_a21cfa26bb3b1c8548ac83de8f23c4eb4}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a21cfa26bb3b1c8548ac83de8f23c4eb4}{s31} = -\/5.\+084188e-\/5
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a31b71a7ae41ce3411886dec9c50c4865}\label{namespacemom__eos__unesco_a31b71a7ae41ce3411886dec9c50c4865}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a31b71a7ae41ce3411886dec9c50c4865}{s032} = 3.\+886640e-\/1
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a011f47b227a0234dccb56f9bfb0dfa35}\label{namespacemom__eos__unesco_a011f47b227a0234dccb56f9bfb0dfa35}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a011f47b227a0234dccb56f9bfb0dfa35}{s132} = 9.\+085835e-\/3
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_aa122b14d1144ede0d9e3495c8e1b0c76}\label{namespacemom__eos__unesco_aa122b14d1144ede0d9e3495c8e1b0c76}} 
real, parameter \hyperlink{namespacemom__eos__unesco_aa122b14d1144ede0d9e3495c8e1b0c76}{s232} = -\/4.\+619924e-\/4
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a780d61948abdd06131af986b9dd4261c}\label{namespacemom__eos__unesco_a780d61948abdd06131af986b9dd4261c}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a780d61948abdd06131af986b9dd4261c}{sp00} = 3.\+186519
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a242150f9e3c9f00af96a10875286e37f}\label{namespacemom__eos__unesco_a242150f9e3c9f00af96a10875286e37f}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a242150f9e3c9f00af96a10875286e37f}{sp10} = 2.\+212276e-\/2
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_ae0abcb6e0cf59b852b2d7879e843bd44}\label{namespacemom__eos__unesco_ae0abcb6e0cf59b852b2d7879e843bd44}} 
real, parameter \hyperlink{namespacemom__eos__unesco_ae0abcb6e0cf59b852b2d7879e843bd44}{sp20} = -\/2.\+984642e-\/4
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a14fee87c2a3377b31c972d0c9b45240f}\label{namespacemom__eos__unesco_a14fee87c2a3377b31c972d0c9b45240f}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a14fee87c2a3377b31c972d0c9b45240f}{sp30} = 1.\+956415e-\/6
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a603ea153deede9c22ecac87308a2f43c}\label{namespacemom__eos__unesco_a603ea153deede9c22ecac87308a2f43c}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a603ea153deede9c22ecac87308a2f43c}{sp01} = 6.\+704388e-\/3
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a7921c1315bf09f66fd94b4b9b44e7bf6}\label{namespacemom__eos__unesco_a7921c1315bf09f66fd94b4b9b44e7bf6}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a7921c1315bf09f66fd94b4b9b44e7bf6}{sp11} = -\/1.\+847318e-\/4
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a2a4329c556b9330f700317c565eae602}\label{namespacemom__eos__unesco_a2a4329c556b9330f700317c565eae602}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a2a4329c556b9330f700317c565eae602}{sp21} = 2.\+059331e-\/7
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a12af7ba7ec15677f56927642acb1f6a0}\label{namespacemom__eos__unesco_a12af7ba7ec15677f56927642acb1f6a0}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a12af7ba7ec15677f56927642acb1f6a0}{sp032} = 1.\+480266e-\/4
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_aae8e246add86a07cfd0a898218842aa7}\label{namespacemom__eos__unesco_aae8e246add86a07cfd0a898218842aa7}} 
real, parameter \hyperlink{namespacemom__eos__unesco_aae8e246add86a07cfd0a898218842aa7}{sp000} = 2.\+102898e-\/4
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a0ebb1ea5db199f9a340878c4e17268cf}\label{namespacemom__eos__unesco_a0ebb1ea5db199f9a340878c4e17268cf}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a0ebb1ea5db199f9a340878c4e17268cf}{sp010} = -\/1.\+202016e-\/5
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_a57bd745187bfb038d9720e53a6fb67db}\label{namespacemom__eos__unesco_a57bd745187bfb038d9720e53a6fb67db}} 
real, parameter \hyperlink{namespacemom__eos__unesco_a57bd745187bfb038d9720e53a6fb67db}{sp020} = 1.\+394680e-\/7
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_aa0d0ecdb59955f69cf57d51fd73912b3}\label{namespacemom__eos__unesco_aa0d0ecdb59955f69cf57d51fd73912b3}} 
real, parameter \hyperlink{namespacemom__eos__unesco_aa0d0ecdb59955f69cf57d51fd73912b3}{sp001} = -\/2.\+040237e-\/6
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_ade7b24ca7125a6f423c37780b2e926d3}\label{namespacemom__eos__unesco_ade7b24ca7125a6f423c37780b2e926d3}} 
real, parameter \hyperlink{namespacemom__eos__unesco_ade7b24ca7125a6f423c37780b2e926d3}{sp011} = 6.\+128773e-\/8
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__eos__unesco_ac84a751711cc095ccd72261ac5abe0ca}\label{namespacemom__eos__unesco_ac84a751711cc095ccd72261ac5abe0ca}} 
real, parameter \hyperlink{namespacemom__eos__unesco_ac84a751711cc095ccd72261ac5abe0ca}{sp021} = 6.\+207323e-\/10
\begin{DoxyCompactList}\small\item\em Parameters in the U\+N\+E\+S\+CO equation of state. \end{DoxyCompactList}\end{DoxyCompactItemize}



\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacemom__eos__unesco_a4a125f4eb70d4b2517dadd2f9446f261}\label{namespacemom__eos__unesco_a4a125f4eb70d4b2517dadd2f9446f261}} 
\index{mom\+\_\+eos\+\_\+unesco@{mom\+\_\+eos\+\_\+unesco}!calculate\+\_\+compress\+\_\+unesco@{calculate\+\_\+compress\+\_\+unesco}}
\index{calculate\+\_\+compress\+\_\+unesco@{calculate\+\_\+compress\+\_\+unesco}!mom\+\_\+eos\+\_\+unesco@{mom\+\_\+eos\+\_\+unesco}}
\subsubsection{\texorpdfstring{calculate\+\_\+compress\+\_\+unesco()}{calculate\_compress\_unesco()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+eos\+\_\+unesco\+::calculate\+\_\+compress\+\_\+unesco (\begin{DoxyParamCaption}\item[{real, dimension(\+:), intent(in)}]{T,  }\item[{real, dimension(\+:), intent(in)}]{S,  }\item[{real, dimension(\+:), intent(in)}]{pressure,  }\item[{real, dimension(\+:), intent(out)}]{rho,  }\item[{real, dimension(\+:), intent(out)}]{drho\+\_\+dp,  }\item[{integer, intent(in)}]{start,  }\item[{integer, intent(in)}]{npts }\end{DoxyParamCaption})}



This subroutine computes the in situ density of sea water (rho) and the compressibility (drho/dp == C\+\_\+sound$^\wedge$-\/2) at the given salinity, potential temperature, and pressure. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em t} & Potential temperature relative to the surface \mbox{[}degC\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em s} & Salinity \mbox{[}P\+SU\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em pressure} & Pressure \mbox{[}Pa\mbox{]}.\\
\hline
\mbox{\tt out}  & {\em rho} & In situ density \mbox{[}kg m-\/3\mbox{]}.\\
\hline
\mbox{\tt out}  & {\em drho\+\_\+dp} & The partial derivative of density with pressure (also the inverse of the square of sound speed) \mbox{[}s2 m-\/2\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em start} & The starting point in the arrays.\\
\hline
\mbox{\tt in}  & {\em npts} & The number of values to calculate. \\
\hline
\end{DoxyParams}


Definition at line 284 of file M\+O\+M\+\_\+\+E\+O\+S\+\_\+\+U\+N\+E\+S\+C\+O.\+F90.


\begin{DoxyCode}
284   \textcolor{keywordtype}{real},    \textcolor{keywordtype}{intent(in)},  \textcolor{keywordtype}{dimension(:)} :: t\textcolor{comment}{        !< Potential temperature relative to the surface}
285 \textcolor{comment}{                                                 !! [degC].}
286   \textcolor{keywordtype}{real},    \textcolor{keywordtype}{intent(in)},  \textcolor{keywordtype}{dimension(:)} :: s\textcolor{comment}{        !< Salinity [PSU].}
287   \textcolor{keywordtype}{real},    \textcolor{keywordtype}{intent(in)},  \textcolor{keywordtype}{dimension(:)} :: pressure\textcolor{comment}{ !< Pressure [Pa].}
288   \textcolor{keywordtype}{real},    \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{dimension(:)} :: rho\textcolor{comment}{      !< In situ density [kg m-3].}
289   \textcolor{keywordtype}{real},    \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{dimension(:)} :: drho\_dp\textcolor{comment}{  !< The partial derivative of density with pressure}
290 \textcolor{comment}{                                                 !! (also the inverse of the square of sound speed)}
291 \textcolor{comment}{                                                 !! [s2 m-2].}
292   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}                :: start\textcolor{comment}{    !< The starting point in the arrays.}
293   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}                :: npts\textcolor{comment}{     !< The number of values to calculate.}
294 
295   \textcolor{comment}{! Local variables}
296   \textcolor{keywordtype}{real} :: t\_local, t2, t3, t4, t5  \textcolor{comment}{! Temperature to the 1st - 5th power [degC^n].}
297   \textcolor{keywordtype}{real} :: s\_local, s32, s2         \textcolor{comment}{! Salinity to the 1st, 3/2, & 2nd power [PSU^n].}
298   \textcolor{keywordtype}{real} :: p1, p2          \textcolor{comment}{! Pressure to the 1st & 2nd power [bar] and [bar2].}
299   \textcolor{keywordtype}{real} :: rho0            \textcolor{comment}{! Density at 1 bar pressure [kg m-3].}
300   \textcolor{keywordtype}{real} :: ks              \textcolor{comment}{! The secant bulk modulus [bar].}
301   \textcolor{keywordtype}{real} :: ks\_0, ks\_1, ks\_2
302   \textcolor{keywordtype}{real} :: dks\_dp       \textcolor{comment}{! The derivative of the secant bulk modulus}
303                        \textcolor{comment}{! with pressure, nondimensional.}
304   \textcolor{keywordtype}{integer} :: j
305 
306   \textcolor{keywordflow}{do} j=start,start+npts-1
307     \textcolor{keywordflow}{if} (s(j) < -1.0e-10) \textcolor{keywordflow}{then} \textcolor{comment}{!Can we assume safely that this is a missing value?}
308       rho(j) = 1000.0 ; drho\_dp(j) = 0.0
309       cycle
310 \textcolor{keywordflow}{    endif}
311 
312     p1 = pressure(j)*1.0e-5; p2 = p1*p1
313     t\_local = t(j); t2 = t\_local*t\_local; t3 = t\_local*t2; t4 = t2*t2; t5 = t3*t2
314     s\_local = s(j); s2 = s\_local*s\_local; s32 = s\_local*sqrt(s\_local)
315 
316 \textcolor{comment}{!  Compute rho(s,theta,p=0) - (same as rho(s,t\_insitu,p=0) ).}
317 
318     rho0 = r00 + r10*t\_local + r20*t2 + r30*t3 + r40*t4 + r50*t5 + &
319            s\_local*(r01 + r11*t\_local + r21*t2 + r31*t3 + r41*t4) + &
320            s32*(r032 + r132*t\_local + r232*t2) + r02*s2
321 
322 \textcolor{comment}{!  Compute rho(s,theta,p), first calculating the secant bulk modulus.}
323     ks\_0 = s00 + s10*t\_local + s20*t2 + s30*t3 + s40*t4 + &
324            s\_local*(s01 + s11*t\_local + s21*t2 + s31*t3) + s32*(s032 + s132*t\_local + s232*t2)
325     ks\_1 = sp00 + sp10*t\_local + sp20*t2 + sp30*t3 + &
326            s\_local*(sp01 + sp11*t\_local + sp21*t2) + sp032*s32
327     ks\_2 = sp000 + sp010*t\_local + sp020*t2 + s\_local*(sp001 + sp011*t\_local + sp021*t2)
328 
329     ks = ks\_0 + p1*ks\_1 + p2*ks\_2
330     dks\_dp = ks\_1 + 2.0*p1*ks\_2
331 
332     rho(j) = rho0*ks / (ks - p1)
333 \textcolor{comment}{! The factor of 1.0e-5 is because pressure here is in bars, not Pa.}
334     drho\_dp(j) = 1.0e-5 * (rho(j) / (ks - p1)) * (1.0 - dks\_dp*p1/ks)
335 \textcolor{keywordflow}{  enddo}
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__eos__unesco_a2a6110741c62f2f3a2df31fa88a63ce5}\label{namespacemom__eos__unesco_a2a6110741c62f2f3a2df31fa88a63ce5}} 
\index{mom\+\_\+eos\+\_\+unesco@{mom\+\_\+eos\+\_\+unesco}!calculate\+\_\+density\+\_\+array\+\_\+unesco@{calculate\+\_\+density\+\_\+array\+\_\+unesco}}
\index{calculate\+\_\+density\+\_\+array\+\_\+unesco@{calculate\+\_\+density\+\_\+array\+\_\+unesco}!mom\+\_\+eos\+\_\+unesco@{mom\+\_\+eos\+\_\+unesco}}
\subsubsection{\texorpdfstring{calculate\+\_\+density\+\_\+array\+\_\+unesco()}{calculate\_density\_array\_unesco()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+eos\+\_\+unesco\+::calculate\+\_\+density\+\_\+array\+\_\+unesco (\begin{DoxyParamCaption}\item[{real, dimension(\+:), intent(in)}]{T,  }\item[{real, dimension(\+:), intent(in)}]{S,  }\item[{real, dimension(\+:), intent(in)}]{pressure,  }\item[{real, dimension(\+:), intent(out)}]{rho,  }\item[{integer, intent(in)}]{start,  }\item[{integer, intent(in)}]{npts,  }\item[{real, intent(in), optional}]{rho\+\_\+ref }\end{DoxyParamCaption})}



This subroutine computes the in situ density of sea water (rho in \mbox{[}kg m-\/3\mbox{]}) from salinity (S \mbox{[}P\+SU\mbox{]}), potential temperature (T \mbox{[}degC\mbox{]}), and pressure \mbox{[}Pa\mbox{]}, using the U\+N\+E\+S\+CO (1981) equation of state. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em t} & potential temperature relative to the surface \mbox{[}degC\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em s} & salinity \mbox{[}P\+SU\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em pressure} & pressure \mbox{[}Pa\mbox{]}.\\
\hline
\mbox{\tt out}  & {\em rho} & in situ density \mbox{[}kg m-\/3\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em start} & the starting point in the arrays.\\
\hline
\mbox{\tt in}  & {\em npts} & the number of values to calculate.\\
\hline
\mbox{\tt in}  & {\em rho\+\_\+ref} & A reference density \mbox{[}kg m-\/3\mbox{]}. \\
\hline
\end{DoxyParams}


Definition at line 83 of file M\+O\+M\+\_\+\+E\+O\+S\+\_\+\+U\+N\+E\+S\+C\+O.\+F90.


\begin{DoxyCode}
83   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: t\textcolor{comment}{        !< potential temperature relative to the surface [degC].}
84   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: s\textcolor{comment}{        !< salinity [PSU].}
85   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: pressure\textcolor{comment}{ !< pressure [Pa].}
86   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(out)} :: rho\textcolor{comment}{      !< in situ density [kg m-3].}
87   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}  :: start\textcolor{comment}{    !< the starting point in the arrays.}
88   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}  :: npts\textcolor{comment}{     !< the number of values to calculate.}
89   \textcolor{keywordtype}{real},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: rho\_ref\textcolor{comment}{  !< A reference density [kg m-3].}
90 
91   \textcolor{comment}{! Local variables}
92   \textcolor{keywordtype}{real} :: t\_local, t2, t3, t4, t5  \textcolor{comment}{! Temperature to the 1st - 5th power [degC^n].}
93   \textcolor{keywordtype}{real} :: s\_local, s32, s2         \textcolor{comment}{! Salinity to the 1st, 3/2, & 2nd power [PSU^n].}
94   \textcolor{keywordtype}{real} :: p1, p2      \textcolor{comment}{! Pressure (in bars) to the 1st and 2nd power [bar] and [bar2].}
95   \textcolor{keywordtype}{real} :: rho0        \textcolor{comment}{! Density at 1 bar pressure [kg m-3].}
96   \textcolor{keywordtype}{real} :: sig0        \textcolor{comment}{! The anomaly of rho0 from R00 [kg m-3].}
97   \textcolor{keywordtype}{real} :: ks          \textcolor{comment}{! The secant bulk modulus [bar].}
98   \textcolor{keywordtype}{integer} :: j
99 
100   \textcolor{keywordflow}{do} j=start,start+npts-1
101     \textcolor{keywordflow}{if} (s(j) < -1.0e-10) \textcolor{keywordflow}{then} \textcolor{comment}{!Can we assume safely that this is a missing value?}
102       rho(j) = 1000.0
103       cycle
104 \textcolor{keywordflow}{    endif}
105 
106     p1 = pressure(j)*1.0e-5; p2 = p1*p1
107     t\_local = t(j); t2 = t\_local*t\_local; t3 = t\_local*t2; t4 = t2*t2; t5 = t3*t2
108     s\_local = s(j); s2 = s\_local*s\_local; s32 = s\_local*sqrt(s\_local)
109 
110 \textcolor{comment}{!  Compute rho(s,theta,p=0) - (same as rho(s,t\_insitu,p=0) ).}
111 
112     sig0 = r10*t\_local + r20*t2 + r30*t3 + r40*t4 + r50*t5 + &
113            s\_local*(r01 + r11*t\_local + r21*t2 + r31*t3 + r41*t4) + &
114            s32*(r032 + r132*t\_local + r232*t2) + r02*s2
115     rho0 = r00 + sig0
116 
117 \textcolor{comment}{!  Compute rho(s,theta,p), first calculating the secant bulk modulus.}
118 
119     ks = s00 + s10*t\_local + s20*t2 + s30*t3 + s40*t4 + s\_local*(s01 + s11*t\_local + s21*t2 + s31*t3) + &
120          s32*(s032 + s132*t\_local + s232*t2) + &
121          p1*(sp00 + sp10*t\_local + sp20*t2 + sp30*t3 + &
122              s\_local*(sp01 + sp11*t\_local + sp21*t2) + sp032*s32) + &
123          p2*(sp000 + sp010*t\_local + sp020*t2 + s\_local*(sp001 + sp011*t\_local + sp021*t2))
124 
125     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(rho\_ref)) \textcolor{keywordflow}{then}
126       rho(j) = ((r00 - rho\_ref)*ks + (sig0*ks + p1*rho\_ref)) / (ks - p1)
127     \textcolor{keywordflow}{else}
128       rho(j) = rho0*ks / (ks - p1)
129 \textcolor{keywordflow}{    endif}
130 \textcolor{keywordflow}{  enddo}
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__eos__unesco_af8666837abadea54c016bf59838f96cc}\label{namespacemom__eos__unesco_af8666837abadea54c016bf59838f96cc}} 
\index{mom\+\_\+eos\+\_\+unesco@{mom\+\_\+eos\+\_\+unesco}!calculate\+\_\+density\+\_\+derivs\+\_\+unesco@{calculate\+\_\+density\+\_\+derivs\+\_\+unesco}}
\index{calculate\+\_\+density\+\_\+derivs\+\_\+unesco@{calculate\+\_\+density\+\_\+derivs\+\_\+unesco}!mom\+\_\+eos\+\_\+unesco@{mom\+\_\+eos\+\_\+unesco}}
\subsubsection{\texorpdfstring{calculate\+\_\+density\+\_\+derivs\+\_\+unesco()}{calculate\_density\_derivs\_unesco()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+eos\+\_\+unesco\+::calculate\+\_\+density\+\_\+derivs\+\_\+unesco (\begin{DoxyParamCaption}\item[{real, dimension(\+:), intent(in)}]{T,  }\item[{real, dimension(\+:), intent(in)}]{S,  }\item[{real, dimension(\+:), intent(in)}]{pressure,  }\item[{real, dimension(\+:), intent(out)}]{drho\+\_\+dT,  }\item[{real, dimension(\+:), intent(out)}]{drho\+\_\+dS,  }\item[{integer, intent(in)}]{start,  }\item[{integer, intent(in)}]{npts }\end{DoxyParamCaption})}



This subroutine calculates the partial derivatives of density with potential temperature and salinity. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em t} & Potential temperature relative to the surface \mbox{[}degC\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em s} & Salinity \mbox{[}P\+SU\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em pressure} & Pressure \mbox{[}Pa\mbox{]}.\\
\hline
\mbox{\tt out}  & {\em drho\+\_\+dt} & The partial derivative of density with potential temperature \mbox{[}kg m-\/3 deg\+C-\/1\mbox{]}.\\
\hline
\mbox{\tt out}  & {\em drho\+\_\+ds} & The partial derivative of density with salinity, in \mbox{[}kg m-\/3 P\+S\+U-\/1\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em start} & The starting point in the arrays.\\
\hline
\mbox{\tt in}  & {\em npts} & The number of values to calculate. \\
\hline
\end{DoxyParams}


Definition at line 213 of file M\+O\+M\+\_\+\+E\+O\+S\+\_\+\+U\+N\+E\+S\+C\+O.\+F90.


\begin{DoxyCode}
213   \textcolor{keywordtype}{real},    \textcolor{keywordtype}{intent(in)},  \textcolor{keywordtype}{dimension(:)} :: t\textcolor{comment}{        !< Potential temperature relative to the surface}
214 \textcolor{comment}{                                                 !! [degC].}
215   \textcolor{keywordtype}{real},    \textcolor{keywordtype}{intent(in)},  \textcolor{keywordtype}{dimension(:)} :: s\textcolor{comment}{        !< Salinity [PSU].}
216   \textcolor{keywordtype}{real},    \textcolor{keywordtype}{intent(in)},  \textcolor{keywordtype}{dimension(:)} :: pressure\textcolor{comment}{ !< Pressure [Pa].}
217   \textcolor{keywordtype}{real},    \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{dimension(:)} :: drho\_dt\textcolor{comment}{  !< The partial derivative of density with potential}
218 \textcolor{comment}{                                                 !! temperature [kg m-3 degC-1].}
219   \textcolor{keywordtype}{real},    \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{dimension(:)} :: drho\_ds\textcolor{comment}{  !< The partial derivative of density with salinity,}
220 \textcolor{comment}{                                                 !! in [kg m-3 PSU-1].}
221   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}                :: start\textcolor{comment}{    !< The starting point in the arrays.}
222   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}                :: npts\textcolor{comment}{     !< The number of values to calculate.}
223 
224   \textcolor{comment}{! Local variables}
225   \textcolor{keywordtype}{real} :: t\_local, t2, t3, t4, t5  \textcolor{comment}{! Temperature to the 1st - 5th power [degC^n].}
226   \textcolor{keywordtype}{real} :: s12, s\_local, s32, s2    \textcolor{comment}{! Salinity to the 1/2 - 2nd powers [PSU^n].}
227   \textcolor{keywordtype}{real} :: p1, p2          \textcolor{comment}{! Pressure to the 1st & 2nd power [bar] and [bar2].}
228   \textcolor{keywordtype}{real} :: rho0            \textcolor{comment}{! Density at 1 bar pressure [kg m-3].}
229   \textcolor{keywordtype}{real} :: ks              \textcolor{comment}{! The secant bulk modulus [bar].}
230   \textcolor{keywordtype}{real} :: drho0\_dt        \textcolor{comment}{! Derivative of rho0 with T [kg m-3 degC-1].}
231   \textcolor{keywordtype}{real} :: drho0\_ds        \textcolor{comment}{! Derivative of rho0 with S [kg m-3 PSU-1].}
232   \textcolor{keywordtype}{real} :: dks\_dt          \textcolor{comment}{! Derivative of ks with T [bar degC-1].}
233   \textcolor{keywordtype}{real} :: dks\_ds          \textcolor{comment}{! Derivative of ks with S [bar psu-1].}
234   \textcolor{keywordtype}{real} :: denom           \textcolor{comment}{! 1.0 / (ks - p1) [bar-1].}
235   \textcolor{keywordtype}{integer} :: j
236 
237   \textcolor{keywordflow}{do} j=start,start+npts-1
238     \textcolor{keywordflow}{if} (s(j) < -1.0e-10) \textcolor{keywordflow}{then} \textcolor{comment}{!Can we assume safely that this is a missing value?}
239       drho\_dt(j) = 0.0 ; drho\_ds(j) = 0.0
240       cycle
241 \textcolor{keywordflow}{    endif}
242 
243     p1 = pressure(j)*1.0e-5; p2 = p1*p1
244     t\_local = t(j); t2 = t\_local*t\_local; t3 = t\_local*t2; t4 = t2*t2; t5 = t3*t2
245     s\_local = s(j); s2 = s\_local*s\_local; s12 = sqrt(s\_local); s32 = s\_local*s12
246 
247 \textcolor{comment}{!       compute rho(s,theta,p=0) - (same as rho(s,t\_insitu,p=0) )}
248 
249     rho0 = r00 + r10*t\_local + r20*t2 + r30*t3 + r40*t4 + r50*t5 + &
250            s\_local*(r01 + r11*t\_local + r21*t2 + r31*t3 + r41*t4) + &
251            s32*(r032 + r132*t\_local + r232*t2) + r02*s2
252     drho0\_dt = r10 + 2.0*r20*t\_local + 3.0*r30*t2 + 4.0*r40*t3 + 5.0*r50*t4 + &
253                s\_local*(r11 + 2.0*r21*t\_local + 3.0*r31*t2 + 4.0*r41*t3) + &
254                s32*(r132 + 2.0*r232*t\_local)
255     drho0\_ds = (r01 + r11*t\_local + r21*t2 + r31*t3 + r41*t4) + &
256                1.5*s12*(r032 + r132*t\_local + r232*t2) + 2.0*r02*s\_local
257 
258 \textcolor{comment}{!       compute rho(s,theta,p)}
259 
260     ks = s00 + s10*t\_local + s20*t2 + s30*t3 + s40*t4 + s\_local*(s01 + s11*t\_local + s21*t2 + s31*t3) + &
261          s32*(s032 + s132*t\_local + s232*t2) + &
262          p1*(sp00 + sp10*t\_local + sp20*t2 + sp30*t3 + &
263              s\_local*(sp01 + sp11*t\_local + sp21*t2) + sp032*s32) + &
264          p2*(sp000 + sp010*t\_local + sp020*t2 + s\_local*(sp001 + sp011*t\_local + sp021*t2))
265     dks\_dt = s10 + 2.0*s20*t\_local + 3.0*s30*t2 + 4.0*s40*t3 + &
266              s\_local*(s11 + 2.0*s21*t\_local + 3.0*s31*t2) + s32*(s132 + 2.0*s232*t\_local) + &
267              p1*(sp10 + 2.0*sp20*t\_local + 3.0*sp30*t2 + s\_local*(sp11 + 2.0*sp21*t\_local)) + &
268              p2*(sp010 + 2.0*sp020*t\_local + s\_local*(sp011 + 2.0*sp021*t\_local))
269     dks\_ds = (s01 + s11*t\_local + s21*t2 + s31*t3) + 1.5*s12*(s032 + s132*t\_local + s232*t2) + &
270              p1*(sp01 + sp11*t\_local + sp21*t2 + 1.5*sp032*s12) + &
271              p2*(sp001 + sp011*t\_local + sp021*t2)
272 
273     denom = 1.0 / (ks - p1)
274     drho\_dt(j) = denom*(ks*drho0\_dt - rho0*p1*denom*dks\_dt)
275     drho\_ds(j) = denom*(ks*drho0\_ds - rho0*p1*denom*dks\_ds)
276 \textcolor{keywordflow}{  enddo}
277 
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__eos__unesco_a5b0789ed1bfd40e09ba994b656c14f47}\label{namespacemom__eos__unesco_a5b0789ed1bfd40e09ba994b656c14f47}} 
\index{mom\+\_\+eos\+\_\+unesco@{mom\+\_\+eos\+\_\+unesco}!calculate\+\_\+density\+\_\+scalar\+\_\+unesco@{calculate\+\_\+density\+\_\+scalar\+\_\+unesco}}
\index{calculate\+\_\+density\+\_\+scalar\+\_\+unesco@{calculate\+\_\+density\+\_\+scalar\+\_\+unesco}!mom\+\_\+eos\+\_\+unesco@{mom\+\_\+eos\+\_\+unesco}}
\subsubsection{\texorpdfstring{calculate\+\_\+density\+\_\+scalar\+\_\+unesco()}{calculate\_density\_scalar\_unesco()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+eos\+\_\+unesco\+::calculate\+\_\+density\+\_\+scalar\+\_\+unesco (\begin{DoxyParamCaption}\item[{real, intent(in)}]{T,  }\item[{real, intent(in)}]{S,  }\item[{real, intent(in)}]{pressure,  }\item[{real, intent(out)}]{rho,  }\item[{real, intent(in), optional}]{rho\+\_\+ref }\end{DoxyParamCaption})}



This subroutine computes the in situ density of sea water (rho in \mbox{[}kg m-\/3\mbox{]}) from salinity (S \mbox{[}P\+SU\mbox{]}), potential temperature (T \mbox{[}degC\mbox{]}), and pressure \mbox{[}Pa\mbox{]}, using the U\+N\+E\+S\+CO (1981) equation of state. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em t} & Potential temperature relative to the surface \mbox{[}degC\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em s} & Salinity \mbox{[}P\+SU\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em pressure} & pressure \mbox{[}Pa\mbox{]}.\\
\hline
\mbox{\tt out}  & {\em rho} & In situ density \mbox{[}kg m-\/3\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em rho\+\_\+ref} & A reference density \mbox{[}kg m-\/3\mbox{]}. \\
\hline
\end{DoxyParams}


Definition at line 60 of file M\+O\+M\+\_\+\+E\+O\+S\+\_\+\+U\+N\+E\+S\+C\+O.\+F90.


\begin{DoxyCode}
60   \textcolor{keywordtype}{real},           \textcolor{keywordtype}{intent(in)}  :: t\textcolor{comment}{        !< Potential temperature relative to the surface [degC].}
61   \textcolor{keywordtype}{real},           \textcolor{keywordtype}{intent(in)}  :: s\textcolor{comment}{        !< Salinity [PSU].}
62   \textcolor{keywordtype}{real},           \textcolor{keywordtype}{intent(in)}  :: pressure\textcolor{comment}{ !< pressure [Pa].}
63   \textcolor{keywordtype}{real},           \textcolor{keywordtype}{intent(out)} :: rho\textcolor{comment}{      !< In situ density [kg m-3].}
64   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: rho\_ref\textcolor{comment}{  !< A reference density [kg m-3].}
65 
66   \textcolor{comment}{! Local variables}
67   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(1)} :: t0, s0, pressure0
68   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(1)} :: rho0
69 
70   t0(1) = t
71   s0(1) = s
72   pressure0(1) = pressure
73 
74   \textcolor{keyword}{call }calculate\_density\_array\_unesco(t0, s0, pressure0, rho0, 1, 1, rho\_ref)
75   rho = rho0(1)
76 
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__eos__unesco_ad8670960a4b8e83186468a7a8cfa860c}\label{namespacemom__eos__unesco_ad8670960a4b8e83186468a7a8cfa860c}} 
\index{mom\+\_\+eos\+\_\+unesco@{mom\+\_\+eos\+\_\+unesco}!calculate\+\_\+spec\+\_\+vol\+\_\+array\+\_\+unesco@{calculate\+\_\+spec\+\_\+vol\+\_\+array\+\_\+unesco}}
\index{calculate\+\_\+spec\+\_\+vol\+\_\+array\+\_\+unesco@{calculate\+\_\+spec\+\_\+vol\+\_\+array\+\_\+unesco}!mom\+\_\+eos\+\_\+unesco@{mom\+\_\+eos\+\_\+unesco}}
\subsubsection{\texorpdfstring{calculate\+\_\+spec\+\_\+vol\+\_\+array\+\_\+unesco()}{calculate\_spec\_vol\_array\_unesco()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+\_\+unesco\+::calculate\+\_\+spec\+\_\+vol\+\_\+array\+\_\+unesco (\begin{DoxyParamCaption}\item[{real, dimension(\+:), intent(in)}]{T,  }\item[{real, dimension(\+:), intent(in)}]{S,  }\item[{real, dimension(\+:), intent(in)}]{pressure,  }\item[{real, dimension(\+:), intent(out)}]{specvol,  }\item[{integer, intent(in)}]{start,  }\item[{integer, intent(in)}]{npts,  }\item[{real, intent(in), optional}]{spv\+\_\+ref }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine computes the in situ specific volume of sea water (specvol in \mbox{[}m3 kg-\/1\mbox{]}) from salinity (S \mbox{[}P\+SU\mbox{]}), potential temperature (T \mbox{[}degC\mbox{]}) and pressure \mbox{[}Pa\mbox{]}, using the U\+N\+E\+S\+CO (1981) equation of state. If spv\+\_\+ref is present, specvol is an anomaly from spv\+\_\+ref. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em t} & potential temperature relative to the surface \mbox{[}degC\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em s} & salinity \mbox{[}P\+SU\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em pressure} & pressure \mbox{[}Pa\mbox{]}.\\
\hline
\mbox{\tt out}  & {\em specvol} & in situ specific volume \mbox{[}m3 kg-\/1\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em start} & the starting point in the arrays.\\
\hline
\mbox{\tt in}  & {\em npts} & the number of values to calculate.\\
\hline
\mbox{\tt in}  & {\em spv\+\_\+ref} & A reference specific volume \mbox{[}m3 kg-\/1\mbox{]}. \\
\hline
\end{DoxyParams}


Definition at line 159 of file M\+O\+M\+\_\+\+E\+O\+S\+\_\+\+U\+N\+E\+S\+C\+O.\+F90.


\begin{DoxyCode}
159   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: t\textcolor{comment}{        !< potential temperature relative to the surface}
160 \textcolor{comment}{                                              !! [degC].}
161   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: s\textcolor{comment}{        !< salinity [PSU].}
162   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: pressure\textcolor{comment}{ !< pressure [Pa].}
163   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(out)} :: specvol\textcolor{comment}{  !< in situ specific volume [m3 kg-1].}
164   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}  :: start\textcolor{comment}{    !< the starting point in the arrays.}
165   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}  :: npts\textcolor{comment}{     !< the number of values to calculate.}
166   \textcolor{keywordtype}{real},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: spv\_ref\textcolor{comment}{  !< A reference specific volume [m3 kg-1].}
167 
168   \textcolor{comment}{! Local variables}
169   \textcolor{keywordtype}{real} :: t\_local, t2, t3, t4, t5  \textcolor{comment}{! Temperature to the 1st - 5th power [degC^n].}
170   \textcolor{keywordtype}{real} :: s\_local, s32, s2         \textcolor{comment}{! Salinity to the 1st, 3/2, & 2nd power [PSU^n].}
171   \textcolor{keywordtype}{real} :: p1, p2       \textcolor{comment}{! Pressure (in bars) to the 1st and 2nd power [bar] and [bar2].}
172   \textcolor{keywordtype}{real} :: rho0         \textcolor{comment}{! Density at 1 bar pressure [kg m-3].}
173   \textcolor{keywordtype}{real} :: ks           \textcolor{comment}{! The secant bulk modulus [bar].}
174   \textcolor{keywordtype}{integer} :: j
175 
176   \textcolor{keywordflow}{do} j=start,start+npts-1
177     \textcolor{keywordflow}{if} (s(j) < -1.0e-10) \textcolor{keywordflow}{then} \textcolor{comment}{!Can we assume safely that this is a missing value?}
178       specvol(j) = 0.001
179       \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(spv\_ref)) specvol(j) = 0.001 - spv\_ref
180       cycle
181 \textcolor{keywordflow}{    endif}
182 
183     p1 = pressure(j)*1.0e-5; p2 = p1*p1
184     t\_local = t(j); t2 = t\_local*t\_local; t3 = t\_local*t2; t4 = t2*t2; t5 = t3*t2
185     s\_local = s(j); s2 = s\_local*s\_local; s32 = s\_local*sqrt(s\_local)
186 
187 \textcolor{comment}{!  Compute rho(s,theta,p=0) - (same as rho(s,t\_insitu,p=0) ).}
188 
189     rho0 = r00 + r10*t\_local + r20*t2 + r30*t3 + r40*t4 + r50*t5 + &
190            s\_local*(r01 + r11*t\_local + r21*t2 + r31*t3 + r41*t4) + &
191            s32*(r032 + r132*t\_local + r232*t2) + r02*s2
192 
193 \textcolor{comment}{!  Compute rho(s,theta,p), first calculating the secant bulk modulus.}
194 
195     ks = s00 + s10*t\_local + s20*t2 + s30*t3 + s40*t4 + s\_local*(s01 + s11*t\_local + s21*t2 + s31*t3) + &
196          s32*(s032 + s132*t\_local + s232*t2) + &
197          p1*(sp00 + sp10*t\_local + sp20*t2 + sp30*t3 + &
198              s\_local*(sp01 + sp11*t\_local + sp21*t2) + sp032*s32) + &
199          p2*(sp000 + sp010*t\_local + sp020*t2 + s\_local*(sp001 + sp011*t\_local + sp021*t2))
200 
201     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(spv\_ref)) \textcolor{keywordflow}{then}
202       specvol(j) = (ks*(1.0 - (rho0*spv\_ref)) - p1) / (rho0*ks)
203     \textcolor{keywordflow}{else}
204       specvol(j) = (ks - p1) / (rho0*ks)
205 \textcolor{keywordflow}{    endif}
206 \textcolor{keywordflow}{  enddo}
\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__eos__unesco_a79b131a4287b138ebf37883d60b334be}\label{namespacemom__eos__unesco_a79b131a4287b138ebf37883d60b334be}} 
\index{mom\+\_\+eos\+\_\+unesco@{mom\+\_\+eos\+\_\+unesco}!calculate\+\_\+spec\+\_\+vol\+\_\+scalar\+\_\+unesco@{calculate\+\_\+spec\+\_\+vol\+\_\+scalar\+\_\+unesco}}
\index{calculate\+\_\+spec\+\_\+vol\+\_\+scalar\+\_\+unesco@{calculate\+\_\+spec\+\_\+vol\+\_\+scalar\+\_\+unesco}!mom\+\_\+eos\+\_\+unesco@{mom\+\_\+eos\+\_\+unesco}}
\subsubsection{\texorpdfstring{calculate\+\_\+spec\+\_\+vol\+\_\+scalar\+\_\+unesco()}{calculate\_spec\_vol\_scalar\_unesco()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+\_\+unesco\+::calculate\+\_\+spec\+\_\+vol\+\_\+scalar\+\_\+unesco (\begin{DoxyParamCaption}\item[{real, intent(in)}]{T,  }\item[{real, intent(in)}]{S,  }\item[{real, intent(in)}]{pressure,  }\item[{real, intent(out)}]{specvol,  }\item[{real, intent(in), optional}]{spv\+\_\+ref }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine computes the in situ specific volume of sea water (specvol in \mbox{[}m3 kg-\/1\mbox{]}) from salinity (S \mbox{[}P\+SU\mbox{]}), potential temperature (T \mbox{[}degC\mbox{]}) and pressure \mbox{[}Pa\mbox{]}, using the U\+N\+E\+S\+CO (1981) equation of state. If spv\+\_\+ref is present, specvol is an anomaly from spv\+\_\+ref. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em t} & potential temperature relative to the surface \mbox{[}degC\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em s} & salinity \mbox{[}P\+SU\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em pressure} & pressure \mbox{[}Pa\mbox{]}.\\
\hline
\mbox{\tt out}  & {\em specvol} & in situ specific volume \mbox{[}m3 kg-\/1\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em spv\+\_\+ref} & A reference specific volume \mbox{[}m3 kg-\/1\mbox{]}. \\
\hline
\end{DoxyParams}


Definition at line 138 of file M\+O\+M\+\_\+\+E\+O\+S\+\_\+\+U\+N\+E\+S\+C\+O.\+F90.


\begin{DoxyCode}
138   \textcolor{keywordtype}{real},           \textcolor{keywordtype}{intent(in)}  :: t\textcolor{comment}{        !< potential temperature relative to the surface}
139 \textcolor{comment}{                                          !! [degC].}
140   \textcolor{keywordtype}{real},           \textcolor{keywordtype}{intent(in)}  :: s\textcolor{comment}{        !< salinity [PSU].}
141   \textcolor{keywordtype}{real},           \textcolor{keywordtype}{intent(in)}  :: pressure\textcolor{comment}{ !< pressure [Pa].}
142   \textcolor{keywordtype}{real},           \textcolor{keywordtype}{intent(out)} :: specvol\textcolor{comment}{  !< in situ specific volume [m3 kg-1].}
143   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: spv\_ref\textcolor{comment}{  !< A reference specific volume [m3 kg-1].}
144 
145   \textcolor{comment}{! Local variables}
146   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(1)} :: t0, s0, pressure0, spv0
147 
148   t0(1) = t ; s0(1) = s ; pressure0(1) = pressure
149 
150   \textcolor{keyword}{call }calculate\_spec\_vol\_array\_unesco(t0, s0, pressure0, spv0, 1, 1, spv\_ref)
151   specvol = spv0(1)
\end{DoxyCode}
