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


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

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

\subsection*{Private functions}
\begin{DoxyCompactItemize}
\item 
subroutine \mbox{\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 \mbox{\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 87 of file M\+O\+M\+\_\+\+E\+O\+S.\+F90.



\subsection{Functions and subroutines}
\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(\mbox{\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 1040 of file M\+O\+M\+\_\+\+E\+O\+S.\+F90.


\begin{DoxyCode}
1040   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}    :: T\textcolor{comment}{        !< Potential temperature referenced to the surface [degC]}
1041   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}    :: S\textcolor{comment}{        !< Salinity [ppt]}
1042   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}    :: pressure\textcolor{comment}{ !< Pressure [R L2 T-2 ~> Pa]}
1043   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: dSV\_dT\textcolor{comment}{   !< The partial derivative of specific volume with potential}
1044 \textcolor{comment}{                                                !! temperature [R-1 degC-1 ~> m3 kg-1 degC-1]}
1045   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: dSV\_dS\textcolor{comment}{   !< The partial derivative of specific volume with salinity}
1046 \textcolor{comment}{                                                !! [R-1 ppt-1 ~> m3 kg-1 ppt-1]}
1047   \textcolor{keywordtype}{type}(EOS\_type),     \textcolor{keywordtype}{pointer}       :: EOS\textcolor{comment}{      !< Equation of state structure}
1048   \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}
1049 \textcolor{comment}{                                                       !! into account that arrays start at 1.}
1050   \textcolor{keywordtype}{real},                  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: scale\textcolor{comment}{ !< A multiplicative factor by which to scale
       specific}
