\hypertarget{interfacemom__eos_1_1calculate__compress}{}\section{mom\+\_\+eos\+:\+:calculate\+\_\+compress Interface Reference}
\label{interfacemom__eos_1_1calculate__compress}\index{mom\+\_\+eos\+::calculate\+\_\+compress@{mom\+\_\+eos\+::calculate\+\_\+compress}}


\subsection{Detailed Description}
Calculates the compressibility of water from T, S, and P. 

Definition at line 103 of file M\+O\+M\+\_\+\+E\+O\+S.\+F90.

\subsection*{Private functions}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{interfacemom__eos_1_1calculate__compress_aeea5c8180415d4755c99ebde065a8531}{calculate\+\_\+compress\+\_\+scalar} (T, S, pressure, rho, drho\+\_\+dp, E\+OS)
\begin{DoxyCompactList}\small\item\em Calculate density and compressibility for a scalar. This just promotes the scalar to an array with a singleton dimension and calls calculate\+\_\+compress\+\_\+array. If US is present, the units of the inputs and outputs are rescaled. \end{DoxyCompactList}\item 
subroutine \hyperlink{interfacemom__eos_1_1calculate__compress_a9f741b490451d2a461f290e2294af55d}{calculate\+\_\+compress\+\_\+array} (T, S, press, rho, drho\+\_\+dp, start, npts, E\+OS)
\begin{DoxyCompactList}\small\item\em Calls the appropriate subroutine to calculate the density and compressibility for 1-\/D array inputs. If US is present, the units of the inputs and outputs are rescaled. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Calculates the compressibility of water from T, S, and P. 

Definition at line 103 of file M\+O\+M\+\_\+\+E\+O\+S.\+F90.



