\hypertarget{namespacemom__eos__teos10}{}\doxysection{mom\+\_\+eos\+\_\+teos10 Module Reference}
\label{namespacemom__eos__teos10}\index{mom\_eos\_teos10@{mom\_eos\_teos10}}


\doxysubsection{Detailed Description}
The equation of state using the T\+E\+O\+S10 expressions. \doxysubsection*{Data Types}
\begin{DoxyCompactItemize}
\item 
interface \mbox{\hyperlink{interfacemom__eos__teos10_1_1calculate__density__derivs__teos10}{calculate\+\_\+density\+\_\+derivs\+\_\+teos10}}
\begin{DoxyCompactList}\small\item\em For a given thermodynamic state, return the derivatives of density with conservative temperature and absolute salinity, using the T\+E\+O\+S10 expressions. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__eos__teos10_1_1calculate__density__second__derivs__teos10}{calculate\+\_\+density\+\_\+second\+\_\+derivs\+\_\+teos10}}
\begin{DoxyCompactList}\small\item\em For a given thermodynamic state, return the second derivatives of density with various combinations of conservative temperature, absolute salinity, and pressure, using the T\+E\+O\+S10 expressions. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__eos__teos10_1_1calculate__density__teos10}{calculate\+\_\+density\+\_\+teos10}}
\begin{DoxyCompactList}\small\item\em Compute the in situ density of sea water (\mbox{[}kg m-\/3\mbox{]}), or its anomaly with respect to a reference density, from absolute salinity (g/kg), conservative temperature (in deg C), and pressure \mbox{[}Pa\mbox{]}, using the T\+E\+O\+S10 expressions. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__eos__teos10_1_1calculate__spec__vol__teos10}{calculate\+\_\+spec\+\_\+vol\+\_\+teos10}}
\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 absolute salinity (in g/kg), conservative temperature (in deg C), and pressure \mbox{[}Pa\mbox{]}, using the T\+E\+O\+S10 expressions. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \mbox{\hyperlink{namespacemom__eos__teos10_afcb9d9cc0897ff8a81735827fc5fd35d}{calculate\+\_\+density\+\_\+scalar\+\_\+teos10}} (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 absolute salinity (S \mbox{[}g kg-\/1\mbox{]}), conservative temperature (T \mbox{[}degC\mbox{]}), and pressure \mbox{[}Pa\mbox{]}. It uses the expression from the T\+E\+O\+S10 website. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__eos__teos10_a76f1946b8688d7da3f7f39a48de5f53a}{calculate\+\_\+density\+\_\+array\+\_\+teos10}} (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 absolute salinity (S \mbox{[}g kg-\/1\mbox{]}), conservative temperature (T \mbox{[}degC\mbox{]}), and pressure \mbox{[}Pa\mbox{]}. It uses the expression from the T\+E\+O\+S10 website. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__eos__teos10_aa3a64aeb82f2380a61a6976f01d5df65}{calculate\+\_\+spec\+\_\+vol\+\_\+scalar\+\_\+teos10}} (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 absolute salinity (S \mbox{[}g kg-\/1\mbox{]}), conservative temperature (T \mbox{[}degC\mbox{]}) and pressure \mbox{[}Pa\mbox{]}, using the T\+E\+O\+S10 equation of state. If spv\+\_\+ref is present, specvol is an anomaly from spv\+\_\+ref. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__eos__teos10_a075ce98f43e4ad62336849874ddec3e9}{calculate\+\_\+spec\+\_\+vol\+\_\+array\+\_\+teos10}} (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 absolute salinity (S \mbox{[}g kg-\/1\mbox{]}), conservative temperature (T \mbox{[}degC\mbox{]}) and pressure \mbox{[}Pa\mbox{]}, using the T\+E\+O\+S10 equation of state. If spv\+\_\+ref is present, specvol is an anomaly from spv\+\_\+ref. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__eos__teos10_a140240742a89048454e117675bf9e272}{calculate\+\_\+density\+\_\+derivs\+\_\+array\+\_\+teos10}} (T, S, pressure, drho\+\_\+dT, drho\+\_\+dS, start, npts)
\begin{DoxyCompactList}\small\item\em For a given thermodynamic state, calculate the derivatives of density with conservative temperature and absolute salinity, using the T\+E\+O\+S10 expressions. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__eos__teos10_a07e7a5b0b9ed5bd5a528a9b68523c557}{calculate\+\_\+density\+\_\+derivs\+\_\+scalar\+\_\+teos10}} (T, S, pressure, drho\+\_\+dT, drho\+\_\+dS)
\begin{DoxyCompactList}\small\item\em For a given thermodynamic state, calculate the derivatives of density with conservative temperature and absolute salinity, using the T\+E\+O\+S10 expressions. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__eos__teos10_aede3b2ab040292e26a399f5ca90d0d74}{calculate\+\_\+specvol\+\_\+derivs\+\_\+teos10}} (T, S, pressure, d\+S\+V\+\_\+dT, d\+S\+V\+\_\+dS, start, npts)
\begin{DoxyCompactList}\small\item\em For a given thermodynamic state, calculate the derivatives of specific volume with conservative temperature and absolute salinity, using the T\+E\+O\+S10 expressions. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__eos__teos10_a7dba5c1fb0fb438b0be866b7fe74e917}{calculate\+\_\+density\+\_\+second\+\_\+derivs\+\_\+scalar\+\_\+teos10}} (T, S, pressure, drho\+\_\+d\+S\+\_\+dS, drho\+\_\+d\+S\+\_\+dT, drho\+\_\+d\+T\+\_\+dT, drho\+\_\+d\+S\+\_\+dP, drho\+\_\+d\+T\+\_\+dP)
\begin{DoxyCompactList}\small\item\em Calculate the 5 second derivatives of the equation of state for scalar inputs. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__eos__teos10_a1d87e332be29e732278487c40200c182}{calculate\+\_\+density\+\_\+second\+\_\+derivs\+\_\+array\+\_\+teos10}} (T, S, pressure, drho\+\_\+d\+S\+\_\+dS, drho\+\_\+d\+S\+\_\+dT, drho\+\_\+d\+T\+\_\+dT, drho\+\_\+d\+S\+\_\+dP, drho\+\_\+d\+T\+\_\+dP, start, npts)
\begin{DoxyCompactList}\small\item\em Calculate the 5 second derivatives of the equation of state for scalar inputs. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__eos__teos10_a4f1ed903f96b5b55f7f09289b4e7f491}{calculate\+\_\+compress\+\_\+teos10}} (T, S, pressure, rho, drho\+\_\+dp, start, npts)
\begin{DoxyCompactList}\small\item\em This subroutine computes the in situ density of sea water (rho in \mbox{[}kg m-\/3\mbox{]}) and the compressibility (drho/dp = C\+\_\+sound$^\wedge$-\/2) (drho\+\_\+dp \mbox{[}s2 m-\/2\mbox{]}) from absolute salinity (sal in g/kg), conservative temperature (T \mbox{[}degC\mbox{]}), and pressure \mbox{[}Pa\mbox{]}. It uses the subroutines from T\+E\+O\+S10 website. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{namespacemom__eos__teos10_a57fb9d007224d73141d939df491ca96e}\label{namespacemom__eos__teos10_a57fb9d007224d73141d939df491ca96e}} 
real, parameter \mbox{\hyperlink{namespacemom__eos__teos10_a57fb9d007224d73141d939df491ca96e}{pa2db}} = 1.e-\/4
\begin{DoxyCompactList}\small\item\em The conversion factor from Pa to dbar. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacemom__eos__teos10_a4f1ed903f96b5b55f7f09289b4e7f491}\label{namespacemom__eos__teos10_a4f1ed903f96b5b55f7f09289b4e7f491}} 
\index{mom\_eos\_teos10@{mom\_eos\_teos10}!calculate\_compress\_teos10@{calculate\_compress\_teos10}}
\index{calculate\_compress\_teos10@{calculate\_compress\_teos10}!mom\_eos\_teos10@{mom\_eos\_teos10}}
\doxysubsubsection{\texorpdfstring{calculate\_compress\_teos10()}{calculate\_compress\_teos10()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+eos\+\_\+teos10\+::calculate\+\_\+compress\+\_\+teos10 (\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 in \mbox{[}kg m-\/3\mbox{]}) and the compressibility (drho/dp = C\+\_\+sound$^\wedge$-\/2) (drho\+\_\+dp \mbox{[}s2 m-\/2\mbox{]}) from absolute salinity (sal in g/kg), conservative temperature (T \mbox{[}degC\mbox{]}), and pressure \mbox{[}Pa\mbox{]}. It uses the subroutines from T\+E\+O\+S10 website. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em t} & Conservative temperature \mbox{[}degC\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em s} & Absolute salinity \mbox{[}g kg-\/1\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em pressure} & Pressure \mbox{[}Pa\mbox{]}. \\
\hline
\mbox{\texttt{ out}}  & {\em rho} & In situ density \mbox{[}kg m-\/3\mbox{]}. \\
\hline
\mbox{\texttt{ 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{\texttt{ in}}  & {\em start} & The starting point in the arrays. \\
\hline
\mbox{\texttt{ in}}  & {\em npts} & The number of values to calculate. \\
\hline
\end{DoxyParams}


Definition at line 313 of file M\+O\+M\+\_\+\+E\+O\+S\+\_\+\+T\+E\+O\+S10.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{314 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(in)},  \textcolor{keywordtype}{dimension(:)} :: T\textcolor{comment}{        !< Conservative temperature [degC].}}
\DoxyCodeLine{315 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(in)},  \textcolor{keywordtype}{dimension(:)} :: S\textcolor{comment}{        !< Absolute salinity [g kg-\/1].}}
\DoxyCodeLine{316 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(in)},  \textcolor{keywordtype}{dimension(:)} :: pressure\textcolor{comment}{ !< Pressure [Pa].}}
\DoxyCodeLine{317 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{dimension(:)} :: rho\textcolor{comment}{      !< In situ density [kg m-\/3].}}
\DoxyCodeLine{318 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{dimension(:)} :: drho\_dp\textcolor{comment}{  !< The partial derivative of density with pressure}}
\DoxyCodeLine{319 \textcolor{comment}{                                                 !! (also the inverse of the square of sound speed)}}
\DoxyCodeLine{320 \textcolor{comment}{                                                 !! [s2 m-\/2].}}
\DoxyCodeLine{321   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}                :: start\textcolor{comment}{    !< The starting point in the arrays.}}
\DoxyCodeLine{322   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}                :: npts\textcolor{comment}{     !< The number of values to calculate.}}
\DoxyCodeLine{323 }
\DoxyCodeLine{324   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{325 \textcolor{keywordtype}{  real} :: zs,zt,zp}
\DoxyCodeLine{326   \textcolor{keywordtype}{integer} :: j}
\DoxyCodeLine{327 }
\DoxyCodeLine{328   \textcolor{keywordflow}{do} j=start,start+npts-\/1}
\DoxyCodeLine{329     \textcolor{comment}{!Conversions}}
\DoxyCodeLine{330     zs = s(j) \textcolor{comment}{!gsw\_sr\_from\_sp(S(j))       !Convert practical salinity to absolute salinity}}
\DoxyCodeLine{331     zt = t(j) \textcolor{comment}{!gsw\_ct\_from\_pt(S(j),T(j))  !Convert potantial temp to conservative temp}}
\DoxyCodeLine{332     zp = pressure(j)* pa2db         \textcolor{comment}{!Convert pressure from Pascal to decibar}}
\DoxyCodeLine{333     \textcolor{keywordflow}{if} (s(j) < -\/1.0e-\/10) \textcolor{keywordflow}{then} ; \textcolor{comment}{!Can we assume safely that this is a missing value?}}
\DoxyCodeLine{334       rho(j) = 1000.0 ; drho\_dp(j) = 0.0}
\DoxyCodeLine{335     \textcolor{keywordflow}{else}}
\DoxyCodeLine{336       rho(j) = gsw\_rho(zs,zt,zp)}
\DoxyCodeLine{337       \textcolor{keyword}{call }gsw\_rho\_first\_derivatives(zs,zt,zp, drho\_dp=drho\_dp(j))}
\DoxyCodeLine{338 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{339 \textcolor{keywordflow}{  enddo}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__eos__teos10_a76f1946b8688d7da3f7f39a48de5f53a}\label{namespacemom__eos__teos10_a76f1946b8688d7da3f7f39a48de5f53a}} 
\index{mom\_eos\_teos10@{mom\_eos\_teos10}!calculate\_density\_array\_teos10@{calculate\_density\_array\_teos10}}
\index{calculate\_density\_array\_teos10@{calculate\_density\_array\_teos10}!mom\_eos\_teos10@{mom\_eos\_teos10}}
\doxysubsubsection{\texorpdfstring{calculate\_density\_array\_teos10()}{calculate\_density\_array\_teos10()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+\_\+teos10\+::calculate\+\_\+density\+\_\+array\+\_\+teos10 (\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})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine computes the in situ density of sea water (rho in \mbox{[}kg m-\/3\mbox{]}) from absolute salinity (S \mbox{[}g kg-\/1\mbox{]}), conservative temperature (T \mbox{[}degC\mbox{]}), and pressure \mbox{[}Pa\mbox{]}. It uses the expression from the T\+E\+O\+S10 website. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em t} & Conservative temperature \mbox{[}degC\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em s} & Absolute salinity \mbox{[}g kg-\/1\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em pressure} & pressure \mbox{[}Pa\mbox{]}. \\
\hline
\mbox{\texttt{ out}}  & {\em rho} & in situ density \mbox{[}kg m-\/3\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em start} & the starting point in the arrays. \\
\hline
\mbox{\texttt{ in}}  & {\em npts} & the number of values to calculate. \\
\hline
\mbox{\texttt{ 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\+\_\+\+T\+E\+O\+S10.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{84 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: T\textcolor{comment}{        !< Conservative temperature [degC].}}
\DoxyCodeLine{85 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: S\textcolor{comment}{        !< Absolute salinity [g kg-\/1]}}
\DoxyCodeLine{86 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: pressure\textcolor{comment}{ !< pressure [Pa].}}
\DoxyCodeLine{87 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(out)} :: rho\textcolor{comment}{      !< in situ density [kg m-\/3].}}
\DoxyCodeLine{88   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}  :: start\textcolor{comment}{    !< the starting point in the arrays.}}
\DoxyCodeLine{89   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}  :: npts\textcolor{comment}{     !< the number of values to calculate.}}
\DoxyCodeLine{90 \textcolor{keywordtype}{  real},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: rho\_ref\textcolor{comment}{  !< A reference density [kg m-\/3].}}
\DoxyCodeLine{91 }
\DoxyCodeLine{92   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{93 \textcolor{keywordtype}{  real} :: zs, zt, zp}
\DoxyCodeLine{94   \textcolor{keywordtype}{integer} :: j}
\DoxyCodeLine{95 }
\DoxyCodeLine{96   \textcolor{keywordflow}{do} j=start,start+npts-\/1}
\DoxyCodeLine{97     \textcolor{comment}{!Conversions}}
\DoxyCodeLine{98     zs = s(j) \textcolor{comment}{!gsw\_sr\_from\_sp(S(j))       !Convert practical salinity to absolute salinity}}
\DoxyCodeLine{99     zt = t(j) \textcolor{comment}{!gsw\_ct\_from\_pt(S(j),T(j))  !Convert potantial temp to conservative temp}}
\DoxyCodeLine{100     zp = pressure(j)* pa2db         \textcolor{comment}{!Convert pressure from Pascal to decibar}}
\DoxyCodeLine{101 }
\DoxyCodeLine{102     \textcolor{keywordflow}{if} (s(j) < -\/1.0e-\/10) \textcolor{keywordflow}{then} \textcolor{comment}{!Can we assume safely that this is a missing value?}}
\DoxyCodeLine{103       rho(j) = 1000.0}
\DoxyCodeLine{104     \textcolor{keywordflow}{else}}
\DoxyCodeLine{105       rho(j) = gsw\_rho(zs,zt,zp)}
\DoxyCodeLine{106 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{107     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(rho\_ref)) rho(j) = rho(j) -\/ rho\_ref}
\DoxyCodeLine{108 \textcolor{keywordflow}{  enddo}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__eos__teos10_a140240742a89048454e117675bf9e272}\label{namespacemom__eos__teos10_a140240742a89048454e117675bf9e272}} 
\index{mom\_eos\_teos10@{mom\_eos\_teos10}!calculate\_density\_derivs\_array\_teos10@{calculate\_density\_derivs\_array\_teos10}}
\index{calculate\_density\_derivs\_array\_teos10@{calculate\_density\_derivs\_array\_teos10}!mom\_eos\_teos10@{mom\_eos\_teos10}}
\doxysubsubsection{\texorpdfstring{calculate\_density\_derivs\_array\_teos10()}{calculate\_density\_derivs\_array\_teos10()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+\_\+teos10\+::calculate\+\_\+density\+\_\+derivs\+\_\+array\+\_\+teos10 (\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})\hspace{0.3cm}{\ttfamily [private]}}