1051 \textcolor{comment}{                                                !! volume in combination with scaling given by US [various]}
1052 
1053   \textcolor{comment}{! Local variables}
1054   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(size(dSV\_dT))} :: press   \textcolor{comment}{! Pressure converted to [Pa]}
1055   \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]}
1056   \textcolor{keywordtype}{real} :: p\_scale   \textcolor{comment}{! A factor to convert pressure to units of Pa [Pa T2 R-1 L-2 ~> 1]}
1057   \textcolor{keywordtype}{integer} :: i, is, ie, npts
1058 
1059   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(eos)) \textcolor{keyword}{call }mom\_error(fatal, &
1060     \textcolor{stringliteral}{"calculate\_spec\_vol\_derivs\_1d called with an unassociated EOS\_type EOS."})
1061 
1062   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(dom)) \textcolor{keywordflow}{then}
1063     is = dom(1) ; ie = dom(2) ; npts = 1 + ie - is
1064   \textcolor{keywordflow}{else}
1065     is = 1 ; ie = \textcolor{keyword}{size}(dsv\_dt) ; npts = 1 + ie - is
1066 \textcolor{keywordflow}{  endif}
1067   p\_scale = eos%RL2\_T2\_to\_Pa
1068 
1069   \textcolor{keywordflow}{if} (p\_scale == 1.0) \textcolor{keywordflow}{then}
1070     \textcolor{keyword}{call }calculate\_spec\_vol\_derivs\_array(t, s, pressure, dsv\_dt, dsv\_ds, is, npts, eos)
1071   \textcolor{keywordflow}{else}
1072     \textcolor{keywordflow}{do} i=is,ie ; press(i) = p\_scale * pressure(i) ;\textcolor{keywordflow}{ enddo}
1073     \textcolor{keyword}{call }calculate\_spec\_vol\_derivs\_array(t, s, press, dsv\_dt, dsv\_ds, is, npts, eos)
1074 \textcolor{keywordflow}{  endif}
1075 
1076   spv\_scale = eos%R\_to\_kg\_m3
1077   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) spv\_scale = spv\_scale * scale
1078   \textcolor{keywordflow}{if} (spv\_scale /= 1.0) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{do} i=is,ie
1079     dsv\_dt(i) = spv\_scale * dsv\_dt(i)
1080     dsv\_ds(i) = spv\_scale * dsv\_ds(i)
1081 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ endif}
1082 
\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(\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 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 988 of file M\+O\+M\+\_\+\+E\+O\+S.\+F90.


\begin{DoxyCode}
988   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: T\textcolor{comment}{ !< Potential temperature referenced to the surface [degC]}
989   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: S\textcolor{comment}{ !< Salinity [ppt]}
990   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: pressure\textcolor{comment}{ !< Pressure [Pa]}
991   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: dSV\_dT\textcolor{comment}{ !< The partial derivative of specific volume with potential}
992 \textcolor{comment}{                                              !! temperature [m3 kg-1 degC-1]}
993   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: dSV\_dS\textcolor{comment}{ !< The partial derivative of specific volume with salinity}
994 \textcolor{comment}{                                              !! [m3 kg-1 ppt-1]}
995   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}  :: start\textcolor{comment}{  !< Starting index within the array}
996   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}  :: npts\textcolor{comment}{   !< The number of values to calculate}
997   \textcolor{keywordtype}{type}(EOS\_type),     \textcolor{keywordtype}{pointer}     :: EOS\textcolor{comment}{    !< Equation of state structure}
998 
999   \textcolor{comment}{! Local variables}
1000   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(size(T))} :: press   \textcolor{comment}{! Pressure converted to [Pa]}
1001   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(size(T))} :: rho     \textcolor{comment}{! In situ density [kg m-3]}
1002   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(size(T))} :: dRho\_dT \textcolor{comment}{! Derivative of density with temperature [kg m-3 degC-1]}
1003   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(size(T))} :: dRho\_dS \textcolor{comment}{! Derivative of density with salinity [kg m-3 ppt-1]}
1004   \textcolor{keywordtype}{integer} :: j
1005 
1006   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(eos)) \textcolor{keyword}{call }mom\_error(fatal, &
1007     \textcolor{stringliteral}{"calculate\_spec\_vol\_derivs\_array called with an unassociated EOS\_type EOS."})
1008 
1009   \textcolor{keywordflow}{select case} (eos%form\_of\_EOS)
1010     \textcolor{keywordflow}{case} (eos\_linear)
1011       \textcolor{keyword}{call }calculate\_specvol\_derivs\_linear(t, s, pressure, dsv\_dt, dsv\_ds, start, &
1012                                            npts, eos%Rho\_T0\_S0, eos%dRho\_dT, eos%dRho\_dS)
1013     \textcolor{keywordflow}{case} (eos\_unesco)
1014       \textcolor{keyword}{call }calculate\_density\_unesco(t, s, pressure, rho, start, npts)
1015       \textcolor{keyword}{call }calculate\_density\_derivs\_unesco(t, s, pressure, drho\_dt, drho\_ds, start, npts)
1016       \textcolor{keywordflow}{do} j=start,start+npts-1
1017         dsv\_dt(j) = -drho\_dt(j)/(rho(j)**2)
1018         dsv\_ds(j) = -drho\_ds(j)/(rho(j)**2)
1019 \textcolor{keywordflow}{      enddo}
1020     \textcolor{keywordflow}{case} (eos\_wright)
1021       \textcolor{keyword}{call }calculate\_specvol\_derivs\_wright(t, s, pressure, dsv\_dt, dsv\_ds, start, npts)
1022     \textcolor{keywordflow}{case} (eos\_teos10)
1023       \textcolor{keyword}{call }calculate\_specvol\_derivs\_teos10(t, s, pressure, dsv\_dt, dsv\_ds, start, npts)
1024     \textcolor{keywordflow}{case} (eos\_nemo)
1025       \textcolor{keyword}{call }calculate\_density\_nemo(t, s, pressure, rho, start, npts)
1026       \textcolor{keyword}{call }calculate\_density\_derivs\_nemo(t, s, pressure, drho\_dt, drho\_ds, start, npts)
1027       \textcolor{keywordflow}{do} j=start,start+npts-1
1028         dsv\_dt(j) = -drho\_dt(j)/(rho(j)**2)
1029         dsv\_ds(j) = -drho\_ds(j)/(rho(j)**2)
1030 \textcolor{keywordflow}{      enddo}
1031 \textcolor{keywordflow}{    case default}
1032       \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"calculate\_spec\_vol\_derivs\_array: EOS%form\_of\_EOS is not valid."})
1033 \textcolor{keywordflow}{  end select}
1034 
\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}
