\hypertarget{interfacemom__eos_1_1calculate__specific__vol__derivs}{}\section{mom\+\_\+eos\+:\+:calculate\+\_\+specific\+\_\+vol\+\_\+derivs Interface Reference}
\label{interfacemom__eos_1_1calculate__specific__vol__derivs}\index{mom\+\_\+eos\+::calculate\+\_\+specific\+\_\+vol\+\_\+derivs@{mom\+\_\+eos\+::calculate\+\_\+specific\+\_\+vol\+\_\+derivs}}


Calculate the derivatives of specific volume with temperature and salinity from T, S, and P.  


\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{interfacemom__eos_1_1calculate__specific__vol__derivs_a245ef8405e381d5326c418c94b0faa4a}{calculate\+\_\+spec\+\_\+vol\+\_\+derivs\+\_\+array} (T, S, pressure, d\+S\+V\+\_\+dT, d\+S\+V\+\_\+dS, start, npts, E\+OS)
\begin{DoxyCompactList}\small\item\em Calls the appropriate subroutine to calculate specific volume derivatives for an array. \end{DoxyCompactList}\item 
subroutine \hyperlink{interfacemom__eos_1_1calculate__specific__vol__derivs_ad44078b2db052c8ed472d8b6c8632a5b}{calc\+\_\+spec\+\_\+vol\+\_\+derivs\+\_\+1d} (T, S, pressure, d\+S\+V\+\_\+dT, d\+S\+V\+\_\+dS, E\+OS, dom, scale)
\begin{DoxyCompactList}\small\item\em Calls the appropriate subroutine to calculate specific volume derivatives for 1-\/d array inputs, potentially limiting the domain of indices that are worked on. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Calculate the derivatives of specific volume with temperature and salinity from T, S, and P. 

