\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}}


Calculates the compressibility of water from T, S, and P.  


\subsection*{Private Member 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 \hyperlink{MOM__EOS_8F90_source_l00103}{103} of file \hyperlink{MOM__EOS_8F90_source}{M\+O\+M\+\_\+\+E\+O\+S.\+F90}.



\subsection{Member Function/\+Subroutine Documentation}
\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 \hyperlink{MOM__EOS_8F90_source_l01089}{1089} of file \hyperlink{MOM__EOS_8F90_source}{M\+O\+M\+\_\+\+E\+O\+S.\+F90}.


\begin{DoxyCode}
01089   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: t\textcolor{comment}{        !< Potential temperature referenced to the surface [degC]}
01090   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: s\textcolor{comment}{        !< Salinity [PSU]}
01091   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: press\textcolor{comment}{    !< Pressure [Pa] or [R L2 T-2 ~> Pa]}
01092   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: rho\textcolor{comment}{      !< In situ density [kg m-3] or [R ~> kg m-3]}
01093   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: drho\_dp\textcolor{comment}{  !< The partial derivative of density with pressure}
01094 \textcolor{comment}{                                                !! (also the inverse of the square of sound speed)}
01095 \textcolor{comment}{                                                !! [s2 m-2] or [T2 L-2]}
01096   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}  :: start\textcolor{comment}{    !< Starting index within the array}
01097   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}  :: npts\textcolor{comment}{     !< The number of values to calculate}
01098   \textcolor{keywordtype}{type}(eos\_type),     \textcolor{keywordtype}{pointer}     :: eos\textcolor{comment}{      !< Equation of state structure}
01099 
01100   \textcolor{comment}{! Local variables}
01101   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(size(press))} :: pressure  \textcolor{comment}{! Pressure converted to [Pa]}
01102   \textcolor{keywordtype}{integer} :: i, is, ie
01103 
01104   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(eos)) \textcolor{keyword}{call }mom\_error(fatal, &
01105     \textcolor{stringliteral}{"calculate\_compress called with an unassociated EOS\_type EOS."})
01106 
01107   is = start ; ie = is + npts - 1
01108   \textcolor{keywordflow}{do} i=is,ie ; pressure(i) = eos%RL2\_T2\_to\_Pa * press(i) ;\textcolor{keywordflow}{ enddo}
01109 
01110   \textcolor{keywordflow}{select case} (eos%form\_of\_EOS)
01111     \textcolor{keywordflow}{case} (eos\_linear)
01112       \textcolor{keyword}{call }calculate\_compress\_linear(t, s, pressure, rho, drho\_dp, start, npts, &
01113                                      eos%Rho\_T0\_S0, eos%dRho\_dT, eos%dRho\_dS)
01114     \textcolor{keywordflow}{case} (eos\_unesco)
01115       \textcolor{keyword}{call }calculate\_compress\_unesco(t, s, pressure, rho, drho\_dp, start, npts)
01116     \textcolor{keywordflow}{case} (eos\_wright)
01117       \textcolor{keyword}{call }calculate\_compress\_wright(t, s, pressure, rho, drho\_dp, start, npts)
01118     \textcolor{keywordflow}{case} (eos\_teos10)
01119       \textcolor{keyword}{call }calculate\_compress\_teos10(t, s, pressure, rho, drho\_dp, start, npts)
01120     \textcolor{keywordflow}{case} (eos\_nemo)
01121       \textcolor{keyword}{call }calculate\_compress\_nemo(t, s, pressure, rho, drho\_dp, start, npts)
01122 \textcolor{keywordflow}{    case default}
01123       \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"calculate\_compress: EOS%form\_of\_EOS is not valid."})
01124 \textcolor{keywordflow}{  end select}
01125 
01126   \textcolor{keywordflow}{if} (eos%kg\_m3\_to\_R /= 1.0) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{do} i=is,ie
01127     rho(i) = eos%kg\_m3\_to\_R * rho(i)
01128 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ endif}
01129   \textcolor{keywordflow}{if} (eos%L\_T\_to\_m\_s /= 1.0) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{do} i=is,ie
01130     drho\_dp(i) = eos%L\_T\_to\_m\_s**2 * drho\_dp(i)
01131 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ endif}
01132 
\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 \hyperlink{MOM__EOS_8F90_source_l01139}{1139} of file \hyperlink{MOM__EOS_8F90_source}{M\+O\+M\+\_\+\+E\+O\+S.\+F90}.


\begin{DoxyCode}
01139   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)}        :: t\textcolor{comment}{        !< Potential temperature referenced to the surface [degC]}
01140   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)}        :: s\textcolor{comment}{        !< Salinity [ppt]}
01141   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)}        :: pressure\textcolor{comment}{ !< Pressure [Pa] or [R L2 T-2 ~> Pa]}
01142   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(out)}       :: rho\textcolor{comment}{      !< In situ density [kg m-3] or [R ~> kg m-3]}
01143   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(out)}       :: drho\_dp\textcolor{comment}{  !< The partial derivative of density with pressure (also the}
01144 \textcolor{comment}{                                      !! inverse of the square of sound speed) [s2 m-2] or [T2 L-2]}
01145   \textcolor{keywordtype}{type}(eos\_type), \textcolor{keywordtype}{pointer} :: eos\textcolor{comment}{      !< Equation of state structure}
01146 
01147   \textcolor{comment}{! Local variables}
01148   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(1)} :: ta, sa, pa, rhoa, drho\_dpa
01149 
01150   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(eos)) \textcolor{keyword}{call }mom\_error(fatal, &
01151     \textcolor{stringliteral}{"calculate\_compress called with an unassociated EOS\_type EOS."})
01152   ta(1) = t ; sa(1) = s; pa(1) = pressure
01153 
01154   \textcolor{keyword}{call }calculate\_compress\_array(ta, sa, pa, rhoa, drho\_dpa, 1, 1, eos)
01155   rho = rhoa(1) ; drho\_dp = drho\_dpa(1)
01156 
\end{DoxyCode}


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