\hypertarget{interfacemom__eos_1_1calculate__density__derivs}{}\doxysection{mom\+\_\+eos\+::calculate\+\_\+density\+\_\+derivs Interface Reference}
\label{interfacemom__eos_1_1calculate__density__derivs}\index{mom\_eos::calculate\_density\_derivs@{mom\_eos::calculate\_density\_derivs}}


\doxysubsection{Detailed Description}
Calculate the derivatives of density with temperature and salinity from T, S, and P. 

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

\doxysubsection*{Private functions}
\begin{DoxyCompactItemize}
\item 
subroutine \mbox{\hyperlink{interfacemom__eos_1_1calculate__density__derivs_a522aaffc96993533bb621593c754d1bc}{calculate\+\_\+density\+\_\+derivs\+\_\+scalar}} (T, S, pressure, drho\+\_\+dT, drho\+\_\+dS, E\+OS, scale)
\begin{DoxyCompactList}\small\item\em Calls the appropriate subroutines to calculate density derivatives by promoting a scalar to a one-\/element array. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{interfacemom__eos_1_1calculate__density__derivs_abc880874e27f628ac5c493cf632c210e}{calculate\+\_\+density\+\_\+derivs\+\_\+array}} (T, S, pressure, drho\+\_\+dT, drho\+\_\+dS, start, npts, E\+OS, scale)
\begin{DoxyCompactList}\small\item\em Calls the appropriate subroutine to calculate density derivatives for 1-\/D array inputs. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{interfacemom__eos_1_1calculate__density__derivs_a1572bc0600965c23b719de756b2cc566}{calculate\+\_\+density\+\_\+derivs\+\_\+1d}} (T, S, pressure, drho\+\_\+dT, drho\+\_\+dS, E\+OS, dom, scale)
\begin{DoxyCompactList}\small\item\em Calls the appropriate subroutine to calculate density derivatives for 1-\/D array inputs. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Calculate the derivatives of density with temperature and salinity from T, S, and P. 

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



