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


\doxysubsection{Detailed Description}
Calculates the second derivatives of density with various combinations of temperature, salinity, and pressure from T, S and P. 

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

\doxysubsection*{Private functions}
\begin{DoxyCompactItemize}
\item 
subroutine \mbox{\hyperlink{interfacemom__eos_1_1calculate__density__second__derivs_a033e590d1cd2e6864421247f04b0b32d}{calculate\+\_\+density\+\_\+second\+\_\+derivs\+\_\+scalar}} (T, S, pressure, drho\+\_\+d\+S\+\_\+dS, drho\+\_\+d\+S\+\_\+dT, drho\+\_\+d\+T\+\_\+dT, drho\+\_\+d\+S\+\_\+dP, drho\+\_\+d\+T\+\_\+dP, E\+OS, scale)
\begin{DoxyCompactList}\small\item\em Calls the appropriate subroutine to calculate density second derivatives for scalar nputs. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{interfacemom__eos_1_1calculate__density__second__derivs_aa3a38bb75bf60ecc125a00613fa7471a}{calculate\+\_\+density\+\_\+second\+\_\+derivs\+\_\+array}} (T, S, pressure, drho\+\_\+d\+S\+\_\+dS, drho\+\_\+d\+S\+\_\+dT, drho\+\_\+d\+T\+\_\+dT, drho\+\_\+d\+S\+\_\+dP, drho\+\_\+d\+T\+\_\+dP, start, npts, E\+OS, scale)
\begin{DoxyCompactList}\small\item\em Calls the appropriate subroutine to calculate density second derivatives for 1-\/D array inputs. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Calculates the second derivatives of density with various combinations of temperature, salinity, and pressure from T, S and P. 

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