Definition at line \hyperlink{MOM__EOS_8F90_source_l00087}{87} 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__specific__vol__derivs_ad44078b2db052c8ed472d8b6c8632a5b}\label{interfacemom__eos_1_1calculate__specific__vol__derivs_ad44078b2db052c8ed472d8b6c8632a5b}} 
\index{mom\+\_\+eos\+::calculate\+\_\+specific\+\_\+vol\+\_\+derivs@{mom\+\_\+eos\+::calculate\+\_\+specific\+\_\+vol\+\_\+derivs}!calc\+\_\+spec\+\_\+vol\+\_\+derivs\+\_\+1d@{calc\+\_\+spec\+\_\+vol\+\_\+derivs\+\_\+1d}}
\index{calc\+\_\+spec\+\_\+vol\+\_\+derivs\+\_\+1d@{calc\+\_\+spec\+\_\+vol\+\_\+derivs\+\_\+1d}!mom\+\_\+eos\+::calculate\+\_\+specific\+\_\+vol\+\_\+derivs@{mom\+\_\+eos\+::calculate\+\_\+specific\+\_\+vol\+\_\+derivs}}
\subsubsection{\texorpdfstring{calc\+\_\+spec\+\_\+vol\+\_\+derivs\+\_\+1d()}{calc\_spec\_vol\_derivs\_1d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+::calculate\+\_\+specific\+\_\+vol\+\_\+derivs\+::calc\+\_\+spec\+\_\+vol\+\_\+derivs\+\_\+1d (\begin{DoxyParamCaption}\item[{real, dimension(\+:), intent(in)}]{T,  }\item[{real, dimension(\+:), intent(in)}]{S,  }\item[{real, dimension(\+:), intent(in)}]{pressure,  }\item[{real, dimension(\+:), intent(inout)}]{d\+S\+V\+\_\+dT,  }\item[{real, dimension(\+:), intent(inout)}]{d\+S\+V\+\_\+dS,  }\item[{type(\hyperlink{structmom__eos_1_1eos__type}{eos\+\_\+type}), pointer}]{E\+OS,  }\item[{integer, dimension(2), intent(in), optional}]{dom,  }\item[{real, intent(in), optional}]{scale }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Calls the appropriate subroutine to calculate specific volume derivatives for 1-\/d array inputs, potentially limiting the domain of indices that are worked on. 


\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{[}R L2 T-\/2 $\sim$$>$ Pa\mbox{]}\\
\hline
\mbox{\tt in,out}  & {\em dsv\+\_\+dt} & The partial derivative of specific volume with potential temperature \mbox{[}R-\/1 deg\+C-\/1 $\sim$$>$ m3 kg-\/1 deg\+C-\/1\mbox{]}\\
\hline
\mbox{\tt in,out}  & {\em dsv\+\_\+ds} & The partial derivative of specific volume with salinity \mbox{[}R-\/1 ppt-\/1 $\sim$$>$ m3 kg-\/1 ppt-\/1\mbox{]}\\
\hline
 & {\em eos} & Equation of state structure\\
\hline
\mbox{\tt in}  & {\em dom} & The domain of indices to work on, taking into account that arrays start at 1.\\
\hline
\mbox{\tt in}  & {\em scale} & A multiplicative factor by which to scale specific volume in combination with scaling given by US \mbox{[}various\mbox{]} \\
\hline
\end{DoxyParams}


Definition at line \hyperlink{MOM__EOS_8F90_source_l01040}{1040} of file \hyperlink{MOM__EOS_8F90_source}{M\+O\+M\+\_\+\+E\+O\+S.\+F90}.


\begin{DoxyCode}
01040   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}    :: t\textcolor{comment}{        !< Potential temperature referenced to the surface [degC]}
01041   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}    :: s\textcolor{comment}{        !< Salinity [ppt]}
01042   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}    :: pressure\textcolor{comment}{ !< Pressure [R L2 T-2 ~> Pa]}
01043   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: dsv\_dt\textcolor{comment}{   !< The partial derivative of specific volume with potential}
01044 \textcolor{comment}{                                                !! temperature [R-1 degC-1 ~> m3 kg-1 degC-1]}
01045   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: dsv\_ds\textcolor{comment}{   !< The partial derivative of specific volume with salinity}
01046 \textcolor{comment}{                                                !! [R-1 ppt-1 ~> m3 kg-1 ppt-1]}
01047   \textcolor{keywordtype}{type}(eos\_type),     \textcolor{keywordtype}{pointer}       :: eos\textcolor{comment}{      !< Equation of state structure}
01048   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{dimension(2)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: dom\textcolor{comment}{   !< The domain of indices to work on, taking}
01049 \textcolor{comment}{                                                       !! into account that arrays start at 1.}
01050   \textcolor{keywordtype}{real},                  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: scale\textcolor{comment}{ !< A multiplicative factor by which to scale
       specific}
01051 \textcolor{comment}{                                                !! volume in combination with scaling given by US [various]}
01052 
01053   \textcolor{comment}{! Local variables}
01054   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(size(dSV\_dT))} :: press   \textcolor{comment}{! Pressure converted to [Pa]}
01055   \textcolor{keywordtype}{real} :: spv\_scale \textcolor{comment}{! A factor to convert specific volume from m3 kg-1 to the desired units [kg R-1 m-3 ~>
       1]}