\doxysubsection{Functions and subroutines}
\mbox{\Hypertarget{interfacemom__eos_1_1calculate__density__derivs_a1572bc0600965c23b719de756b2cc566}\label{interfacemom__eos_1_1calculate__density__derivs_a1572bc0600965c23b719de756b2cc566}} 
\index{mom\_eos::calculate\_density\_derivs@{mom\_eos::calculate\_density\_derivs}!calculate\_density\_derivs\_1d@{calculate\_density\_derivs\_1d}}
\index{calculate\_density\_derivs\_1d@{calculate\_density\_derivs\_1d}!mom\_eos::calculate\_density\_derivs@{mom\_eos::calculate\_density\_derivs}}
\doxysubsubsection{\texorpdfstring{calculate\_density\_derivs\_1d()}{calculate\_density\_derivs\_1d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+::calculate\+\_\+density\+\_\+derivs\+::calculate\+\_\+density\+\_\+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)}]{drho\+\_\+dT,  }\item[{real, dimension(\+:), intent(inout)}]{drho\+\_\+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 density derivatives for 1-\/D array inputs. 


\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 drho\+\_\+dt} & The partial derivative of density with potential temperature \mbox{[}R deg\+C-\/1 $\sim$$>$ kg m-\/3 deg\+C-\/1\mbox{]} \\
\hline
\mbox{\texttt{ in,out}}  & {\em drho\+\_\+ds} & The partial derivative of density with salinity \mbox{[}R deg\+C-\/1 $\sim$$>$ kg m-\/3 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 density in combination with scaling given by US \mbox{[}various\mbox{]} \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{751 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)},    \textcolor{keywordtype}{intent(in)}    :: T\textcolor{comment}{        !< Potential temperature referenced to the surface [degC]}}
\DoxyCodeLine{752 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)},    \textcolor{keywordtype}{intent(in)}    :: S\textcolor{comment}{        !< Salinity [ppt]}}
\DoxyCodeLine{753 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)},    \textcolor{keywordtype}{intent(in)}    :: pressure\textcolor{comment}{ !< Pressure [R L2 T-\/2 \string~> Pa]}}
\DoxyCodeLine{754 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)},    \textcolor{keywordtype}{intent(inout)} :: drho\_dT\textcolor{comment}{  !< The partial derivative of density with potential}}
\DoxyCodeLine{755 \textcolor{comment}{                                                   !! temperature [R degC-\/1 \string~> kg m-\/3 degC-\/1]}}
\DoxyCodeLine{756 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)},    \textcolor{keywordtype}{intent(inout)} :: drho\_dS\textcolor{comment}{  !< The partial derivative of density with salinity}}
\DoxyCodeLine{757 \textcolor{comment}{                                                   !! [R degC-\/1 \string~> kg m-\/3 ppt-\/1]}}
\DoxyCodeLine{758   \textcolor{keywordtype}{type}(EOS\_type),        \textcolor{keywordtype}{pointer}       :: EOS\textcolor{comment}{      !< Equation of state structure}}
\DoxyCodeLine{759   \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{760 \textcolor{comment}{                                                       !! into account that arrays start at 1.}}
\DoxyCodeLine{761 \textcolor{keywordtype}{  real},                  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: scale\textcolor{comment}{ !< A multiplicative factor by which to scale density}}
\DoxyCodeLine{762 \textcolor{comment}{                                                       !! in combination with scaling given by US [various]}}
\DoxyCodeLine{763   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{764 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(size(drho\_dT))} :: pres  \textcolor{comment}{! Pressure converted to [Pa]}}
\DoxyCodeLine{765 \textcolor{keywordtype}{  real} :: rho\_scale \textcolor{comment}{! A factor to convert density from kg m-\/3 to the desired units [R m3 kg-\/1 \string~> 1]}}
\DoxyCodeLine{766 \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{767   \textcolor{keywordtype}{integer} :: i, is, ie, npts}
\DoxyCodeLine{768 }
\DoxyCodeLine{769   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(eos)) \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{770     \textcolor{stringliteral}{"calculate\_density\_derivs called with an unassociated EOS\_type EOS."})}
\DoxyCodeLine{771 }
\DoxyCodeLine{772   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(dom)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{773     is = dom(1) ; ie = dom(2) ; npts = 1 + ie -\/ is}
\DoxyCodeLine{774   \textcolor{keywordflow}{else}}
\DoxyCodeLine{775     is = 1 ; ie = \textcolor{keyword}{size}(drho\_dt) ; npts = 1 + ie -\/ is}
\DoxyCodeLine{776 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{777 }
\DoxyCodeLine{778   p\_scale = eos\%RL2\_T2\_to\_Pa}
\DoxyCodeLine{779 }
\DoxyCodeLine{780   \textcolor{keywordflow}{if} (p\_scale == 1.0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{781     \textcolor{keyword}{call }calculate\_density\_derivs\_array(t, s, pressure, drho\_dt, drho\_ds, is, npts, eos)}
\DoxyCodeLine{782   \textcolor{keywordflow}{else}}
\DoxyCodeLine{783     \textcolor{keywordflow}{do} i=is,ie ; pres(i) = p\_scale * pressure(i) ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{784     \textcolor{keyword}{call }calculate\_density\_derivs\_array(t, s, pres, drho\_dt, drho\_ds, is, npts, eos)}
\DoxyCodeLine{785 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{786 }
\DoxyCodeLine{787   rho\_scale = eos\%kg\_m3\_to\_R}
\DoxyCodeLine{788   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) rho\_scale = rho\_scale * scale}
\DoxyCodeLine{789   \textcolor{keywordflow}{if} (rho\_scale /= 1.0) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{do} i=is,ie}
\DoxyCodeLine{790     drho\_dt(i) = rho\_scale * drho\_dt(i)}
\DoxyCodeLine{791     drho\_ds(i) = rho\_scale * drho\_ds(i)}
\DoxyCodeLine{792 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{793 }

\end{DoxyCode}
\mbox{\Hypertarget{interfacemom__eos_1_1calculate__density__derivs_abc880874e27f628ac5c493cf632c210e}\label{interfacemom__eos_1_1calculate__density__derivs_abc880874e27f628ac5c493cf632c210e}} 
\index{mom\_eos::calculate\_density\_derivs@{mom\_eos::calculate\_density\_derivs}!calculate\_density\_derivs\_array@{calculate\_density\_derivs\_array}}
\index{calculate\_density\_derivs\_array@{calculate\_density\_derivs\_array}!mom\_eos::calculate\_density\_derivs@{mom\_eos::calculate\_density\_derivs}}
\doxysubsubsection{\texorpdfstring{calculate\_density\_derivs\_array()}{calculate\_density\_derivs\_array()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+::calculate\+\_\+density\+\_\+derivs\+::calculate\+\_\+density\+\_\+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)}]{drho\+\_\+dT,  }\item[{real, dimension(\+:), intent(inout)}]{drho\+\_\+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,  }\item[{real, intent(in), optional}]{scale }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Calls the appropriate subroutine to calculate density derivatives for 1-\/D array inputs. 


\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{ in,out}}  & {\em drho\+\_\+dt} & The partial derivative of density with potential temperature \mbox{[}kg m-\/3 deg\+C-\/1\mbox{]} or \mbox{[}R deg\+C-\/1 $\sim$$>$ kg m-\/3 deg\+C-\/1\mbox{]} \\
\hline
\mbox{\texttt{ in,out}}  & {\em drho\+\_\+ds} & The partial derivative of density with salinity, in \mbox{[}kg m-\/3 ppt-\/1\mbox{]} or \mbox{[}R deg\+C-\/1 $\sim$$>$ kg m-\/3 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
\mbox{\texttt{ in}}  & {\em scale} & A multiplicative factor by which to scale density in combination with scaling given by US \mbox{[}various\mbox{]} \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{706 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}    :: T\textcolor{comment}{        !< Potential temperature referenced to the surface [degC]}}
\DoxyCodeLine{707 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}    :: S\textcolor{comment}{        !< Salinity [ppt]}}
\DoxyCodeLine{708 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}    :: pressure\textcolor{comment}{ !< Pressure [Pa] or [R L2 T-\/2 \string~> Pa]}}
\DoxyCodeLine{709 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: drho\_dT\textcolor{comment}{  !< The partial derivative of density with potential}}
\DoxyCodeLine{710 \textcolor{comment}{                                                !! temperature [kg m-\/3 degC-\/1] or [R degC-\/1 \string~> kg m-\/3 degC-\/1]}}
\DoxyCodeLine{711 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: drho\_dS\textcolor{comment}{  !< The partial derivative of density with salinity,}}
\DoxyCodeLine{712 \textcolor{comment}{                                                !! in [kg m-\/3 ppt-\/1] or [R degC-\/1 \string~> kg m-\/3 ppt-\/1]}}
\DoxyCodeLine{713   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}    :: start\textcolor{comment}{    !< Starting index within the array}}
\DoxyCodeLine{714   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}    :: npts\textcolor{comment}{     !< The number of values to calculate}}
\DoxyCodeLine{715   \textcolor{keywordtype}{type}(EOS\_type),     \textcolor{keywordtype}{pointer}       :: EOS\textcolor{comment}{      !< Equation of state structure}}
\DoxyCodeLine{716 \textcolor{keywordtype}{  real},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scale\textcolor{comment}{ !< A multiplicative factor by which to scale density}}
\DoxyCodeLine{717 \textcolor{comment}{                                                !! in combination with scaling given by US [various]}}
\DoxyCodeLine{718 }
\DoxyCodeLine{719   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{720   \textcolor{keywordtype}{integer} :: j}
\DoxyCodeLine{721 }
\DoxyCodeLine{722   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(eos)) \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{723     \textcolor{stringliteral}{"calculate\_density\_derivs called with an unassociated EOS\_type EOS."})}
\DoxyCodeLine{724 }
\DoxyCodeLine{725   \textcolor{keywordflow}{select case} (eos\%form\_of\_EOS)}
\DoxyCodeLine{726     \textcolor{keywordflow}{case} (eos\_linear)}
\DoxyCodeLine{727       \textcolor{keyword}{call }calculate\_density\_derivs\_linear(t, s, pressure, drho\_dt, drho\_ds, eos\%Rho\_T0\_S0, \&}
\DoxyCodeLine{728                                            eos\%dRho\_dT, eos\%dRho\_dS, start, npts)}
\DoxyCodeLine{729     \textcolor{keywordflow}{case} (eos\_unesco)}
\DoxyCodeLine{730       \textcolor{keyword}{call }calculate\_density\_derivs\_unesco(t, s, pressure, drho\_dt, drho\_ds, start, npts)}
\DoxyCodeLine{731     \textcolor{keywordflow}{case} (eos\_wright)}
\DoxyCodeLine{732       \textcolor{keyword}{call }calculate\_density\_derivs\_wright(t, s, pressure, drho\_dt, drho\_ds, start, npts)}
\DoxyCodeLine{733     \textcolor{keywordflow}{case} (eos\_teos10)}
\DoxyCodeLine{734       \textcolor{keyword}{call }calculate\_density\_derivs\_teos10(t, s, pressure, drho\_dt, drho\_ds, start, npts)}
\DoxyCodeLine{735     \textcolor{keywordflow}{case} (eos\_nemo)}
\DoxyCodeLine{736       \textcolor{keyword}{call }calculate\_density\_derivs\_nemo(t, s, pressure, drho\_dt, drho\_ds, start, npts)}
\DoxyCodeLine{737 \textcolor{keywordflow}{    case default}}
\DoxyCodeLine{738       \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"calculate\_density\_derivs\_array: EOS\%form\_of\_EOS is not valid."})}
\DoxyCodeLine{739 \textcolor{keywordflow}{  end select}}
\DoxyCodeLine{740 }
\DoxyCodeLine{741   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (scale /= 1.0) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{do} j=start,start+npts-\/1}
\DoxyCodeLine{742     drho\_dt(j) = scale * drho\_dt(j)}
\DoxyCodeLine{743     drho\_ds(j) = scale * drho\_ds(j)}
\DoxyCodeLine{744 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ endif} ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{745 }

