\hypertarget{interfacemom__eos__wright_1_1calculate__density__derivs__wright}{}\section{mom\+\_\+eos\+\_\+wright\+::calculate\+\_\+density\+\_\+derivs\+\_\+wright Interface Reference}
\label{interfacemom__eos__wright_1_1calculate__density__derivs__wright}\index{mom\_eos\_wright::calculate\_density\_derivs\_wright@{mom\_eos\_wright::calculate\_density\_derivs\_wright}}


\subsection{Detailed Description}
For a given thermodynamic state, return the derivatives of density with temperature and salinity. 

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

\subsection*{Private functions}
\begin{DoxyCompactItemize}
\item 
subroutine \mbox{\hyperlink{interfacemom__eos__wright_1_1calculate__density__derivs__wright_a2e5f71809f24b2646fb1c047753ce634}{calculate\+\_\+density\+\_\+derivs\+\_\+scalar\+\_\+wright}} (T, S, pressure, drho\+\_\+dT, drho\+\_\+dS)
\begin{DoxyCompactList}\small\item\em The scalar version of calculate\+\_\+density\+\_\+derivs which promotes scalar inputs to a 1-\/element array and then demotes the output back to a scalar. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{interfacemom__eos__wright_1_1calculate__density__derivs__wright_a6fcef766020d2abf55cfb220bcc37d06}{calculate\+\_\+density\+\_\+derivs\+\_\+array\+\_\+wright}} (T, S, pressure, drho\+\_\+dT, drho\+\_\+dS, start, npts)
\begin{DoxyCompactList}\small\item\em For a given thermodynamic state, return the thermal/haline expansion coefficients. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
For a given thermodynamic state, return the derivatives of density with temperature and salinity. 

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