\subsection{Functions and subroutines}
\mbox{\Hypertarget{interfacemom__eos_1_1calculate__compress_a9f741b490451d2a461f290e2294af55d}\label{interfacemom__eos_1_1calculate__compress_a9f741b490451d2a461f290e2294af55d}} 
\index{mom\+\_\+eos\+::calculate\+\_\+compress@{mom\+\_\+eos\+::calculate\+\_\+compress}!calculate\+\_\+compress\+\_\+array@{calculate\+\_\+compress\+\_\+array}}
\index{calculate\+\_\+compress\+\_\+array@{calculate\+\_\+compress\+\_\+array}!mom\+\_\+eos\+::calculate\+\_\+compress@{mom\+\_\+eos\+::calculate\+\_\+compress}}
\subsubsection{\texorpdfstring{calculate\+\_\+compress\+\_\+array()}{calculate\_compress\_array()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+::calculate\+\_\+compress\+::calculate\+\_\+compress\+\_\+array (\begin{DoxyParamCaption}\item[{real, dimension(\+:), intent(in)}]{T,  }\item[{real, dimension(\+:), intent(in)}]{S,  }\item[{real, dimension(\+:), intent(in)}]{press,  }\item[{real, dimension(\+:), intent(inout)}]{rho,  }\item[{real, dimension(\+:), intent(inout)}]{drho\+\_\+dp,  }\item[{integer, intent(in)}]{start,  }\item[{integer, intent(in)}]{npts,  }\item[{type(\hyperlink{structmom__eos_1_1eos__type}{eos\+\_\+type}), pointer}]{E\+OS }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Calls the appropriate subroutine to calculate the density and compressibility for 1-\/D array inputs. If US is present, the units of the inputs and outputs are rescaled. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em t} & Potential temperature referenced to the surface \mbox{[}degC\mbox{]}\\
\hline
\mbox{\tt in}  & {\em s} & Salinity \mbox{[}P\+SU\mbox{]}\\
\hline
\mbox{\tt in}  & {\em press} & Pressure \mbox{[}Pa\mbox{]} or \mbox{[}R L2 T-\/2 $\sim$$>$ Pa\mbox{]}\\
\hline
\mbox{\tt in,out}  & {\em rho} & In situ density \mbox{[}kg m-\/3\mbox{]} or \mbox{[}R $\sim$$>$ kg m-\/3\mbox{]}\\
\hline
\mbox{\tt in,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{]} or \mbox{[}T2 L-\/2\mbox{]}\\
\hline
\mbox{\tt in}  & {\em start} & Starting index within the array\\
\hline
\mbox{\tt in}  & {\em npts} & The number of values to calculate\\
\hline
 & {\em eos} & Equation of state structure \\
\hline
\end{DoxyParams}


Definition at line 1089 of file M\+O\+M\+\_\+\+E\+O\+S.\+F90.


\begin{DoxyCode}
1089   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: t\textcolor{comment}{        !< Potential temperature referenced to the surface [degC]}
1090   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: s\textcolor{comment}{        !< Salinity [PSU]}
1091   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: press\textcolor{comment}{    !< Pressure [Pa] or [R L2 T-2 ~> Pa]}
1092   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: rho\textcolor{comment}{      !< In situ density [kg m-3] or [R ~> kg m-3]}
1093   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: drho\_dp\textcolor{comment}{  !< The partial derivative of density with pressure}
1094 \textcolor{comment}{                                                !! (also the inverse of the square of sound speed)}
1095 \textcolor{comment}{                                                !! [s2 m-2] or [T2 L-2]}
1096   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}  :: start\textcolor{comment}{    !< Starting index within the array}
1097   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}  :: npts\textcolor{comment}{     !< The number of values to calculate}
1098   \textcolor{keywordtype}{type}(eos\_type),     \textcolor{keywordtype}{pointer}     :: eos\textcolor{comment}{      !< Equation of state structure}
1099 
1100   \textcolor{comment}{! Local variables}
1101   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(size(press))} :: pressure  \textcolor{comment}{! Pressure converted to [Pa]}
1102   \textcolor{keywordtype}{integer} :: i, is, ie
1103 
1104   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(eos)) \textcolor{keyword}{call }mom\_error(fatal, &
1105     \textcolor{stringliteral}{"calculate\_compress called with an unassociated EOS\_type EOS."})
1106 
1107   is = start ; ie = is + npts - 1
1108   \textcolor{keywordflow}{do} i=is,ie ; pressure(i) = eos%RL2\_T2\_to\_Pa * press(i) ;\textcolor{keywordflow}{ enddo}
1109 
1110   \textcolor{keywordflow}{select case} (eos%form\_of\_EOS)
1111     \textcolor{keywordflow}{case} (eos\_linear)
1112       \textcolor{keyword}{call }calculate\_compress\_linear(t, s, pressure, rho, drho\_dp, start, npts, &
1113                                      eos%Rho\_T0\_S0, eos%dRho\_dT, eos%dRho\_dS)
1114     \textcolor{keywordflow}{case} (eos\_unesco)
1115       \textcolor{keyword}{call }calculate\_compress\_unesco(t, s, pressure, rho, drho\_dp, start, npts)
1116     \textcolor{keywordflow}{case} (eos\_wright)
1117       \textcolor{keyword}{call }calculate\_compress\_wright(t, s, pressure, rho, drho\_dp, start, npts)
1118     \textcolor{keywordflow}{case} (eos\_teos10)
1119       \textcolor{keyword}{call }calculate\_compress\_teos10(t, s, pressure, rho, drho\_dp, start, npts)
1120     \textcolor{keywordflow}{case} (eos\_nemo)
1121       \textcolor{keyword}{call }calculate\_compress\_nemo(t, s, pressure, rho, drho\_dp, start, npts)
1122 \textcolor{keywordflow}{    case default}
1123       \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"calculate\_compress: EOS%form\_of\_EOS is not valid."})
1124 \textcolor{keywordflow}{  end select}
1125 
1126   \textcolor{keywordflow}{if} (eos%kg\_m3\_to\_R /= 1.0) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{do} i=is,ie
1127     rho(i) = eos%kg\_m3\_to\_R * rho(i)
1128 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ endif}
1129   \textcolor{keywordflow}{if} (eos%L\_T\_to\_m\_s /= 1.0) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{do} i=is,ie
1130     drho\_dp(i) = eos%L\_T\_to\_m\_s**2 * drho\_dp(i)
1131 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ endif}
1132 
\end{DoxyCode}
\mbox{\Hypertarget{interfacemom__eos_1_1calculate__compress_aeea5c8180415d4755c99ebde065a8531}\label{interfacemom__eos_1_1calculate__compress_aeea5c8180415d4755c99ebde065a8531}} 
\index{mom\+\_\+eos\+::calculate\+\_\+compress@{mom\+\_\+eos\+::calculate\+\_\+compress}!calculate\+\_\+compress\+\_\+scalar@{calculate\+\_\+compress\+\_\+scalar}}
\index{calculate\+\_\+compress\+\_\+scalar@{calculate\+\_\+compress\+\_\+scalar}!mom\+\_\+eos\+::calculate\+\_\+compress@{mom\+\_\+eos\+::calculate\+\_\+compress}}
\subsubsection{\texorpdfstring{calculate\+\_\+compress\+\_\+scalar()}{calculate\_compress\_scalar()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+::calculate\+\_\+compress\+::calculate\+\_\+compress\+\_\+scalar (\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(out)}]{drho\+\_\+dp,  }\item[{type(\hyperlink{structmom__eos_1_1eos__type}{eos\+\_\+type}), pointer}]{E\+OS }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Calculate density and compressibility for a scalar. This just promotes the scalar to an array with a singleton dimension and calls calculate\+\_\+compress\+\_\+array. If US is present, the units of the inputs and outputs are rescaled. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em t} & Potential temperature referenced to the surface \mbox{[}degC\mbox{]}\\
\hline
\mbox{\tt in}  & {\em s} & Salinity \mbox{[}ppt\mbox{]}\\
\hline
\mbox{\tt in}  & {\em pressure} & Pressure \mbox{[}Pa\mbox{]} or \mbox{[}R L2 T-\/2 $\sim$$>$ Pa\mbox{]}\\
\hline
\mbox{\tt out}  & {\em rho} & In situ density \mbox{[}kg m-\/3\mbox{]} or \mbox{[}R $\sim$$>$ 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{]} or \mbox{[}T2 L-\/2\mbox{]}\\
\hline
 & {\em eos} & Equation of state structure \\
