\hypertarget{interfacemom__eos_1_1calculate__specific__vol__derivs}{}\doxysection{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}}


\doxysubsection{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.

\doxysubsection*{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}


\doxysubsection{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.



\doxysubsection{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}}
\doxysubsubsection{\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{\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{[}R L2 T-\/2 $\sim$$>$ Pa\mbox{]} \\
\hline
\mbox{\texttt{ 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{\texttt{ 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{\texttt{ in}}  & {\em dom} & The domain of indices to work on, taking into account that arrays start at 1. \\
\hline
\mbox{\texttt{ 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 1039 of file M\+O\+M\+\_\+\+E\+O\+S.\+F90.


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


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