For a given thermodynamic state, calculate the derivatives of density with conservative temperature and absolute salinity, using the T\+E\+O\+S10 expressions. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em t} & Conservative temperature \mbox{[}degC\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em s} & Absolute salinity \mbox{[}g kg-\/1\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em pressure} & pressure \mbox{[}Pa\mbox{]}. \\
\hline
\mbox{\texttt{ out}}  & {\em drho\+\_\+dt} & The partial derivative of density with conservative temperature \mbox{[}kg m-\/3 deg\+C-\/1\mbox{]}. \\
\hline
\mbox{\texttt{ out}}  & {\em drho\+\_\+ds} & The partial derivative of density with absolute salinity, \mbox{[}kg m-\/3 (g/kg)-\/1\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em start} & The starting point in the arrays. \\
\hline
\mbox{\texttt{ in}}  & {\em npts} & The number of values to calculate. \\
\hline
\end{DoxyParams}


Definition at line 168 of file M\+O\+M\+\_\+\+E\+O\+S\+\_\+\+T\+E\+O\+S10.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{169 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(in)},  \textcolor{keywordtype}{dimension(:)} :: T\textcolor{comment}{        !< Conservative temperature [degC].}}
\DoxyCodeLine{170 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(in)},  \textcolor{keywordtype}{dimension(:)} :: S\textcolor{comment}{        !< Absolute salinity [g kg-\/1].}}
\DoxyCodeLine{171 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(in)},  \textcolor{keywordtype}{dimension(:)} :: pressure\textcolor{comment}{ !< pressure [Pa].}}
\DoxyCodeLine{172 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{dimension(:)} :: drho\_dT\textcolor{comment}{  !< The partial derivative of density with conservative}}
\DoxyCodeLine{173 \textcolor{comment}{                                                 !! temperature [kg m-\/3 degC-\/1].}}
\DoxyCodeLine{174 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{dimension(:)} :: drho\_dS\textcolor{comment}{  !< The partial derivative of density with absolute salinity,}}
\DoxyCodeLine{175 \textcolor{comment}{                                                 !! [kg m-\/3 (g/kg)-\/1].}}
\DoxyCodeLine{176   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}                :: start\textcolor{comment}{    !< The starting point in the arrays.}}
\DoxyCodeLine{177   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}                :: npts\textcolor{comment}{     !< The number of values to calculate.}}
\DoxyCodeLine{178 }
\DoxyCodeLine{179   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{180 \textcolor{keywordtype}{  real} :: zs, zt, zp}
\DoxyCodeLine{181   \textcolor{keywordtype}{integer} :: j}
\DoxyCodeLine{182 }
\DoxyCodeLine{183   \textcolor{keywordflow}{do} j=start,start+npts-\/1}
\DoxyCodeLine{184     \textcolor{comment}{!Conversions}}
\DoxyCodeLine{185     zs = s(j) \textcolor{comment}{!gsw\_sr\_from\_sp(S(j))       !Convert practical salinity to absolute salinity}}
\DoxyCodeLine{186     zt = t(j) \textcolor{comment}{!gsw\_ct\_from\_pt(S(j),T(j))  !Convert potantial temp to conservative temp}}
\DoxyCodeLine{187     zp = pressure(j)* pa2db         \textcolor{comment}{!Convert pressure from Pascal to decibar}}
\DoxyCodeLine{188     \textcolor{keywordflow}{if} (s(j) < -\/1.0e-\/10) \textcolor{keywordflow}{then} ; \textcolor{comment}{!Can we assume safely that this is a missing value?}}
\DoxyCodeLine{189       drho\_dt(j) = 0.0 ; drho\_ds(j) = 0.0}
\DoxyCodeLine{190     \textcolor{keywordflow}{else}}
\DoxyCodeLine{191       \textcolor{keyword}{call }gsw\_rho\_first\_derivatives(zs, zt, zp, drho\_dsa=drho\_ds(j), drho\_dct=drho\_dt(j))}
\DoxyCodeLine{192 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{193 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{194 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__eos__teos10_a07e7a5b0b9ed5bd5a528a9b68523c557}\label{namespacemom__eos__teos10_a07e7a5b0b9ed5bd5a528a9b68523c557}} 
\index{mom\_eos\_teos10@{mom\_eos\_teos10}!calculate\_density\_derivs\_scalar\_teos10@{calculate\_density\_derivs\_scalar\_teos10}}
\index{calculate\_density\_derivs\_scalar\_teos10@{calculate\_density\_derivs\_scalar\_teos10}!mom\_eos\_teos10@{mom\_eos\_teos10}}
\doxysubsubsection{\texorpdfstring{calculate\_density\_derivs\_scalar\_teos10()}{calculate\_density\_derivs\_scalar\_teos10()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+\_\+teos10\+::calculate\+\_\+density\+\_\+derivs\+\_\+scalar\+\_\+teos10 (\begin{DoxyParamCaption}\item[{real, intent(in)}]{T,  }\item[{real, intent(in)}]{S,  }\item[{real, intent(in)}]{pressure,  }\item[{real, intent(out)}]{drho\+\_\+dT,  }\item[{real, intent(out)}]{drho\+\_\+dS }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



For a given thermodynamic state, calculate the derivatives of density with conservative temperature and absolute salinity, using the T\+E\+O\+S10 expressions. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em t} & Conservative temperature \mbox{[}degC\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em s} & Absolute Salinity \mbox{[}g kg-\/1\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em pressure} & pressure \mbox{[}Pa\mbox{]}. \\
\hline
\mbox{\texttt{ out}}  & {\em drho\+\_\+dt} & The partial derivative of density with conservative temperature \mbox{[}kg m-\/3 deg\+C-\/1\mbox{]}. \\
\hline
\mbox{\texttt{ out}}  & {\em drho\+\_\+ds} & The partial derivative of density with absolute salinity, \mbox{[}kg m-\/3 (g/kg)-\/1\mbox{]}. \\
\hline
\end{DoxyParams}


Definition at line 199 of file M\+O\+M\+\_\+\+E\+O\+S\+\_\+\+T\+E\+O\+S10.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{200 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(in)}  :: T\textcolor{comment}{        !< Conservative temperature [degC]}}
\DoxyCodeLine{201 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(in)}  :: S\textcolor{comment}{        !< Absolute Salinity [g kg-\/1]}}
\DoxyCodeLine{202 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(in)}  :: pressure\textcolor{comment}{ !< pressure [Pa].}}
\DoxyCodeLine{203 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(out)} :: drho\_dT\textcolor{comment}{  !< The partial derivative of density with conservative}}
\DoxyCodeLine{204 \textcolor{comment}{                                   !! temperature [kg m-\/3 degC-\/1].}}
\DoxyCodeLine{205 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(out)} :: drho\_dS\textcolor{comment}{  !< The partial derivative of density with absolute salinity,}}
\DoxyCodeLine{206 \textcolor{comment}{                                   !! [kg m-\/3 (g/kg)-\/1].}}
\DoxyCodeLine{207 }
\DoxyCodeLine{208   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{209 \textcolor{keywordtype}{  real} :: zs, zt, zp}
\DoxyCodeLine{210   \textcolor{comment}{!Conversions}}
\DoxyCodeLine{211   zs = s \textcolor{comment}{!gsw\_sr\_from\_sp(S)       !Convert practical salinity to absolute salinity}}
\DoxyCodeLine{212   zt = t \textcolor{comment}{!gsw\_ct\_from\_pt(S,T)  !Convert potantial temp to conservative temp}}
\DoxyCodeLine{213   zp = pressure* pa2db         \textcolor{comment}{!Convert pressure from Pascal to decibar}}
\DoxyCodeLine{214   \textcolor{keywordflow}{if} (s < -\/1.0e-\/10) \textcolor{keywordflow}{return} \textcolor{comment}{!Can we assume safely that this is a missing value?}}
\DoxyCodeLine{215   \textcolor{keyword}{call }gsw\_rho\_first\_derivatives(zs, zt, zp, drho\_dsa=drho\_ds, drho\_dct=drho\_dt)}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__eos__teos10_afcb9d9cc0897ff8a81735827fc5fd35d}\label{namespacemom__eos__teos10_afcb9d9cc0897ff8a81735827fc5fd35d}} 
\index{mom\_eos\_teos10@{mom\_eos\_teos10}!calculate\_density\_scalar\_teos10@{calculate\_density\_scalar\_teos10}}
\index{calculate\_density\_scalar\_teos10@{calculate\_density\_scalar\_teos10}!mom\_eos\_teos10@{mom\_eos\_teos10}}
\doxysubsubsection{\texorpdfstring{calculate\_density\_scalar\_teos10()}{calculate\_density\_scalar\_teos10()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+\_\+teos10\+::calculate\+\_\+density\+\_\+scalar\+\_\+teos10 (\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})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine computes the in situ density of sea water (rho in \mbox{[}kg m-\/3\mbox{]}) from absolute salinity (S \mbox{[}g kg-\/1\mbox{]}), conservative temperature (T \mbox{[}degC\mbox{]}), and pressure \mbox{[}Pa\mbox{]}. It uses the expression from the T\+E\+O\+S10 website. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em t} & Conservative temperature \mbox{[}degC\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em s} & Absolute salinity \mbox{[}g kg-\/1\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em pressure} & pressure \mbox{[}Pa\mbox{]}. \\
\hline
\mbox{\texttt{ out}}  & {\em rho} & In situ density \mbox{[}kg m-\/3\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em rho\+\_\+ref} & A reference density \mbox{[}kg m-\/3\mbox{]}. \\
\hline
\end{DoxyParams}