\hline
\end{DoxyParams}


Definition at line 1139 of file M\+O\+M\+\_\+\+E\+O\+S.\+F90.


\begin{DoxyCode}
1139   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)}        :: t\textcolor{comment}{        !< Potential temperature referenced to the surface [degC]}
1140   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)}        :: s\textcolor{comment}{        !< Salinity [ppt]}
1141   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)}        :: pressure\textcolor{comment}{ !< Pressure [Pa] or [R L2 T-2 ~> Pa]}
1142   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(out)}       :: rho\textcolor{comment}{      !< In situ density [kg m-3] or [R ~> kg m-3]}
1143   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(out)}       :: drho\_dp\textcolor{comment}{  !< The partial derivative of density with pressure (also the}
1144 \textcolor{comment}{                                      !! inverse of the square of sound speed) [s2 m-2] or [T2 L-2]}
1145   \textcolor{keywordtype}{type}(eos\_type), \textcolor{keywordtype}{pointer} :: eos\textcolor{comment}{      !< Equation of state structure}
1146 
1147   \textcolor{comment}{! Local variables}
1148   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(1)} :: ta, sa, pa, rhoa, drho\_dpa
1149 
1150   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(eos)) \textcolor{keyword}{call }mom\_error(fatal, &
1151     \textcolor{stringliteral}{"calculate\_compress called with an unassociated EOS\_type EOS."})
1152   ta(1) = t ; sa(1) = s; pa(1) = pressure
1153 
1154   \textcolor{keyword}{call }calculate\_compress\_array(ta, sa, pa, rhoa, drho\_dpa, 1, 1, eos)
1155   rho = rhoa(1) ; drho\_dp = drho\_dpa(1)
1156 
\end{DoxyCode}


The documentation for this interface was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
/home/cermak/src/\+M\+O\+M6.\+devrob/src/equation\+\_\+of\+\_\+state/M\+O\+M\+\_\+\+E\+O\+S.\+F90\end{DoxyCompactItemize}