01056   \textcolor{keywordtype}{real} :: p\_scale   \textcolor{comment}{! A factor to convert pressure to units of Pa [Pa T2 R-1 L-2 ~> 1]}
01057   \textcolor{keywordtype}{integer} :: i, is, ie, npts
01058 
01059   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(eos)) \textcolor{keyword}{call }mom\_error(fatal, &
01060     \textcolor{stringliteral}{"calculate\_spec\_vol\_derivs\_1d called with an unassociated EOS\_type EOS."})
01061 
01062   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(dom)) \textcolor{keywordflow}{then}
01063     is = dom(1) ; ie = dom(2) ; npts = 1 + ie - is
01064   \textcolor{keywordflow}{else}
01065     is = 1 ; ie = \textcolor{keyword}{size}(dsv\_dt) ; npts = 1 + ie - is
01066 \textcolor{keywordflow}{  endif}
01067   p\_scale = eos%RL2\_T2\_to\_Pa
01068 
01069   \textcolor{keywordflow}{if} (p\_scale == 1.0) \textcolor{keywordflow}{then}
01070     \textcolor{keyword}{call }calculate\_spec\_vol\_derivs\_array(t, s, pressure, dsv\_dt, dsv\_ds, is, npts, eos)
01071   \textcolor{keywordflow}{else}
01072     \textcolor{keywordflow}{do} i=is,ie ; press(i) = p\_scale * pressure(i) ;\textcolor{keywordflow}{ enddo}
01073     \textcolor{keyword}{call }calculate\_spec\_vol\_derivs\_array(t, s, press, dsv\_dt, dsv\_ds, is, npts, eos)
01074 \textcolor{keywordflow}{  endif}
01075 
01076   spv\_scale = eos%R\_to\_kg\_m3
01077   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) spv\_scale = spv\_scale * scale
01078   \textcolor{keywordflow}{if} (spv\_scale /= 1.0) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{do} i=is,ie
01079     dsv\_dt(i) = spv\_scale * dsv\_dt(i)
01080     dsv\_ds(i) = spv\_scale * dsv\_ds(i)
01081 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ endif}
01082 
\end{DoxyCode}
\mbox{\Hypertarget{interfacemom__eos_1_1calculate__specific__vol__derivs_a245ef8405e381d5326c418c94b0faa4a}\label{interfacemom__eos_1_1calculate__specific__vol__derivs_a245ef8405e381d5326c418c94b0faa4a}} 
\index{mom\+\_\+eos\+::calculate\+\_\+specific\+\_\+vol\+\_\+derivs@{mom\+\_\+eos\+::calculate\+\_\+specific\+\_\+vol\+\_\+derivs}!calculate\+\_\+spec\+\_\+vol\+\_\+derivs\+\_\+array@{calculate\+\_\+spec\+\_\+vol\+\_\+derivs\+\_\+array}}
\index{calculate\+\_\+spec\+\_\+vol\+\_\+derivs\+\_\+array@{calculate\+\_\+spec\+\_\+vol\+\_\+derivs\+\_\+array}!mom\+\_\+eos\+::calculate\+\_\+specific\+\_\+vol\+\_\+derivs@{mom\+\_\+eos\+::calculate\+\_\+specific\+\_\+vol\+\_\+derivs}}
\subsubsection{\texorpdfstring{calculate\+\_\+spec\+\_\+vol\+\_\+derivs\+\_\+array()}{calculate\_spec\_vol\_derivs\_array()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+::calculate\+\_\+specific\+\_\+vol\+\_\+derivs\+::calculate\+\_\+spec\+\_\+vol\+\_\+derivs\+\_\+array (\begin{DoxyParamCaption}\item[{real, dimension(\+:), intent(in)}]{T,  }\item[{real, dimension(\+:), intent(in)}]{S,  }\item[{real, dimension(\+:), intent(in)}]{pressure,  }\item[{real, dimension(\+:), intent(inout)}]{d\+S\+V\+\_\+dT,  }\item[{real, dimension(\+:), intent(inout)}]{d\+S\+V\+\_\+dS,  }\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 specific volume derivatives for an array. 


\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{]}\\
\hline
\mbox{\tt in,out}  & {\em dsv\+\_\+dt} & The partial derivative of specific volume with potential temperature \mbox{[}m3 kg-\/1 deg\+C-\/1\mbox{]}\\
\hline
\mbox{\tt in,out}  & {\em dsv\+\_\+ds} & The partial derivative of specific volume with salinity \mbox{[}m3 kg-\/1 ppt-\/1\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_l00988}{988} of file \hyperlink{MOM__EOS_8F90_source}{M\+O\+M\+\_\+\+E\+O\+S.\+F90}.


\begin{DoxyCode}
00988   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: t\textcolor{comment}{ !< Potential temperature referenced to the surface [degC]}
00989   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: s\textcolor{comment}{ !< Salinity [ppt]}
00990   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: pressure\textcolor{comment}{ !< Pressure [Pa]}
00991   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: dsv\_dt\textcolor{comment}{ !< The partial derivative of specific volume with potential}
00992 \textcolor{comment}{                                              !! temperature [m3 kg-1 degC-1]}
00993   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: dsv\_ds\textcolor{comment}{ !< The partial derivative of specific volume with salinity}
00994 \textcolor{comment}{                                              !! [m3 kg-1 ppt-1]}
00995   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}  :: start\textcolor{comment}{  !< Starting index within the array}
00996   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}  :: npts\textcolor{comment}{   !< The number of values to calculate}
00997   \textcolor{keywordtype}{type}(eos\_type),     \textcolor{keywordtype}{pointer}     :: eos\textcolor{comment}{    !< Equation of state structure}
00998 
00999   \textcolor{comment}{! Local variables}
01000   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(size(T))} :: press   \textcolor{comment}{! Pressure converted to [Pa]}
01001   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(size(T))} :: rho     \textcolor{comment}{! In situ density [kg m-3]}
01002   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(size(T))} :: drho\_dt \textcolor{comment}{! Derivative of density with temperature [kg m-3 degC-1]}
01003   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(size(T))} :: drho\_ds \textcolor{comment}{! Derivative of density with salinity [kg m-3 ppt-1]}
01004   \textcolor{keywordtype}{integer} :: j
01005 
01006   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(eos)) \textcolor{keyword}{call }mom\_error(fatal, &
01007     \textcolor{stringliteral}{"calculate\_spec\_vol\_derivs\_array called with an unassociated EOS\_type EOS."})
01008 
01009   \textcolor{keywordflow}{select case} (eos%form\_of\_EOS)
01010     \textcolor{keywordflow}{case} (eos\_linear)
01011       \textcolor{keyword}{call }calculate\_specvol\_derivs\_linear(t, s, pressure, dsv\_dt, dsv\_ds, start, &
01012                                            npts, eos%Rho\_T0\_S0, eos%dRho\_dT, eos%dRho\_dS)
01013     \textcolor{keywordflow}{case} (eos\_unesco)
01014       \textcolor{keyword}{call }calculate\_density\_unesco(t, s, pressure, rho, start, npts)
01015       \textcolor{keyword}{call }calculate\_density\_derivs\_unesco(t, s, pressure, drho\_dt, drho\_ds, start, npts)
01016       \textcolor{keywordflow}{do} j=start,start+npts-1
01017         dsv\_dt(j) = -drho\_dt(j)/(rho(j)**2)
01018         dsv\_ds(j) = -drho\_ds(j)/(rho(j)**2)
01019 \textcolor{keywordflow}{      enddo}
01020     \textcolor{keywordflow}{case} (eos\_wright)
01021       \textcolor{keyword}{call }calculate\_specvol\_derivs\_wright(t, s, pressure, dsv\_dt, dsv\_ds, start, npts)
01022     \textcolor{keywordflow}{case} (eos\_teos10)
01023       \textcolor{keyword}{call }calculate\_specvol\_derivs\_teos10(t, s, pressure, dsv\_dt, dsv\_ds, start, npts)
01024     \textcolor{keywordflow}{case} (eos\_nemo)
01025       \textcolor{keyword}{call }calculate\_density\_nemo(t, s, pressure, rho, start, npts)
01026       \textcolor{keyword}{call }calculate\_density\_derivs\_nemo(t, s, pressure, drho\_dt, drho\_ds, start, npts)
01027       \textcolor{keywordflow}{do} j=start,start+npts-1
01028         dsv\_dt(j) = -drho\_dt(j)/(rho(j)**2)
01029         dsv\_ds(j) = -drho\_ds(j)/(rho(j)**2)
01030 \textcolor{keywordflow}{      enddo}
01031 \textcolor{keywordflow}{    case default}
01032       \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"calculate\_spec\_vol\_derivs\_array: EOS%form\_of\_EOS is not valid."})
01033 \textcolor{keywordflow}{  end select}
01034 
\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}