Definition at line 59 of file M\+O\+M\+\_\+\+E\+O\+S\+\_\+\+T\+E\+O\+S10.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{60 \textcolor{keywordtype}{  real},           \textcolor{keywordtype}{intent(in)}  :: T\textcolor{comment}{        !< Conservative temperature [degC].}}
\DoxyCodeLine{61 \textcolor{keywordtype}{  real},           \textcolor{keywordtype}{intent(in)}  :: S\textcolor{comment}{        !< Absolute salinity [g kg-\/1].}}
\DoxyCodeLine{62 \textcolor{keywordtype}{  real},           \textcolor{keywordtype}{intent(in)}  :: pressure\textcolor{comment}{ !< pressure [Pa].}}
\DoxyCodeLine{63 \textcolor{keywordtype}{  real},           \textcolor{keywordtype}{intent(out)} :: rho\textcolor{comment}{      !< In situ density [kg m-\/3].}}
\DoxyCodeLine{64 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: rho\_ref\textcolor{comment}{  !< A reference density [kg m-\/3].}}
\DoxyCodeLine{65 }
\DoxyCodeLine{66   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{67 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(1)} :: T0, S0, pressure0}
\DoxyCodeLine{68 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(1)} :: rho0}
\DoxyCodeLine{69 }
\DoxyCodeLine{70   t0(1) = t}
\DoxyCodeLine{71   s0(1) = s}
\DoxyCodeLine{72   pressure0(1) = pressure}
\DoxyCodeLine{73 }
\DoxyCodeLine{74   \textcolor{keyword}{call }calculate\_density\_array\_teos10(t0, s0, pressure0, rho0, 1, 1, rho\_ref)}
\DoxyCodeLine{75   rho = rho0(1)}
\DoxyCodeLine{76 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__eos__teos10_a1d87e332be29e732278487c40200c182}\label{namespacemom__eos__teos10_a1d87e332be29e732278487c40200c182}} 
\index{mom\_eos\_teos10@{mom\_eos\_teos10}!calculate\_density\_second\_derivs\_array\_teos10@{calculate\_density\_second\_derivs\_array\_teos10}}
\index{calculate\_density\_second\_derivs\_array\_teos10@{calculate\_density\_second\_derivs\_array\_teos10}!mom\_eos\_teos10@{mom\_eos\_teos10}}
\doxysubsubsection{\texorpdfstring{calculate\_density\_second\_derivs\_array\_teos10()}{calculate\_density\_second\_derivs\_array\_teos10()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+\_\+teos10\+::calculate\+\_\+density\+\_\+second\+\_\+derivs\+\_\+array\+\_\+teos10 (\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\+\_\+d\+S\+\_\+dS,  }\item[{real, dimension(\+:), intent(out)}]{drho\+\_\+d\+S\+\_\+dT,  }\item[{real, dimension(\+:), intent(out)}]{drho\+\_\+d\+T\+\_\+dT,  }\item[{real, dimension(\+:), intent(out)}]{drho\+\_\+d\+S\+\_\+dP,  }\item[{real, dimension(\+:), intent(out)}]{drho\+\_\+d\+T\+\_\+dP,  }\item[{integer, intent(in)}]{start,  }\item[{integer, intent(in)}]{npts }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Calculate the 5 second derivatives of the equation of state for scalar inputs. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em t} & Conservative temperature \mbox{[}degC\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em s} & Absolute Salinity \mbox{[}g kg-\/1\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em pressure} & pressure \mbox{[}Pa\mbox{]}. \\
\hline
\mbox{\texttt{ out}}  & {\em drho\+\_\+ds\+\_\+ds} & Partial derivative of beta with respect to S \\
\hline
\mbox{\texttt{ out}}  & {\em drho\+\_\+ds\+\_\+dt} & Partial derivative of beta with resepct to T \\
\hline
\mbox{\texttt{ out}}  & {\em drho\+\_\+dt\+\_\+dt} & Partial derivative of alpha with respect to T \\
\hline
\mbox{\texttt{ out}}  & {\em drho\+\_\+ds\+\_\+dp} & Partial derivative of beta with respect to pressure \\
\hline
\mbox{\texttt{ out}}  & {\em drho\+\_\+dt\+\_\+dp} & Partial derivative of alpha with respect to pressure \\
\hline
\mbox{\texttt{ in}}  & {\em start} & The starting point in the arrays. \\
\hline
\mbox{\texttt{ in}}  & {\em npts} & The number of values to calculate. \\
\hline
\end{DoxyParams}


Definition at line 275 of file M\+O\+M\+\_\+\+E\+O\+S\+\_\+\+T\+E\+O\+S10.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{277 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}     :: T\textcolor{comment}{          !< Conservative temperature [degC]}}
\DoxyCodeLine{278 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}     :: S\textcolor{comment}{          !< Absolute Salinity [g kg-\/1]}}
\DoxyCodeLine{279 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}     :: pressure\textcolor{comment}{   !< pressure [Pa].}}
\DoxyCodeLine{280 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(out)}    :: drho\_dS\_dS\textcolor{comment}{ !< Partial derivative of beta with respect to S}}
\DoxyCodeLine{281 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(out)}    :: drho\_dS\_dT\textcolor{comment}{ !< Partial derivative of beta with resepct to T}}
\DoxyCodeLine{282 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(out)}    :: drho\_dT\_dT\textcolor{comment}{ !< Partial derivative of alpha with respect to T}}
\DoxyCodeLine{283 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(out)}    :: drho\_dS\_dP\textcolor{comment}{ !< Partial derivative of beta with respect to pressure}}
\DoxyCodeLine{284 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(out)}    :: drho\_dT\_dP\textcolor{comment}{ !< Partial derivative of alpha with respect to pressure}}
\DoxyCodeLine{285   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}  :: start\textcolor{comment}{    !< The starting point in the arrays.}}
\DoxyCodeLine{286   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}  :: npts\textcolor{comment}{     !< The number of values to calculate.}}
\DoxyCodeLine{287 }
\DoxyCodeLine{288   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{289 \textcolor{keywordtype}{  real} :: zs, zt, zp}
\DoxyCodeLine{290   \textcolor{keywordtype}{integer} :: j}
\DoxyCodeLine{291 }
\DoxyCodeLine{292   \textcolor{keywordflow}{do} j=start,start+npts-\/1}
\DoxyCodeLine{293     \textcolor{comment}{!Conversions}}
\DoxyCodeLine{294     zs = s(j) \textcolor{comment}{!gsw\_sr\_from\_sp(S)       !Convert practical salinity to absolute salinity}}
\DoxyCodeLine{295     zt = t(j) \textcolor{comment}{!gsw\_ct\_from\_pt(S,T)  !Convert potantial temp to conservative temp}}
\DoxyCodeLine{296     zp = pressure(j)* pa2db         \textcolor{comment}{!Convert pressure from Pascal to decibar}}
\DoxyCodeLine{297     \textcolor{keywordflow}{if} (s(j) < -\/1.0e-\/10) \textcolor{keywordflow}{then} ; \textcolor{comment}{!Can we assume safely that this is a missing value?}}
\DoxyCodeLine{298       drho\_ds\_ds(j) = 0.0 ; drho\_ds\_dt(j) = 0.0 ; drho\_dt\_dt(j) = 0.0}
\DoxyCodeLine{299       drho\_ds\_dp(j) = 0.0 ; drho\_dt\_dp(j) = 0.0}
\DoxyCodeLine{300     \textcolor{keywordflow}{else}}
\DoxyCodeLine{301       \textcolor{keyword}{call }gsw\_rho\_second\_derivatives(zs, zt, zp, rho\_sa\_sa=drho\_ds\_ds(j), rho\_sa\_ct=drho\_ds\_dt(j), \&}
\DoxyCodeLine{302                                       rho\_ct\_ct=drho\_dt\_dt(j), rho\_sa\_p=drho\_ds\_dp(j), rho\_ct\_p=drho\_dt\_dp(j))}
\DoxyCodeLine{303 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{304 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{305 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__eos__teos10_a7dba5c1fb0fb438b0be866b7fe74e917}\label{namespacemom__eos__teos10_a7dba5c1fb0fb438b0be866b7fe74e917}} 
\index{mom\_eos\_teos10@{mom\_eos\_teos10}!calculate\_density\_second\_derivs\_scalar\_teos10@{calculate\_density\_second\_derivs\_scalar\_teos10}}
\index{calculate\_density\_second\_derivs\_scalar\_teos10@{calculate\_density\_second\_derivs\_scalar\_teos10}!mom\_eos\_teos10@{mom\_eos\_teos10}}
\doxysubsubsection{\texorpdfstring{calculate\_density\_second\_derivs\_scalar\_teos10()}{calculate\_density\_second\_derivs\_scalar\_teos10()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+\_\+teos10\+::calculate\+\_\+density\+\_\+second\+\_\+derivs\+\_\+scalar\+\_\+teos10 (\begin{DoxyParamCaption}\item[{real, intent(in)}]{T,  }\item[{real, intent(in)}]{S,  }\item[{real, intent(in)}]{pressure,  }\item[{real, intent(out)}]{drho\+\_\+d\+S\+\_\+dS,  }\item[{real, intent(out)}]{drho\+\_\+d\+S\+\_\+dT,  }\item[{real, intent(out)}]{drho\+\_\+d\+T\+\_\+dT,  }\item[{real, intent(out)}]{drho\+\_\+d\+S\+\_\+dP,  }\item[{real, intent(out)}]{drho\+\_\+d\+T\+\_\+dP }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Calculate the 5 second derivatives of the equation of state for scalar inputs. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em t} & Conservative temperature \mbox{[}degC\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em s} & Absolute Salinity \mbox{[}g kg-\/1\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em pressure} & pressure \mbox{[}Pa\mbox{]}. \\
\hline
\mbox{\texttt{ out}}  & {\em drho\+\_\+ds\+\_\+ds} & Partial derivative of beta with respect to S \\
\hline
\mbox{\texttt{ out}}  & {\em drho\+\_\+ds\+\_\+dt} & Partial derivative of beta with resepct to T \\
\hline
\mbox{\texttt{ out}}  & {\em drho\+\_\+dt\+\_\+dt} & Partial derivative of alpha with respect to T \\
\hline
\mbox{\texttt{ out}}  & {\em drho\+\_\+ds\+\_\+dp} & Partial derivative of beta with respect to pressure \\
\hline
\mbox{\texttt{ out}}  & {\em drho\+\_\+dt\+\_\+dp} & Partial derivative of alpha with respect to pressure \\
\hline
\end{DoxyParams}


Definition at line 250 of file M\+O\+M\+\_\+\+E\+O\+S\+\_\+\+T\+E\+O\+S10.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{252 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)}     :: T\textcolor{comment}{          !< Conservative temperature [degC]}}
\DoxyCodeLine{253 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)}     :: S\textcolor{comment}{          !< Absolute Salinity [g kg-\/1]}}
\DoxyCodeLine{254 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)}     :: pressure\textcolor{comment}{   !< pressure [Pa].}}
\DoxyCodeLine{255 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)}    :: drho\_dS\_dS\textcolor{comment}{ !< Partial derivative of beta with respect to S}}
\DoxyCodeLine{256 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)}    :: drho\_dS\_dT\textcolor{comment}{ !< Partial derivative of beta with resepct to T}}
\DoxyCodeLine{257 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)}    :: drho\_dT\_dT\textcolor{comment}{ !< Partial derivative of alpha with respect to T}}
\DoxyCodeLine{258 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)}    :: drho\_dS\_dP\textcolor{comment}{ !< Partial derivative of beta with respect to pressure}}
\DoxyCodeLine{259 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)}    :: drho\_dT\_dP\textcolor{comment}{ !< Partial derivative of alpha with respect to pressure}}
\DoxyCodeLine{260 }
\DoxyCodeLine{261   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{262 \textcolor{keywordtype}{  real} :: zs, zt, zp}
\DoxyCodeLine{263 }
\DoxyCodeLine{264   \textcolor{comment}{!Conversions}}
\DoxyCodeLine{265   zs = s \textcolor{comment}{!gsw\_sr\_from\_sp(S)       !Convert practical salinity to absolute salinity}}
\DoxyCodeLine{266   zt = t \textcolor{comment}{!gsw\_ct\_from\_pt(S,T)  !Convert potantial temp to conservative temp}}
\DoxyCodeLine{267   zp = pressure* pa2db         \textcolor{comment}{!Convert pressure from Pascal to decibar}}
\DoxyCodeLine{268   \textcolor{keywordflow}{if} (s < -\/1.0e-\/10) \textcolor{keywordflow}{return} \textcolor{comment}{!Can we assume safely that this is a missing value?}}
\DoxyCodeLine{269   \textcolor{keyword}{call }gsw\_rho\_second\_derivatives(zs, zt, zp, rho\_sa\_sa=drho\_ds\_ds, rho\_sa\_ct=drho\_ds\_dt, \&}
\DoxyCodeLine{270                                      rho\_ct\_ct=drho\_dt\_dt, rho\_sa\_p=drho\_ds\_dp, rho\_ct\_p=drho\_dt\_dp)}
\DoxyCodeLine{271 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__eos__teos10_a075ce98f43e4ad62336849874ddec3e9}\label{namespacemom__eos__teos10_a075ce98f43e4ad62336849874ddec3e9}} 
\index{mom\_eos\_teos10@{mom\_eos\_teos10}!calculate\_spec\_vol\_array\_teos10@{calculate\_spec\_vol\_array\_teos10}}
\index{calculate\_spec\_vol\_array\_teos10@{calculate\_spec\_vol\_array\_teos10}!mom\_eos\_teos10@{mom\_eos\_teos10}}
\doxysubsubsection{\texorpdfstring{calculate\_spec\_vol\_array\_teos10()}{calculate\_spec\_vol\_array\_teos10()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+\_\+teos10\+::calculate\+\_\+spec\+\_\+vol\+\_\+array\+\_\+teos10 (\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 absolute salinity (S \mbox{[}g kg-\/1\mbox{]}), conservative temperature (T \mbox{[}degC\mbox{]}) and pressure \mbox{[}Pa\mbox{]}, using the T\+E\+O\+S10 equation of state. If spv\+\_\+ref is present, specvol is an anomaly from spv\+\_\+ref. 


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


Definition at line 136 of file M\+O\+M\+\_\+\+E\+O\+S\+\_\+\+T\+E\+O\+S10.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{137 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: T\textcolor{comment}{        !< Conservative temperature relative to the surface}}
\DoxyCodeLine{138 \textcolor{comment}{                                              !! [degC].}}
\DoxyCodeLine{139 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: S\textcolor{comment}{        !< salinity [g kg-\/1].}}
\DoxyCodeLine{140 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: pressure\textcolor{comment}{ !< pressure [Pa].}}
\DoxyCodeLine{141 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(out)} :: specvol\textcolor{comment}{  !< in situ specific volume [m3 kg-\/1].}}
\DoxyCodeLine{142   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}  :: start\textcolor{comment}{    !< the starting point in the arrays.}}
\DoxyCodeLine{143   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}  :: npts\textcolor{comment}{     !< the number of values to calculate.}}
\DoxyCodeLine{144 \textcolor{keywordtype}{  real},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: spv\_ref\textcolor{comment}{  !< A reference specific volume [m3 kg-\/1].}}
\DoxyCodeLine{145 }
\DoxyCodeLine{146   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{147 \textcolor{keywordtype}{  real} :: zs, zt, zp}
\DoxyCodeLine{148   \textcolor{keywordtype}{integer} :: j}
\DoxyCodeLine{149 }
\DoxyCodeLine{150   \textcolor{keywordflow}{do} j=start,start+npts-\/1}
\DoxyCodeLine{151     \textcolor{comment}{!Conversions}}
\DoxyCodeLine{152     zs = s(j) \textcolor{comment}{!gsw\_sr\_from\_sp(S(j))       !Convert practical salinity to absolute salinity}}
\DoxyCodeLine{153     zt = t(j) \textcolor{comment}{!gsw\_ct\_from\_pt(S(j),T(j))  !Convert potantial temp to conservative temp}}
\DoxyCodeLine{154     zp = pressure(j)* pa2db         \textcolor{comment}{!Convert pressure from Pascal to decibar}}
\DoxyCodeLine{155 }
\DoxyCodeLine{156     \textcolor{keywordflow}{if} (s(j) < -\/1.0e-\/10) \textcolor{keywordflow}{then}}
\DoxyCodeLine{157       specvol(j) = 0.001 \textcolor{comment}{!Can we assume safely that this is a missing value?}}
\DoxyCodeLine{158     \textcolor{keywordflow}{else}}
\DoxyCodeLine{159       specvol(j) = gsw\_specvol(zs,zt,zp)}
\DoxyCodeLine{160 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{161     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(spv\_ref)) specvol(j) = specvol(j) -\/ spv\_ref}
\DoxyCodeLine{162 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{163 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__eos__teos10_aa3a64aeb82f2380a61a6976f01d5df65}\label{namespacemom__eos__teos10_aa3a64aeb82f2380a61a6976f01d5df65}} 
\index{mom\_eos\_teos10@{mom\_eos\_teos10}!calculate\_spec\_vol\_scalar\_teos10@{calculate\_spec\_vol\_scalar\_teos10}}
\index{calculate\_spec\_vol\_scalar\_teos10@{calculate\_spec\_vol\_scalar\_teos10}!mom\_eos\_teos10@{mom\_eos\_teos10}}
\doxysubsubsection{\texorpdfstring{calculate\_spec\_vol\_scalar\_teos10()}{calculate\_spec\_vol\_scalar\_teos10()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+\_\+teos10\+::calculate\+\_\+spec\+\_\+vol\+\_\+scalar\+\_\+teos10 (\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 absolute salinity (S \mbox{[}g kg-\/1\mbox{]}), conservative temperature (T \mbox{[}degC\mbox{]}) and pressure \mbox{[}Pa\mbox{]}, using the T\+E\+O\+S10 equation of state. If spv\+\_\+ref is present, specvol is an anomaly from spv\+\_\+ref. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em t} & Conservative temperature \mbox{[}degC\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em s} & Absolute salinity \mbox{[}g kg-\/1\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em pressure} & pressure \mbox{[}Pa\mbox{]}. \\
\hline
\mbox{\texttt{ out}}  & {\em specvol} & in situ specific volume \mbox{[}m3 kg-\/1\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em spv\+\_\+ref} & A reference specific volume \mbox{[}m3 kg-\/1\mbox{]}. \\
\hline
\end{DoxyParams}


Definition at line 115 of file M\+O\+M\+\_\+\+E\+O\+S\+\_\+\+T\+E\+O\+S10.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{116 \textcolor{keywordtype}{  real},           \textcolor{keywordtype}{intent(in)}  :: T\textcolor{comment}{        !< Conservative temperature [degC].}}
\DoxyCodeLine{117 \textcolor{keywordtype}{  real},           \textcolor{keywordtype}{intent(in)}  :: S\textcolor{comment}{        !< Absolute salinity [g kg-\/1]}}
\DoxyCodeLine{118 \textcolor{keywordtype}{  real},           \textcolor{keywordtype}{intent(in)}  :: pressure\textcolor{comment}{ !< pressure [Pa].}}
\DoxyCodeLine{119 \textcolor{keywordtype}{  real},           \textcolor{keywordtype}{intent(out)} :: specvol\textcolor{comment}{  !< in situ specific volume [m3 kg-\/1].}}
\DoxyCodeLine{120 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: spv\_ref\textcolor{comment}{  !< A reference specific volume [m3 kg-\/1].}}
\DoxyCodeLine{121 }
\DoxyCodeLine{122   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{123 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(1)} :: T0, S0, pressure0, spv0}
\DoxyCodeLine{124 }
\DoxyCodeLine{125   t0(1) = t ; s0(1) = s ; pressure0(1) = pressure}
\DoxyCodeLine{126 }
\DoxyCodeLine{127   \textcolor{keyword}{call }calculate\_spec\_vol\_array\_teos10(t0, s0, pressure0, spv0, 1, 1, spv\_ref)}
\DoxyCodeLine{128   specvol = spv0(1)}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__eos__teos10_aede3b2ab040292e26a399f5ca90d0d74}\label{namespacemom__eos__teos10_aede3b2ab040292e26a399f5ca90d0d74}} 
\index{mom\_eos\_teos10@{mom\_eos\_teos10}!calculate\_specvol\_derivs\_teos10@{calculate\_specvol\_derivs\_teos10}}
\index{calculate\_specvol\_derivs\_teos10@{calculate\_specvol\_derivs\_teos10}!mom\_eos\_teos10@{mom\_eos\_teos10}}
\doxysubsubsection{\texorpdfstring{calculate\_specvol\_derivs\_teos10()}{calculate\_specvol\_derivs\_teos10()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+eos\+\_\+teos10\+::calculate\+\_\+specvol\+\_\+derivs\+\_\+teos10 (\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)}]{d\+S\+V\+\_\+dT,  }\item[{real, dimension(\+:), intent(out)}]{d\+S\+V\+\_\+dS,  }\item[{integer, intent(in)}]{start,  }\item[{integer, intent(in)}]{npts }\end{DoxyParamCaption})}