\subsection{Functions and subroutines}
\mbox{\Hypertarget{interfacemom__eos__wright_1_1calculate__density__derivs__wright_a6fcef766020d2abf55cfb220bcc37d06}\label{interfacemom__eos__wright_1_1calculate__density__derivs__wright_a6fcef766020d2abf55cfb220bcc37d06}} 
\index{mom\_eos\_wright::calculate\_density\_derivs\_wright@{mom\_eos\_wright::calculate\_density\_derivs\_wright}!calculate\_density\_derivs\_array\_wright@{calculate\_density\_derivs\_array\_wright}}
\index{calculate\_density\_derivs\_array\_wright@{calculate\_density\_derivs\_array\_wright}!mom\_eos\_wright::calculate\_density\_derivs\_wright@{mom\_eos\_wright::calculate\_density\_derivs\_wright}}
\subsubsection{\texorpdfstring{calculate\_density\_derivs\_array\_wright()}{calculate\_density\_derivs\_array\_wright()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+\_\+wright\+::calculate\+\_\+density\+\_\+derivs\+\_\+wright\+::calculate\+\_\+density\+\_\+derivs\+\_\+array\+\_\+wright (\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 }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



For a given thermodynamic state, return the thermal/haline expansion coefficients. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em t} & Potential temperature relative to the surface \mbox{[}degC\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em s} & Salinity \mbox{[}P\+SU\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em pressure} & pressure \mbox{[}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{]}. \\
\hline
\mbox{\texttt{ in,out}}  & {\em drho\+\_\+ds} & The partial derivative of density with salinity, in \mbox{[}kg m-\/3 P\+S\+U-\/1\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em start} & The starting point in the arrays. \\
\hline
\mbox{\texttt{ in}}  & {\em npts} & The number of values to calculate. \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{200 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(in)},    \textcolor{keywordtype}{dimension(:)} :: T\textcolor{comment}{        !< Potential temperature relative to the}}
\DoxyCodeLine{201 \textcolor{comment}{                                                   !! surface [degC].}}
\DoxyCodeLine{202 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(in)},    \textcolor{keywordtype}{dimension(:)} :: S\textcolor{comment}{        !< Salinity [PSU].}}
\DoxyCodeLine{203 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(in)},    \textcolor{keywordtype}{dimension(:)} :: pressure\textcolor{comment}{ !< pressure [Pa].}}
\DoxyCodeLine{204 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(inout)}, \textcolor{keywordtype}{dimension(:)} :: drho\_dT\textcolor{comment}{  !< The partial derivative of density with potential}}
\DoxyCodeLine{205 \textcolor{comment}{                                                   !! temperature [kg m-3 degC-1].}}
\DoxyCodeLine{206 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(inout)}, \textcolor{keywordtype}{dimension(:)} :: drho\_dS\textcolor{comment}{  !< The partial derivative of density with salinity,}}
\DoxyCodeLine{207 \textcolor{comment}{                                                   !! in [kg m-3 PSU-1].}}
\DoxyCodeLine{208   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}                  :: start\textcolor{comment}{    !< The starting point in the arrays.}}
\DoxyCodeLine{209   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}                  :: npts\textcolor{comment}{     !< The number of values to calculate.}}
\DoxyCodeLine{210 }
\DoxyCodeLine{211   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{212 \textcolor{keywordtype}{  real} :: al0, p0, lambda, I\_denom2}
\DoxyCodeLine{213   \textcolor{keywordtype}{integer} :: j}
\DoxyCodeLine{214 }
\DoxyCodeLine{215   \textcolor{keywordflow}{do} j=start,start+npts-1}
\DoxyCodeLine{216     al0 = (a0 + a1*t(j)) + a2*s(j)}
\DoxyCodeLine{217     p0 = (b0 + b4*s(j)) + t(j) * (b1 + t(j)*((b2 + b3*t(j))) + b5*s(j))}
\DoxyCodeLine{218     lambda = (c0 +c4*s(j)) + t(j) * (c1 + t(j)*((c2 + c3*t(j))) + c5*s(j))}
\DoxyCodeLine{219 }
\DoxyCodeLine{220     i\_denom2 = 1.0 / (lambda + al0*(pressure(j) + p0))}
\DoxyCodeLine{221     i\_denom2 = i\_denom2 *i\_denom2}
\DoxyCodeLine{222     drho\_dt(j) = i\_denom2 * \&}
\DoxyCodeLine{223       (lambda* (b1 + t(j)*(2.0*b2 + 3.0*b3*t(j)) + b5*s(j)) - \&}
\DoxyCodeLine{224        (pressure(j)+p0) * ( (pressure(j)+p0)*a1 + \&}
\DoxyCodeLine{225         (c1 + t(j)*(c2*2.0 + c3*3.0*t(j)) + c5*s(j)) ))}
\DoxyCodeLine{226     drho\_ds(j) = i\_denom2 * (lambda* (b4 + b5*t(j)) - \&}
\DoxyCodeLine{227       (pressure(j)+p0) * ( (pressure(j)+p0)*a2 + (c4 + c5*t(j)) ))}
\DoxyCodeLine{228 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{229 }

\end{DoxyCode}
\mbox{\Hypertarget{interfacemom__eos__wright_1_1calculate__density__derivs__wright_a2e5f71809f24b2646fb1c047753ce634}\label{interfacemom__eos__wright_1_1calculate__density__derivs__wright_a2e5f71809f24b2646fb1c047753ce634}} 
\index{mom\_eos\_wright::calculate\_density\_derivs\_wright@{mom\_eos\_wright::calculate\_density\_derivs\_wright}!calculate\_density\_derivs\_scalar\_wright@{calculate\_density\_derivs\_scalar\_wright}}
\index{calculate\_density\_derivs\_scalar\_wright@{calculate\_density\_derivs\_scalar\_wright}!mom\_eos\_wright::calculate\_density\_derivs\_wright@{mom\_eos\_wright::calculate\_density\_derivs\_wright}}
\subsubsection{\texorpdfstring{calculate\_density\_derivs\_scalar\_wright()}{calculate\_density\_derivs\_scalar\_wright()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+\_\+wright\+::calculate\+\_\+density\+\_\+derivs\+\_\+wright\+::calculate\+\_\+density\+\_\+derivs\+\_\+scalar\+\_\+wright (\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 }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



The scalar version of calculate\+\_\+density\+\_\+derivs which promotes scalar inputs to a 1-\/element array and then demotes the output back to a scalar. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em t} & Potential temperature relative to the surface \mbox{[}degC\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em s} & Salinity \mbox{[}P\+SU\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em pressure} & pressure \mbox{[}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{]}. \\
\hline
\mbox{\texttt{ out}}  & {\em drho\+\_\+ds} & The partial derivative of density with salinity, in \mbox{[}kg m-\/3 P\+S\+U-\/1\mbox{]}. \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}{0}
\DoxyCodeLine{235 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(in)}  :: T\textcolor{comment}{        !< Potential temperature relative to the surface [degC].}}
\DoxyCodeLine{236 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(in)}  :: S\textcolor{comment}{        !< Salinity [PSU].}}
\DoxyCodeLine{237 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(in)}  :: pressure\textcolor{comment}{ !< pressure [Pa].}}
\DoxyCodeLine{238 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(out)} :: drho\_dT\textcolor{comment}{  !< The partial derivative of density with potential}}
\DoxyCodeLine{239 \textcolor{comment}{                                   !! temperature [kg m-3 degC-1].}}
\DoxyCodeLine{240 \textcolor{keywordtype}{  real},    \textcolor{keywordtype}{intent(out)} :: drho\_dS\textcolor{comment}{  !< The partial derivative of density with salinity,}}
\DoxyCodeLine{241 \textcolor{comment}{                                   !! in [kg m-3 PSU-1].}}
\DoxyCodeLine{242 }
\DoxyCodeLine{243   \textcolor{comment}{! Local variables needed to promote the input/output scalars to 1-element arrays}}
\DoxyCodeLine{244 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(1)} :: T0, S0, P0}
\DoxyCodeLine{245 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(1)} :: drdt0, drds0}
\DoxyCodeLine{246 }
\DoxyCodeLine{247   t0(1) = t}
\DoxyCodeLine{248   s0(1) = s}
\DoxyCodeLine{249   p0(1) = pressure}
\DoxyCodeLine{250   \textcolor{keyword}{call }calculate\_density\_derivs\_array\_wright(t0, s0, p0, drdt0, drds0, 1, 1)}
\DoxyCodeLine{251   drho\_dt = drdt0(1)}
\DoxyCodeLine{252   drho\_ds = drds0(1)}
\DoxyCodeLine{253 }

\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\+\_\+\+Wright.\+F90\end{DoxyCompactItemize}
