\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 \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 \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{\tt in}  & {\em t} & Potential temperature relative to the surface \mbox{[}degC\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em s} & Salinity \mbox{[}P\+SU\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em pressure} & pressure \mbox{[}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{]}.\\
\hline
\mbox{\tt in,out}  & {\em drho\+\_\+ds} & The partial derivative of density with salinity, in \mbox{[}kg m-\/3 P\+S\+U-\/1\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em start} & The starting point in the arrays.\\
\hline
\mbox{\tt 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}
200   \textcolor{keywordtype}{real},    \textcolor{keywordtype}{intent(in)},    \textcolor{keywordtype}{dimension(:)} :: t\textcolor{comment}{        !< Potential temperature relative to the}
201 \textcolor{comment}{                                                   !! surface [degC].}
202   \textcolor{keywordtype}{real},    \textcolor{keywordtype}{intent(in)},    \textcolor{keywordtype}{dimension(:)} :: s\textcolor{comment}{        !< Salinity [PSU].}
203   \textcolor{keywordtype}{real},    \textcolor{keywordtype}{intent(in)},    \textcolor{keywordtype}{dimension(:)} :: pressure\textcolor{comment}{ !< pressure [Pa].}
204   \textcolor{keywordtype}{real},    \textcolor{keywordtype}{intent(inout)}, \textcolor{keywordtype}{dimension(:)} :: drho\_dt\textcolor{comment}{  !< The partial derivative of density with potential}
205 \textcolor{comment}{                                                   !! temperature [kg m-3 degC-1].}
206   \textcolor{keywordtype}{real},    \textcolor{keywordtype}{intent(inout)}, \textcolor{keywordtype}{dimension(:)} :: drho\_ds\textcolor{comment}{  !< The partial derivative of density with salinity,}
207 \textcolor{comment}{                                                   !! in [kg m-3 PSU-1].}
208   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}                  :: start\textcolor{comment}{    !< The starting point in the arrays.}
209   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}                  :: npts\textcolor{comment}{     !< The number of values to calculate.}
210 
211   \textcolor{comment}{! Local variables}
212   \textcolor{keywordtype}{real} :: al0, p0, lambda, i\_denom2
213   \textcolor{keywordtype}{integer} :: j
214 
215   \textcolor{keywordflow}{do} j=start,start+npts-1
216     al0 = (a0 + a1*t(j)) + a2*s(j)
217     p0 = (b0 + b4*s(j)) + t(j) * (b1 + t(j)*((b2 + b3*t(j))) + b5*s(j))
218     lambda = (c0 +c4*s(j)) + t(j) * (c1 + t(j)*((c2 + c3*t(j))) + c5*s(j))
219 
220     i\_denom2 = 1.0 / (lambda + al0*(pressure(j) + p0))
221     i\_denom2 = i\_denom2 *i\_denom2
222     drho\_dt(j) = i\_denom2 * &
223       (lambda* (b1 + t(j)*(2.0*b2 + 3.0*b3*t(j)) + b5*s(j)) - &
224        (pressure(j)+p0) * ( (pressure(j)+p0)*a1 + &
225         (c1 + t(j)*(c2*2.0 + c3*3.0*t(j)) + c5*s(j)) ))
226     drho\_ds(j) = i\_denom2 * (lambda* (b4 + b5*t(j)) - &
227       (pressure(j)+p0) * ( (pressure(j)+p0)*a2 + (c4 + c5*t(j)) ))
228 \textcolor{keywordflow}{  enddo}
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{\tt in}  & {\em t} & Potential temperature relative to the surface \mbox{[}degC\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em s} & Salinity \mbox{[}P\+SU\mbox{]}.\\
\hline
\mbox{\tt in}  & {\em pressure} & pressure \mbox{[}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{]}.\\
\hline
\mbox{\tt 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}
235   \textcolor{keywordtype}{real},    \textcolor{keywordtype}{intent(in)}  :: t\textcolor{comment}{        !< Potential temperature relative to the surface [degC].}
236   \textcolor{keywordtype}{real},    \textcolor{keywordtype}{intent(in)}  :: s\textcolor{comment}{        !< Salinity [PSU].}
237   \textcolor{keywordtype}{real},    \textcolor{keywordtype}{intent(in)}  :: pressure\textcolor{comment}{ !< pressure [Pa].}
238   \textcolor{keywordtype}{real},    \textcolor{keywordtype}{intent(out)} :: drho\_dt\textcolor{comment}{  !< The partial derivative of density with potential}
239 \textcolor{comment}{                                   !! temperature [kg m-3 degC-1].}
240   \textcolor{keywordtype}{real},    \textcolor{keywordtype}{intent(out)} :: drho\_ds\textcolor{comment}{  !< The partial derivative of density with salinity,}
241 \textcolor{comment}{                                   !! in [kg m-3 PSU-1].}
242 
243   \textcolor{comment}{! Local variables needed to promote the input/output scalars to 1-element arrays}
244   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(1)} :: t0, s0, p0
245   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(1)} :: drdt0, drds0
246 
247   t0(1) = t
248   s0(1) = s
249   p0(1) = pressure
250   \textcolor{keyword}{call }calculate\_density\_derivs\_array\_wright(t0, s0, p0, drdt0, drds0, 1, 1)
251   drho\_dt = drdt0(1)
252   drho\_ds = drds0(1)
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}