\doxysubsection{Functions and subroutines}
\mbox{\Hypertarget{interfacemom__eos_1_1calculate__density__second__derivs_aa3a38bb75bf60ecc125a00613fa7471a}\label{interfacemom__eos_1_1calculate__density__second__derivs_aa3a38bb75bf60ecc125a00613fa7471a}} 
\index{mom\_eos::calculate\_density\_second\_derivs@{mom\_eos::calculate\_density\_second\_derivs}!calculate\_density\_second\_derivs\_array@{calculate\_density\_second\_derivs\_array}}
\index{calculate\_density\_second\_derivs\_array@{calculate\_density\_second\_derivs\_array}!mom\_eos::calculate\_density\_second\_derivs@{mom\_eos::calculate\_density\_second\_derivs}}
\doxysubsubsection{\texorpdfstring{calculate\_density\_second\_derivs\_array()}{calculate\_density\_second\_derivs\_array()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+::calculate\+\_\+density\+\_\+second\+\_\+derivs\+::calculate\+\_\+density\+\_\+second\+\_\+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\+\_\+d\+S\+\_\+dS,  }\item[{real, dimension(\+:), intent(inout)}]{drho\+\_\+d\+S\+\_\+dT,  }\item[{real, dimension(\+:), intent(inout)}]{drho\+\_\+d\+T\+\_\+dT,  }\item[{real, dimension(\+:), intent(inout)}]{drho\+\_\+d\+S\+\_\+dP,  }\item[{real, dimension(\+:), intent(inout)}]{drho\+\_\+d\+T\+\_\+dP,  }\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 second 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\+\_\+ds\+\_\+ds} & Partial derivative of beta with respect to S \mbox{[}kg m-\/3 ppt-\/2\mbox{]} or \mbox{[}R ppt-\/2 $\sim$$>$ kg m-\/3 ppt-\/2\mbox{]} \\
\hline
\mbox{\texttt{ in,out}}  & {\em drho\+\_\+ds\+\_\+dt} & Partial derivative of beta with respect to T \mbox{[}kg m-\/3 ppt-\/1 deg\+C-\/1\mbox{]} or \mbox{[}R ppt-\/1 deg\+C-\/1 $\sim$$>$ kg m-\/3 ppt-\/1 deg\+C-\/1\mbox{]} \\
\hline
\mbox{\texttt{ in,out}}  & {\em drho\+\_\+dt\+\_\+dt} & Partial derivative of alpha with respect to T \mbox{[}kg m-\/3 deg\+C-\/2\mbox{]} or \mbox{[}R deg\+C-\/2 $\sim$$>$ kg m-\/3 deg\+C-\/2\mbox{]} \\
\hline
\mbox{\texttt{ in,out}}  & {\em drho\+\_\+ds\+\_\+dp} & Partial derivative of beta with respect to pressure \mbox{[}kg m-\/3 ppt-\/1 Pa-\/1\mbox{]} or \mbox{[}R ppt-\/1 Pa-\/1 $\sim$$>$ kg m-\/3 ppt-\/1 Pa-\/1\mbox{]} \\
\hline
\mbox{\texttt{ in,out}}  & {\em drho\+\_\+dt\+\_\+dp} & Partial derivative of alpha with respect to pressure \mbox{[}kg m-\/3 deg\+C-\/1 Pa-\/1\mbox{]} or \mbox{[}R deg\+C-\/1 Pa-\/1 $\sim$$>$ kg m-\/3 deg\+C-\/1 Pa-\/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 842 of file M\+O\+M\+\_\+\+E\+O\+S.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{844 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: T\textcolor{comment}{ !< Potential temperature referenced to the surface [degC]}}
\DoxyCodeLine{845 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: S\textcolor{comment}{ !< Salinity [ppt]}}
\DoxyCodeLine{846 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: pressure\textcolor{comment}{   !< Pressure [Pa] or [R L2 T-\/2 \string~> Pa]}}
\DoxyCodeLine{847 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: drho\_dS\_dS\textcolor{comment}{ !< Partial derivative of beta with respect to S}}
\DoxyCodeLine{848 \textcolor{comment}{                                                  !!  [kg m-\/3 ppt-\/2] or [R ppt-\/2 \string~> kg m-\/3 ppt-\/2]}}
\DoxyCodeLine{849 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: drho\_dS\_dT\textcolor{comment}{ !< Partial derivative of beta with respect to T}}
\DoxyCodeLine{850 \textcolor{comment}{                                                  !! [kg m-\/3 ppt-\/1 degC-\/1] or [R ppt-\/1 degC-\/1 \string~> kg m-\/3 ppt-\/1 degC-\/1]}}
\DoxyCodeLine{851 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: drho\_dT\_dT\textcolor{comment}{ !< Partial derivative of alpha with respect to T}}
\DoxyCodeLine{852 \textcolor{comment}{                                                  !! [kg m-\/3 degC-\/2] or [R degC-\/2 \string~> kg m-\/3 degC-\/2]}}
\DoxyCodeLine{853 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: drho\_dS\_dP\textcolor{comment}{ !< Partial derivative of beta with respect to pressure}}
\DoxyCodeLine{854 \textcolor{comment}{                                                  !! [kg m-\/3 ppt-\/1 Pa-\/1] or [R ppt-\/1 Pa-\/1 \string~> kg m-\/3 ppt-\/1 Pa-\/1]}}
\DoxyCodeLine{855 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: drho\_dT\_dP\textcolor{comment}{ !< Partial derivative of alpha with respect to pressure}}
\DoxyCodeLine{856 \textcolor{comment}{                                                  !! [kg m-\/3 degC-\/1 Pa-\/1] or [R degC-\/1 Pa-\/1 \string~> kg m-\/3 degC-\/1 Pa-\/1]}}
\DoxyCodeLine{857   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}  :: start\textcolor{comment}{ !< Starting index within the array}}
\DoxyCodeLine{858   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}  :: npts\textcolor{comment}{  !< The number of values to calculate}}
\DoxyCodeLine{859   \textcolor{keywordtype}{type}(EOS\_type),     \textcolor{keywordtype}{pointer}     :: EOS\textcolor{comment}{   !< Equation of state structure}}
\DoxyCodeLine{860 \textcolor{keywordtype}{  real},                  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: scale\textcolor{comment}{ !< A multiplicative factor by which to scale density}}
\DoxyCodeLine{861 \textcolor{comment}{                                                  !! in combination with scaling given by US [various]}}
\DoxyCodeLine{862   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{863 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(size(pressure))} :: pres  \textcolor{comment}{! Pressure converted to [Pa]}}
\DoxyCodeLine{864 \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{865 \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{866 \textcolor{keywordtype}{  real} :: I\_p\_scale \textcolor{comment}{! The inverse of the factor to convert pressure to units of Pa [R L2 T-\/2 Pa-\/1 \string~> 1]}}
\DoxyCodeLine{867   \textcolor{keywordtype}{integer} :: j}
\DoxyCodeLine{868 }
\DoxyCodeLine{869   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(eos)) \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{870     \textcolor{stringliteral}{"{}calculate\_density\_derivs called with an unassociated EOS\_type EOS."{}})}
\DoxyCodeLine{871 }
\DoxyCodeLine{872   p\_scale = eos\%RL2\_T2\_to\_Pa}
\DoxyCodeLine{873 }
\DoxyCodeLine{874   \textcolor{keywordflow}{if} (p\_scale == 1.0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{875     \textcolor{keywordflow}{select case} (eos\%form\_of\_EOS)}
\DoxyCodeLine{876       \textcolor{keywordflow}{case} (eos\_linear)}
\DoxyCodeLine{877         \textcolor{keyword}{call }calculate\_density\_second\_derivs\_linear(t, s, pressure, drho\_ds\_ds, drho\_ds\_dt, \&}
\DoxyCodeLine{878                                                     drho\_dt\_dt, drho\_ds\_dp, drho\_dt\_dp, start, npts)}
\DoxyCodeLine{879       \textcolor{keywordflow}{case} (eos\_wright)}
\DoxyCodeLine{880         \textcolor{keyword}{call }calculate\_density\_second\_derivs\_wright(t, s, pressure, drho\_ds\_ds, drho\_ds\_dt, \&}
\DoxyCodeLine{881                                                     drho\_dt\_dt, drho\_ds\_dp, drho\_dt\_dp, start, npts)}
\DoxyCodeLine{882       \textcolor{keywordflow}{case} (eos\_teos10)}
\DoxyCodeLine{883         \textcolor{keyword}{call }calculate\_density\_second\_derivs\_teos10(t, s, pressure, drho\_ds\_ds, drho\_ds\_dt, \&}
\DoxyCodeLine{884                                                     drho\_dt\_dt, drho\_ds\_dp, drho\_dt\_dp, start, npts)}
\DoxyCodeLine{885 \textcolor{keywordflow}{      case default}}
\DoxyCodeLine{886         \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"{}calculate\_density\_derivs: EOS\%form\_of\_EOS is not valid."{}})}
\DoxyCodeLine{887 \textcolor{keywordflow}{    end select}}
\DoxyCodeLine{888   \textcolor{keywordflow}{else}}
\DoxyCodeLine{889     \textcolor{keywordflow}{do} j=start,start+npts-\/1 ; pres(j) = p\_scale * pressure(j) ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{890     \textcolor{keywordflow}{select case} (eos\%form\_of\_EOS)}
\DoxyCodeLine{891       \textcolor{keywordflow}{case} (eos\_linear)}
\DoxyCodeLine{892         \textcolor{keyword}{call }calculate\_density\_second\_derivs\_linear(t, s, pres, drho\_ds\_ds, drho\_ds\_dt, \&}
\DoxyCodeLine{893                                                     drho\_dt\_dt, drho\_ds\_dp, drho\_dt\_dp, start, npts)}
\DoxyCodeLine{894       \textcolor{keywordflow}{case} (eos\_wright)}
\DoxyCodeLine{895         \textcolor{keyword}{call }calculate\_density\_second\_derivs\_wright(t, s, pres, drho\_ds\_ds, drho\_ds\_dt, \&}
\DoxyCodeLine{896                                                     drho\_dt\_dt, drho\_ds\_dp, drho\_dt\_dp, start, npts)}
\DoxyCodeLine{897       \textcolor{keywordflow}{case} (eos\_teos10)}
\DoxyCodeLine{898         \textcolor{keyword}{call }calculate\_density\_second\_derivs\_teos10(t, s, pres, drho\_ds\_ds, drho\_ds\_dt, \&}
\DoxyCodeLine{899                                                     drho\_dt\_dt, drho\_ds\_dp, drho\_dt\_dp, start, npts)}
\DoxyCodeLine{900 \textcolor{keywordflow}{      case default}}
\DoxyCodeLine{901         \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"{}calculate\_density\_derivs: EOS\%form\_of\_EOS is not valid."{}})}
\DoxyCodeLine{902 \textcolor{keywordflow}{    end select}}
\DoxyCodeLine{903 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{904 }
\DoxyCodeLine{905   rho\_scale = eos\%kg\_m3\_to\_R}
\DoxyCodeLine{906   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) rho\_scale = rho\_scale * scale}
\DoxyCodeLine{907   \textcolor{keywordflow}{if} (rho\_scale /= 1.0) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{do} j=start,start+npts-\/1}
\DoxyCodeLine{908     drho\_ds\_ds(j) = rho\_scale * drho\_ds\_ds(j)}
\DoxyCodeLine{909     drho\_ds\_dt(j) = rho\_scale * drho\_ds\_dt(j)}
\DoxyCodeLine{910     drho\_dt\_dt(j) = rho\_scale * drho\_dt\_dt(j)}
\DoxyCodeLine{911     drho\_ds\_dp(j) = rho\_scale * drho\_ds\_dp(j)}
\DoxyCodeLine{912     drho\_dt\_dp(j) = rho\_scale * drho\_dt\_dp(j)}
\DoxyCodeLine{913 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{914 }
\DoxyCodeLine{915   \textcolor{keywordflow}{if} (p\_scale /= 1.0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{916     i\_p\_scale = 1.0 / p\_scale}
\DoxyCodeLine{917     \textcolor{keywordflow}{do} j=start,start+npts-\/1}
\DoxyCodeLine{918       drho\_ds\_dp(j) = i\_p\_scale * drho\_ds\_dp(j)}
\DoxyCodeLine{919       drho\_dt\_dp(j) = i\_p\_scale * drho\_dt\_dp(j)}
\DoxyCodeLine{920 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{921 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{922 }

\end{DoxyCode}
\mbox{\Hypertarget{interfacemom__eos_1_1calculate__density__second__derivs_a033e590d1cd2e6864421247f04b0b32d}\label{interfacemom__eos_1_1calculate__density__second__derivs_a033e590d1cd2e6864421247f04b0b32d}} 
\index{mom\_eos::calculate\_density\_second\_derivs@{mom\_eos::calculate\_density\_second\_derivs}!calculate\_density\_second\_derivs\_scalar@{calculate\_density\_second\_derivs\_scalar}}
\index{calculate\_density\_second\_derivs\_scalar@{calculate\_density\_second\_derivs\_scalar}!mom\_eos::calculate\_density\_second\_derivs@{mom\_eos::calculate\_density\_second\_derivs}}
\doxysubsubsection{\texorpdfstring{calculate\_density\_second\_derivs\_scalar()}{calculate\_density\_second\_derivs\_scalar()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+::calculate\+\_\+density\+\_\+second\+\_\+derivs\+::calculate\+\_\+density\+\_\+second\+\_\+derivs\+\_\+scalar (\begin{DoxyParamCaption}\item[{real, intent(in)}]{T,  }\item[{real, intent(in)}]{S,  }\item[{real, intent(in)}]{pressure,  }\item[{real, intent(out)}]{drho\+\_\+d\+S\+\_\+dS,  }\item[{real, intent(out)}]{drho\+\_\+d\+S\+\_\+dT,  }\item[{real, intent(out)}]{drho\+\_\+d\+T\+\_\+dT,  }\item[{real, intent(out)}]{drho\+\_\+d\+S\+\_\+dP,  }\item[{real, intent(out)}]{drho\+\_\+d\+T\+\_\+dP,  }\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 second derivatives for scalar nputs. 


\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\+\_\+ds\+\_\+ds} & Partial derivative of beta with respect to S \mbox{[}kg m-\/3 ppt-\/2\mbox{]} or \mbox{[}R ppt-\/2 $\sim$$>$ kg m-\/3 ppt-\/2\mbox{]} \\
\hline
\mbox{\texttt{ out}}  & {\em drho\+\_\+ds\+\_\+dt} & Partial derivative of beta with respect to T \mbox{[}kg m-\/3 ppt-\/1 deg\+C-\/1\mbox{]} or \mbox{[}R ppt-\/1 deg\+C-\/1 $\sim$$>$ kg m-\/3 ppt-\/1 deg\+C-\/1\mbox{]} \\
\hline
\mbox{\texttt{ out}}  & {\em drho\+\_\+dt\+\_\+dt} & Partial derivative of alpha with respect to T \mbox{[}kg m-\/3 deg\+C-\/2\mbox{]} or \mbox{[}R deg\+C-\/2 $\sim$$>$ kg m-\/3 deg\+C-\/2\mbox{]} \\
\hline
\mbox{\texttt{ out}}  & {\em drho\+\_\+ds\+\_\+dp} & Partial derivative of beta with respect to pressure \mbox{[}kg m-\/3 ppt-\/1 Pa-\/1\mbox{]} or \mbox{[}R ppt-\/1 Pa-\/1 $\sim$$>$ kg m-\/3 ppt-\/1 Pa-\/1\mbox{]} \\
\hline
\mbox{\texttt{ out}}  & {\em drho\+\_\+dt\+\_\+dp} & Partial derivative of alpha with respect to pressure \mbox{[}kg m-\/3 deg\+C-\/1 Pa-\/1\mbox{]} or \mbox{[}R deg\+C-\/1 Pa-\/1 $\sim$$>$ kg m-\/3 deg\+C-\/1 Pa-\/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 926 of file M\+O\+M\+\_\+\+E\+O\+S.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{928 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)}  :: T\textcolor{comment}{ !< Potential temperature referenced to the surface [degC]}}
\DoxyCodeLine{929 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)}  :: S\textcolor{comment}{ !< Salinity [ppt]}}
\DoxyCodeLine{930 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(in)}  :: pressure\textcolor{comment}{   !< Pressure [Pa] or [R L2 T-\/2 \string~> Pa]}}
\DoxyCodeLine{931 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)} :: drho\_dS\_dS\textcolor{comment}{ !< Partial derivative of beta with respect to S}}
\DoxyCodeLine{932 \textcolor{comment}{                                  !! [kg m-\/3 ppt-\/2] or [R ppt-\/2 \string~> kg m-\/3 ppt-\/2]}}
\DoxyCodeLine{933 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)} :: drho\_dS\_dT\textcolor{comment}{ !< Partial derivative of beta with respect to T}}
\DoxyCodeLine{934 \textcolor{comment}{                                  !! [kg m-\/3 ppt-\/1 degC-\/1] or [R ppt-\/1 degC-\/1 \string~> kg m-\/3 ppt-\/1 degC-\/1]}}
\DoxyCodeLine{935 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)} :: drho\_dT\_dT\textcolor{comment}{ !< Partial derivative of alpha with respect to T}}
\DoxyCodeLine{936 \textcolor{comment}{                                  !! [kg m-\/3 degC-\/2] or [R degC-\/2 \string~> kg m-\/3 degC-\/2]}}
\DoxyCodeLine{937 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)} :: drho\_dS\_dP\textcolor{comment}{ !< Partial derivative of beta with respect to pressure}}
\DoxyCodeLine{938 \textcolor{comment}{                                  !! [kg m-\/3 ppt-\/1 Pa-\/1] or [R ppt-\/1 Pa-\/1 \string~> kg m-\/3 ppt-\/1 Pa-\/1]}}
\DoxyCodeLine{939 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{intent(out)} :: drho\_dT\_dP\textcolor{comment}{ !< Partial derivative of alpha with respect to pressure}}
\DoxyCodeLine{940 \textcolor{comment}{                                  !! [kg m-\/3 degC-\/1 Pa-\/1] or [R degC-\/1 Pa-\/1 \string~> kg m-\/3 degC-\/1 Pa-\/1]}}
\DoxyCodeLine{941   \textcolor{keywordtype}{type}(EOS\_type), \textcolor{keywordtype}{pointer}    :: EOS\textcolor{comment}{ !< Equation of state structure}}
\DoxyCodeLine{942 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: scale\textcolor{comment}{ !< A multiplicative factor by which to scale density}}
\DoxyCodeLine{943 \textcolor{comment}{                                  !! in combination with scaling given by US [various]}}
\DoxyCodeLine{944   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{945 \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{946 \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{947 \textcolor{keywordtype}{  real} :: I\_p\_scale \textcolor{comment}{! The inverse of the factor to convert pressure to units of Pa [R L2 T-\/2 Pa-\/1 \string~> 1]}}
\DoxyCodeLine{948 }
\DoxyCodeLine{949   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(eos)) \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{950     \textcolor{stringliteral}{"{}calculate\_density\_derivs called with an unassociated EOS\_type EOS."{}})}
\DoxyCodeLine{951 }
\DoxyCodeLine{952   p\_scale = eos\%RL2\_T2\_to\_Pa}
\DoxyCodeLine{953 }
\DoxyCodeLine{954   \textcolor{keywordflow}{select case} (eos\%form\_of\_EOS)}
\DoxyCodeLine{955     \textcolor{keywordflow}{case} (eos\_linear)}
\DoxyCodeLine{956       \textcolor{keyword}{call }calculate\_density\_second\_derivs\_linear(t, s, p\_scale*pressure, drho\_ds\_ds, drho\_ds\_dt, \&}
\DoxyCodeLine{957                                                   drho\_dt\_dt, drho\_ds\_dp, drho\_dt\_dp)}
\DoxyCodeLine{958     \textcolor{keywordflow}{case} (eos\_wright)}
\DoxyCodeLine{959       \textcolor{keyword}{call }calculate\_density\_second\_derivs\_wright(t, s, p\_scale*pressure, drho\_ds\_ds, drho\_ds\_dt, \&}
\DoxyCodeLine{960                                                   drho\_dt\_dt, drho\_ds\_dp, drho\_dt\_dp)}
\DoxyCodeLine{961     \textcolor{keywordflow}{case} (eos\_teos10)}
\DoxyCodeLine{962       \textcolor{keyword}{call }calculate\_density\_second\_derivs\_teos10(t, s, p\_scale*pressure, drho\_ds\_ds, drho\_ds\_dt, \&}
\DoxyCodeLine{963                                                   drho\_dt\_dt, drho\_ds\_dp, drho\_dt\_dp)}
\DoxyCodeLine{964 \textcolor{keywordflow}{    case default}}
\DoxyCodeLine{965       \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"{}calculate\_density\_derivs: EOS\%form\_of\_EOS is not valid."{}})}
\DoxyCodeLine{966 \textcolor{keywordflow}{  end select}}
\DoxyCodeLine{967 }
\DoxyCodeLine{968   rho\_scale = eos\%kg\_m3\_to\_R}
\DoxyCodeLine{969   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) rho\_scale = rho\_scale * scale}
\DoxyCodeLine{970   \textcolor{keywordflow}{if} (rho\_scale /= 1.0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{971     drho\_ds\_ds = rho\_scale * drho\_ds\_ds}
\DoxyCodeLine{972     drho\_ds\_dt = rho\_scale * drho\_ds\_dt}
\DoxyCodeLine{973     drho\_dt\_dt = rho\_scale * drho\_dt\_dt}
\DoxyCodeLine{974     drho\_ds\_dp = rho\_scale * drho\_ds\_dp}
\DoxyCodeLine{975     drho\_dt\_dp = rho\_scale * drho\_dt\_dp}
\DoxyCodeLine{976 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{977 }
\DoxyCodeLine{978   \textcolor{keywordflow}{if} (p\_scale /= 1.0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{979     i\_p\_scale = 1.0 / p\_scale}
\DoxyCodeLine{980     drho\_ds\_dp = i\_p\_scale * drho\_ds\_dp}
\DoxyCodeLine{981     drho\_dt\_dp = i\_p\_scale * drho\_dt\_dp}
\DoxyCodeLine{982 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{983 }

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