For a given thermodynamic state, calculate the derivatives of specific volume with conservative temperature and absolute salinity, using the T\+E\+O\+S10 expressions. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em t} & Conservative temperature \mbox{[}degC\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em s} & Absolute salinity \mbox{[}g kg-\/1\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em pressure} & pressure \mbox{[}Pa\mbox{]}. \\
\hline
\mbox{\texttt{ out}}  & {\em dsv\+\_\+dt} & The partial derivative of specific volume with conservative temperature \mbox{[}m3 kg-\/1 deg\+C-\/1\mbox{]}. \\
\hline
\mbox{\texttt{ out}}  & {\em dsv\+\_\+ds} & The partial derivative of specific volume with absolute salinity \mbox{[}m3 kg-\/1 (g/kg)-\/1\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em start} & The starting point in the arrays. \\
\hline
\mbox{\texttt{ in}}  & {\em npts} & The number of values to calculate. \\
\hline
\end{DoxyParams}


Definition at line 220 of file M\+O\+M\+\_\+\+E\+O\+S\+\_\+\+T\+E\+O\+S10.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{221 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(in)},  \textcolor{keywordtype}{dimension(:)} :: T\textcolor{comment}{        !< Conservative temperature [degC].}}
\DoxyCodeLine{222 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(in)},  \textcolor{keywordtype}{dimension(:)} :: S\textcolor{comment}{        !< Absolute salinity [g kg-\/1].}}
\DoxyCodeLine{223 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(in)},  \textcolor{keywordtype}{dimension(:)} :: pressure\textcolor{comment}{ !< pressure [Pa].}}
\DoxyCodeLine{224 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{dimension(:)} :: dSV\_dT\textcolor{comment}{   !< The partial derivative of specific volume with}}
\DoxyCodeLine{225 \textcolor{comment}{                                                 !! conservative temperature [m3 kg-\/1 degC-\/1].}}
\DoxyCodeLine{226 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{dimension(:)} :: dSV\_dS\textcolor{comment}{   !< The partial derivative of specific volume with}}
\DoxyCodeLine{227 \textcolor{comment}{                                                 !! absolute salinity [m3 kg-\/1 (g/kg)-\/1].}}
\DoxyCodeLine{228   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}                :: start\textcolor{comment}{    !< The starting point in the arrays.}}
\DoxyCodeLine{229   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}                :: npts\textcolor{comment}{     !< The number of values to calculate.}}
\DoxyCodeLine{230 }
\DoxyCodeLine{231   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{232 \textcolor{keywordtype}{  real} :: zs, zt, zp}
\DoxyCodeLine{233   \textcolor{keywordtype}{integer} :: j}
\DoxyCodeLine{234 }
\DoxyCodeLine{235   \textcolor{keywordflow}{do} j=start,start+npts-\/1}
\DoxyCodeLine{236     \textcolor{comment}{!Conversions}}
\DoxyCodeLine{237     zs = s(j) \textcolor{comment}{!gsw\_sr\_from\_sp(S(j))       !Convert practical salinity to absolute salinity}}
\DoxyCodeLine{238     zt = t(j) \textcolor{comment}{!gsw\_ct\_from\_pt(S(j),T(j))  !Convert potantial temp to conservative temp}}
\DoxyCodeLine{239     zp = pressure(j)* pa2db         \textcolor{comment}{!Convert pressure from Pascal to decibar}}
\DoxyCodeLine{240     \textcolor{keywordflow}{if} (s(j) < -\/1.0e-\/10) \textcolor{keywordflow}{then} ; \textcolor{comment}{!Can we assume safely that this is a missing value?}}
\DoxyCodeLine{241       dsv\_dt(j) = 0.0 ; dsv\_ds(j) = 0.0}
\DoxyCodeLine{242     \textcolor{keywordflow}{else}}
\DoxyCodeLine{243       \textcolor{keyword}{call }gsw\_specvol\_first\_derivatives(zs,zt,zp, v\_sa=dsv\_ds(j), v\_ct=dsv\_dt(j))}
\DoxyCodeLine{244 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{245 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{246 }

\end{DoxyCode}
