\hypertarget{interfacemom__eos_1_1calculate__density__derivs}{}\section{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}}


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


\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
subroutine \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 \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 \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}


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

Definition at line \hyperlink{MOM__EOS_8F90_source_l00081}{81} 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__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}}
\subsubsection{\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(\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{\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 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{\tt 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{\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 density in combination with scaling given by US \mbox{[}various\mbox{]} \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}
00751   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)},    \textcolor{keywordtype}{intent(in)}    :: t\textcolor{comment}{        !< Potential temperature referenced to the surface
       [degC]}
00752   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)},    \textcolor{keywordtype}{intent(in)}    :: s\textcolor{comment}{        !< Salinity [ppt]}
00753   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)},    \textcolor{keywordtype}{intent(in)}    :: pressure\textcolor{comment}{ !< Pressure [R L2 T-2 ~> Pa]}
00754   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)},    \textcolor{keywordtype}{intent(inout)} :: drho\_dt\textcolor{comment}{  !< The partial derivative of density with potential}
00755 \textcolor{comment}{                                                   !! temperature [R degC-1 ~> kg m-3 degC-1]}
00756   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)},    \textcolor{keywordtype}{intent(inout)} :: drho\_ds\textcolor{comment}{  !< The partial derivative of density with salinity}
00757 \textcolor{comment}{                                                   !! [R degC-1 ~> kg m-3 ppt-1]}
00758   \textcolor{keywordtype}{type}(eos\_type),        \textcolor{keywordtype}{pointer}       :: eos\textcolor{comment}{      !< Equation of state structure}
00759   \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}
00760 \textcolor{comment}{                                                       !! into account that arrays start at 1.}
00761   \textcolor{keywordtype}{real},                  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: scale\textcolor{comment}{ !< A multiplicative factor by which to scale density}
00762 \textcolor{comment}{                                                       !! in combination with scaling given by US [various]}
00763   \textcolor{comment}{! Local variables}
00764   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(size(drho\_dT))} :: pres  \textcolor{comment}{! Pressure converted to [Pa]}
00765   \textcolor{keywordtype}{real} :: rho\_scale \textcolor{comment}{! A factor to convert density from kg m-3 to the desired units [R m3 kg-1 ~> 1]}
00766   \textcolor{keywordtype}{real} :: p\_scale   \textcolor{comment}{! A factor to convert pressure to units of Pa [Pa T2 R-1 L-2 ~> 1]}
00767   \textcolor{keywordtype}{integer} :: i, is, ie, npts
00768 
00769   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(eos)) \textcolor{keyword}{call }mom\_error(fatal, &
00770     \textcolor{stringliteral}{"calculate\_density\_derivs called with an unassociated EOS\_type EOS."})
00771 
00772   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(dom)) \textcolor{keywordflow}{then}
00773     is = dom(1) ; ie = dom(2) ; npts = 1 + ie - is
00774   \textcolor{keywordflow}{else}
00775     is = 1 ; ie = \textcolor{keyword}{size}(drho\_dt) ; npts = 1 + ie - is
00776 \textcolor{keywordflow}{  endif}
00777 
00778   p\_scale = eos%RL2\_T2\_to\_Pa
00779 
00780   \textcolor{keywordflow}{if} (p\_scale == 1.0) \textcolor{keywordflow}{then}
00781     \textcolor{keyword}{call }calculate\_density\_derivs\_array(t, s, pressure, drho\_dt, drho\_ds, is, npts, eos)
00782   \textcolor{keywordflow}{else}
00783     \textcolor{keywordflow}{do} i=is,ie ; pres(i) = p\_scale * pressure(i) ;\textcolor{keywordflow}{ enddo}
00784     \textcolor{keyword}{call }calculate\_density\_derivs\_array(t, s, pres, drho\_dt, drho\_ds, is, npts, eos)
00785 \textcolor{keywordflow}{  endif}
00786 
00787   rho\_scale = eos%kg\_m3\_to\_R
00788   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) rho\_scale = rho\_scale * scale
00789   \textcolor{keywordflow}{if} (rho\_scale /= 1.0) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{do} i=is,ie
00790     drho\_dt(i) = rho\_scale * drho\_dt(i)
00791     drho\_ds(i) = rho\_scale * drho\_ds(i)
00792 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ endif}
00793 
\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}}
\subsubsection{\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(\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{\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 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{\tt 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{\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
\mbox{\tt 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 \hyperlink{MOM__EOS_8F90_source_l00706}{706} of file \hyperlink{MOM__EOS_8F90_source}{M\+O\+M\+\_\+\+E\+O\+S.\+F90}.


\begin{DoxyCode}
00706   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}    :: t\textcolor{comment}{        !< Potential temperature referenced to the surface [degC]}
00707   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}    :: s\textcolor{comment}{        !< Salinity [ppt]}
00708   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}    :: pressure\textcolor{comment}{ !< Pressure [Pa] or [R L2 T-2 ~> Pa]}
00709   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: drho\_dt\textcolor{comment}{  !< The partial derivative of density with potential}
00710 \textcolor{comment}{                                                !! temperature [kg m-3 degC-1] or [R degC-1 ~> kg m-3
       degC-1]}
00711   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: drho\_ds\textcolor{comment}{  !< The partial derivative of density with salinity,}
00712 \textcolor{comment}{                                                !! in [kg m-3 ppt-1] or [R degC-1 ~> kg m-3 ppt-1]}
00713   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}    :: start\textcolor{comment}{    !< Starting index within the array}
00714   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}    :: npts\textcolor{comment}{     !< The number of values to calculate}
00715   \textcolor{keywordtype}{type}(eos\_type),     \textcolor{keywordtype}{pointer}       :: eos\textcolor{comment}{      !< Equation of state structure}
00716   \textcolor{keywordtype}{real},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scale\textcolor{comment}{ !< A multiplicative factor by which to scale density}
00717 \textcolor{comment}{                                                !! in combination with scaling given by US [various]}
00718 
00719   \textcolor{comment}{! Local variables}
00720   \textcolor{keywordtype}{integer} :: j
00721 
00722   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(eos)) \textcolor{keyword}{call }mom\_error(fatal, &
00723     \textcolor{stringliteral}{"calculate\_density\_derivs called with an unassociated EOS\_type EOS."})
00724 
00725   \textcolor{keywordflow}{select case} (eos%form\_of\_EOS)
00726     \textcolor{keywordflow}{case} (eos\_linear)
00727       \textcolor{keyword}{call }calculate\_density\_derivs\_linear(t, s, pressure, drho\_dt, drho\_ds, eos%Rho\_T0\_S0, &
00728                                            eos%dRho\_dT, eos%dRho\_dS, start, npts)
00729     \textcolor{keywordflow}{case} (eos\_unesco)
00730       \textcolor{keyword}{call }calculate\_density\_derivs\_unesco(t, s, pressure, drho\_dt, drho\_ds, start, npts)
00731     \textcolor{keywordflow}{case} (eos\_wright)
00732       \textcolor{keyword}{call }calculate\_density\_derivs\_wright(t, s, pressure, drho\_dt, drho\_ds, start, npts)
00733     \textcolor{keywordflow}{case} (eos\_teos10)
00734       \textcolor{keyword}{call }calculate\_density\_derivs\_teos10(t, s, pressure, drho\_dt, drho\_ds, start, npts)
00735     \textcolor{keywordflow}{case} (eos\_nemo)
00736       \textcolor{keyword}{call }calculate\_density\_derivs\_nemo(t, s, pressure, drho\_dt, drho\_ds, start, npts)
00737 \textcolor{keywordflow}{    case default}
00738       \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"calculate\_density\_derivs\_array: EOS%form\_of\_EOS is not valid."})
00739 \textcolor{keywordflow}{  end select}
00740 
00741   \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
00742     drho\_dt(j) = scale * drho\_dt(j)
00743     drho\_ds(j) = scale * drho\_ds(j)
00744 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ endif} ;\textcolor{keywordflow}{ endif}
00745 
\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}}
\subsubsection{\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(\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{\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 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{\tt 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{\tt 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 \hyperlink{MOM__EOS_8F90_source_l00800}{800} of file \hyperlink{MOM__EOS_8F90_source}{M\+O\+M\+\_\+\+E\+O\+S.\+F90}.


\begin{DoxyCode}
00800   \textcolor{keywordtype}{real},           \textcolor{keywordtype}{intent(in)}  :: t\textcolor{comment}{ !< Potential temperature referenced to the surface [degC]}
00801   \textcolor{keywordtype}{real},           \textcolor{keywordtype}{intent(in)}  :: s\textcolor{comment}{ !< Salinity [ppt]}
00802   \textcolor{keywordtype}{real},           \textcolor{keywordtype}{intent(in)}  :: pressure\textcolor{comment}{ !< Pressure [Pa] or [R L2 T-2 ~> Pa]}
00803   \textcolor{keywordtype}{real},           \textcolor{keywordtype}{intent(out)} :: drho\_dt\textcolor{comment}{ !< The partial derivative of density with potential}
00804 \textcolor{comment}{                                         !! temperature [kg m-3 degC-1] or [R degC-1 ~> kg m-3 degC-1]}
00805   \textcolor{keywordtype}{real},           \textcolor{keywordtype}{intent(out)} :: drho\_ds\textcolor{comment}{ !< The partial derivative of density with salinity,}
00806 \textcolor{comment}{                                         !! in [kg m-3 ppt-1] or [R ppt-1 ~> kg m-3 ppt-1]}
00807   \textcolor{keywordtype}{type}(eos\_type), \textcolor{keywordtype}{pointer}     :: eos\textcolor{comment}{     !< Equation of state structure}
00808   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: scale\textcolor{comment}{   !< A multiplicative factor by which to scale density}
00809 \textcolor{comment}{                                         !! in combination with scaling given by US [various]}
00810   \textcolor{comment}{! Local variables}
00811   \textcolor{keywordtype}{real} :: rho\_scale \textcolor{comment}{! A factor to convert density from kg m-3 to the desired units [R m3 kg-1 ~> 1]}
00812   \textcolor{keywordtype}{real} :: p\_scale   \textcolor{comment}{! A factor to convert pressure to units of Pa [Pa T2 R-1 L-2 ~> 1]}
00813   \textcolor{keywordtype}{integer} :: j
00814 
00815   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(eos)) \textcolor{keyword}{call }mom\_error(fatal, &
00816     \textcolor{stringliteral}{"calculate\_density\_derivs called with an unassociated EOS\_type EOS."})
00817 
00818   p\_scale = eos%RL2\_T2\_to\_Pa
00819 
00820   \textcolor{keywordflow}{select case} (eos%form\_of\_EOS)
00821     \textcolor{keywordflow}{case} (eos\_linear)
00822       \textcolor{keyword}{call }calculate\_density\_derivs\_linear(t, s, p\_scale*pressure, drho\_dt, drho\_ds, &
00823                                            eos%Rho\_T0\_S0, eos%dRho\_dT, eos%dRho\_dS)
00824     \textcolor{keywordflow}{case} (eos\_wright)
00825       \textcolor{keyword}{call }calculate\_density\_derivs\_wright(t, s, p\_scale*pressure, drho\_dt, drho\_ds)
00826     \textcolor{keywordflow}{case} (eos\_teos10)
00827       \textcolor{keyword}{call }calculate\_density\_derivs\_teos10(t, s, p\_scale*pressure, drho\_dt, drho\_ds)
00828 \textcolor{keywordflow}{    case default}
00829       \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"calculate\_density\_derivs\_scalar: EOS%form\_of\_EOS is not valid."})
00830 \textcolor{keywordflow}{  end select}
00831 
00832   rho\_scale = eos%kg\_m3\_to\_R
00833   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) rho\_scale = rho\_scale * scale
00834   \textcolor{keywordflow}{if} (rho\_scale /= 1.0) \textcolor{keywordflow}{then}
00835     drho\_dt = rho\_scale * drho\_dt
00836     drho\_ds = rho\_scale * drho\_ds
00837 \textcolor{keywordflow}{  endif}
00838 
\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}
