\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 \mbox{\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 \mbox{\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(\mbox{\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{\texttt{ in}}  & {\em t} & Potential temperature referenced to the surface \mbox{[}degC\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em s} & Salinity \mbox{[}P\+SU\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em press} & Pressure \mbox{[}Pa\mbox{]} or \mbox{[}R L2 T-\/2 $\sim$$>$ Pa\mbox{]} \\
\hline
\mbox{\texttt{ in,out}}  & {\em rho} & In situ density \mbox{[}kg m-\/3\mbox{]} or \mbox{[}R $\sim$$>$ kg m-\/3\mbox{]} \\
\hline
\mbox{\texttt{ 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{\texttt{ in}}  & {\em start} & Starting index within the array \\
\hline
\mbox{\texttt{ 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}{0}
\DoxyCodeLine{1089 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: T\textcolor{comment}{        !< Potential temperature referenced to the surface [degC]}}
\DoxyCodeLine{1090 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: S\textcolor{comment}{        !< Salinity [PSU]}}
\DoxyCodeLine{1091 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: press\textcolor{comment}{    !< Pressure [Pa] or [R L2 T-2 ~> Pa]}}
\DoxyCodeLine{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]}}
\DoxyCodeLine{1093 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: drho\_dp\textcolor{comment}{  !< The partial derivative of density with pressure}}
\DoxyCodeLine{1094 \textcolor{comment}{                                                !! (also the inverse of the square of sound speed)}}
\DoxyCodeLine{1095 \textcolor{comment}{                                                !! [s2 m-2] or [T2 L-2]}}
\DoxyCodeLine{1096   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}  :: start\textcolor{comment}{    !< Starting index within the array}}
\DoxyCodeLine{1097   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}  :: npts\textcolor{comment}{     !< The number of values to calculate}}
\DoxyCodeLine{1098   \textcolor{keywordtype}{type}(EOS\_type),     \textcolor{keywordtype}{pointer}     :: EOS\textcolor{comment}{      !< Equation of state structure}}
\DoxyCodeLine{1099 }
\DoxyCodeLine{1100   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{1101 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(size(press))} :: pressure  \textcolor{comment}{! Pressure converted to [Pa]}}
\DoxyCodeLine{1102   \textcolor{keywordtype}{integer} :: i, is, ie}
\DoxyCodeLine{1103 }
\DoxyCodeLine{1104   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(eos)) \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{1105     \textcolor{stringliteral}{"calculate\_compress called with an unassociated EOS\_type EOS."})}
\DoxyCodeLine{1106 }
\DoxyCodeLine{1107   is = start ; ie = is + npts - 1}
\DoxyCodeLine{1108   \textcolor{keywordflow}{do} i=is,ie ; pressure(i) = eos\%RL2\_T2\_to\_Pa * press(i) ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{1109 }
\DoxyCodeLine{1110   \textcolor{keywordflow}{select case} (eos\%form\_of\_EOS)}
\DoxyCodeLine{1111     \textcolor{keywordflow}{case} (eos\_linear)}
\DoxyCodeLine{1112       \textcolor{keyword}{call }calculate\_compress\_linear(t, s, pressure, rho, drho\_dp, start, npts, \&}
\DoxyCodeLine{1113                                      eos\%Rho\_T0\_S0, eos\%dRho\_dT, eos\%dRho\_dS)}
\DoxyCodeLine{1114     \textcolor{keywordflow}{case} (eos\_unesco)}
\DoxyCodeLine{1115       \textcolor{keyword}{call }calculate\_compress\_unesco(t, s, pressure, rho, drho\_dp, start, npts)}
\DoxyCodeLine{1116     \textcolor{keywordflow}{case} (eos\_wright)}
\DoxyCodeLine{1117       \textcolor{keyword}{call }calculate\_compress\_wright(t, s, pressure, rho, drho\_dp, start, npts)}
\DoxyCodeLine{1118     \textcolor{keywordflow}{case} (eos\_teos10)}
\DoxyCodeLine{1119       \textcolor{keyword}{call }calculate\_compress\_teos10(t, s, pressure, rho, drho\_dp, start, npts)}
\DoxyCodeLine{1120     \textcolor{keywordflow}{case} (eos\_nemo)}
\DoxyCodeLine{1121       \textcolor{keyword}{call }calculate\_compress\_nemo(t, s, pressure, rho, drho\_dp, start, npts)}
\DoxyCodeLine{1122 \textcolor{keywordflow}{    case default}}
\DoxyCodeLine{1123       \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"calculate\_compress: EOS\%form\_of\_EOS is not valid."})}
\DoxyCodeLine{1124 \textcolor{keywordflow}{  end select}}
\DoxyCodeLine{1125 }
\DoxyCodeLine{1126   \textcolor{keywordflow}{if} (eos\%kg\_m3\_to\_R /= 1.0) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{do} i=is,ie}
\DoxyCodeLine{1127     rho(i) = eos\%kg\_m3\_to\_R * rho(i)}
\DoxyCodeLine{1128 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1129   \textcolor{keywordflow}{if} (eos\%L\_T\_to\_m\_s /= 1.0) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{do} i=is,ie}
\DoxyCodeLine{1130     drho\_dp(i) = eos\%L\_T\_to\_m\_s**2 * drho\_dp(i)}
\DoxyCodeLine{1131 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{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(\mbox{\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{\texttt{ in}}  & {\em t} & Potential temperature referenced to the surface \mbox{[}degC\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em s} & Salinity \mbox{[}ppt\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em pressure} & Pressure \mbox{[}Pa\mbox{]} or \mbox{[}R L2 T-\/2 $\sim$$>$ Pa\mbox{]} \\
\hline
\mbox{\texttt{ out}}  & {\em rho} & In situ density \mbox{[}kg m-\/3\mbox{]} or \mbox{[}R $\sim$$>$ 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{]} 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}{0}
\DoxyCodeLine{1139 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)}        :: T\textcolor{comment}{        !< Potential temperature referenced to the surface [degC]}}
\DoxyCodeLine{1140 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)}        :: S\textcolor{comment}{        !< Salinity [ppt]}}
\DoxyCodeLine{1141 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)}        :: pressure\textcolor{comment}{ !< Pressure [Pa] or [R L2 T-2 ~> Pa]}}
\DoxyCodeLine{1142 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)}       :: rho\textcolor{comment}{      !< In situ density [kg m-3] or [R ~> kg m-3]}}
\DoxyCodeLine{1143 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)}       :: drho\_dp\textcolor{comment}{  !< The partial derivative of density with pressure (also the}}
\DoxyCodeLine{1144 \textcolor{comment}{                                      !! inverse of the square of sound speed) [s2 m-2] or [T2 L-2]}}
\DoxyCodeLine{1145   \textcolor{keywordtype}{type}(EOS\_type), \textcolor{keywordtype}{pointer} :: EOS\textcolor{comment}{      !< Equation of state structure}}
\DoxyCodeLine{1146 }
\DoxyCodeLine{1147   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{1148 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(1)} :: Ta, Sa, pa, rhoa, drho\_dpa}
\DoxyCodeLine{1149 }
\DoxyCodeLine{1150   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(eos)) \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{1151     \textcolor{stringliteral}{"calculate\_compress called with an unassociated EOS\_type EOS."})}
\DoxyCodeLine{1152   ta(1) = t ; sa(1) = s; pa(1) = pressure}
\DoxyCodeLine{1153 }
\DoxyCodeLine{1154   \textcolor{keyword}{call }calculate\_compress\_array(ta, sa, pa, rhoa, drho\_dpa, 1, 1, eos)}
\DoxyCodeLine{1155   rho = rhoa(1) ; drho\_dp = drho\_dpa(1)}
\DoxyCodeLine{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}