\end{DoxyCode}
\mbox{\Hypertarget{interfacemom__eos_1_1calculate__density__derivs_a522aaffc96993533bb621593c754d1bc}\label{interfacemom__eos_1_1calculate__density__derivs_a522aaffc96993533bb621593c754d1bc}} 
\index{mom\_eos::calculate\_density\_derivs@{mom\_eos::calculate\_density\_derivs}!calculate\_density\_derivs\_scalar@{calculate\_density\_derivs\_scalar}}
\index{calculate\_density\_derivs\_scalar@{calculate\_density\_derivs\_scalar}!mom\_eos::calculate\_density\_derivs@{mom\_eos::calculate\_density\_derivs}}
\doxysubsubsection{\texorpdfstring{calculate\_density\_derivs\_scalar()}{calculate\_density\_derivs\_scalar()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+::calculate\+\_\+density\+\_\+derivs\+::calculate\+\_\+density\+\_\+derivs\+\_\+scalar (\begin{DoxyParamCaption}\item[{real, intent(in)}]{T,  }\item[{real, intent(in)}]{S,  }\item[{real, intent(in)}]{pressure,  }\item[{real, intent(out)}]{drho\+\_\+dT,  }\item[{real, intent(out)}]{drho\+\_\+dS,  }\item[{type(\mbox{\hyperlink{structmom__eos_1_1eos__type}{eos\+\_\+type}}), pointer}]{E\+OS,  }\item[{real, intent(in), optional}]{scale }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Calls the appropriate subroutines to calculate density derivatives by promoting a scalar to a one-\/element 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{]} or \mbox{[}R L2 T-\/2 $\sim$$>$ Pa\mbox{]} \\
\hline
\mbox{\texttt{ out}}  & {\em drho\+\_\+dt} & The partial derivative of density with potential temperature \mbox{[}kg m-\/3 deg\+C-\/1\mbox{]} or \mbox{[}R deg\+C-\/1 $\sim$$>$ kg m-\/3 deg\+C-\/1\mbox{]} \\
\hline
\mbox{\texttt{ out}}  & {\em drho\+\_\+ds} & The partial derivative of density with salinity, in \mbox{[}kg m-\/3 ppt-\/1\mbox{]} or \mbox{[}R ppt-\/1 $\sim$$>$ kg m-\/3 ppt-\/1\mbox{]} \\
\hline
 & {\em eos} & Equation of state structure \\
\hline
\mbox{\texttt{ in}}  & {\em scale} & A multiplicative factor by which to scale density in combination with scaling given by US \mbox{[}various\mbox{]} \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{800 \textcolor{keywordtype}{  real},           \textcolor{keywordtype}{intent(in)}  :: T\textcolor{comment}{ !< Potential temperature referenced to the surface [degC]}}
\DoxyCodeLine{801 \textcolor{keywordtype}{  real},           \textcolor{keywordtype}{intent(in)}  :: S\textcolor{comment}{ !< Salinity [ppt]}}
\DoxyCodeLine{802 \textcolor{keywordtype}{  real},           \textcolor{keywordtype}{intent(in)}  :: pressure\textcolor{comment}{ !< Pressure [Pa] or [R L2 T-\/2 \string~> Pa]}}
\DoxyCodeLine{803 \textcolor{keywordtype}{  real},           \textcolor{keywordtype}{intent(out)} :: drho\_dT\textcolor{comment}{ !< The partial derivative of density with potential}}
\DoxyCodeLine{804 \textcolor{comment}{                                         !! temperature [kg m-\/3 degC-\/1] or [R degC-\/1 \string~> kg m-\/3 degC-\/1]}}
\DoxyCodeLine{805 \textcolor{keywordtype}{  real},           \textcolor{keywordtype}{intent(out)} :: drho\_dS\textcolor{comment}{ !< The partial derivative of density with salinity,}}
\DoxyCodeLine{806 \textcolor{comment}{                                         !! in [kg m-\/3 ppt-\/1] or [R ppt-\/1 \string~> kg m-\/3 ppt-\/1]}}
\DoxyCodeLine{807   \textcolor{keywordtype}{type}(EOS\_type), \textcolor{keywordtype}{pointer}     :: EOS\textcolor{comment}{     !< Equation of state structure}}
\DoxyCodeLine{808 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: scale\textcolor{comment}{   !< A multiplicative factor by which to scale density}}
\DoxyCodeLine{809 \textcolor{comment}{                                         !! in combination with scaling given by US [various]}}
\DoxyCodeLine{810   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{811 \textcolor{keywordtype}{  real} :: rho\_scale \textcolor{comment}{! A factor to convert density from kg m-\/3 to the desired units [R m3 kg-\/1 \string~> 1]}}
\DoxyCodeLine{812 \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{813   \textcolor{keywordtype}{integer} :: j}
\DoxyCodeLine{814 }
\DoxyCodeLine{815   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(eos)) \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{816     \textcolor{stringliteral}{"calculate\_density\_derivs called with an unassociated EOS\_type EOS."})}
\DoxyCodeLine{817 }
\DoxyCodeLine{818   p\_scale = eos\%RL2\_T2\_to\_Pa}
\DoxyCodeLine{819 }
\DoxyCodeLine{820   \textcolor{keywordflow}{select case} (eos\%form\_of\_EOS)}
\DoxyCodeLine{821     \textcolor{keywordflow}{case} (eos\_linear)}
\DoxyCodeLine{822       \textcolor{keyword}{call }calculate\_density\_derivs\_linear(t, s, p\_scale*pressure, drho\_dt, drho\_ds, \&}
\DoxyCodeLine{823                                            eos\%Rho\_T0\_S0, eos\%dRho\_dT, eos\%dRho\_dS)}
\DoxyCodeLine{824     \textcolor{keywordflow}{case} (eos\_wright)}
\DoxyCodeLine{825       \textcolor{keyword}{call }calculate\_density\_derivs\_wright(t, s, p\_scale*pressure, drho\_dt, drho\_ds)}
\DoxyCodeLine{826     \textcolor{keywordflow}{case} (eos\_teos10)}
\DoxyCodeLine{827       \textcolor{keyword}{call }calculate\_density\_derivs\_teos10(t, s, p\_scale*pressure, drho\_dt, drho\_ds)}
\DoxyCodeLine{828 \textcolor{keywordflow}{    case default}}
\DoxyCodeLine{829       \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"calculate\_density\_derivs\_scalar: EOS\%form\_of\_EOS is not valid."})}
\DoxyCodeLine{830 \textcolor{keywordflow}{  end select}}
\DoxyCodeLine{831 }
\DoxyCodeLine{832   rho\_scale = eos\%kg\_m3\_to\_R}
\DoxyCodeLine{833   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) rho\_scale = rho\_scale * scale}
\DoxyCodeLine{834   \textcolor{keywordflow}{if} (rho\_scale /= 1.0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{835     drho\_dt = rho\_scale * drho\_dt}
\DoxyCodeLine{836     drho\_ds = rho\_scale * drho\_ds}
\DoxyCodeLine{837 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{838 }

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