\hypertarget{interfacemom__eos__unesco_1_1calculate__spec__vol__unesco}{}\doxysection{mom\+\_\+eos\+\_\+unesco\+::calculate\+\_\+spec\+\_\+vol\+\_\+unesco Interface Reference}
\label{interfacemom__eos__unesco_1_1calculate__spec__vol__unesco}\index{mom\_eos\_unesco::calculate\_spec\_vol\_unesco@{mom\_eos\_unesco::calculate\_spec\_vol\_unesco}}


\doxysubsection{Detailed Description}
Compute the in situ specific volume of sea water (in \mbox{[}m3 kg-\/1\mbox{]}), or an anomaly with respect to a reference specific volume, from salinity \mbox{[}P\+SU\mbox{]}, potential temperature \mbox{[}degC\mbox{]}, and pressure \mbox{[}Pa\mbox{]}, using the U\+N\+E\+S\+CO (1981) equation of state. 

Definition at line 29 of file M\+O\+M\+\_\+\+E\+O\+S\+\_\+\+U\+N\+E\+S\+C\+O.\+F90.

\doxysubsection*{Private functions}
\begin{DoxyCompactItemize}
\item 
subroutine \mbox{\hyperlink{interfacemom__eos__unesco_1_1calculate__spec__vol__unesco_aaabb09e61b69e2de31c2acc4878fe451}{calculate\+\_\+spec\+\_\+vol\+\_\+scalar\+\_\+unesco}} (T, S, pressure, specvol, spv\+\_\+ref)
\begin{DoxyCompactList}\small\item\em This subroutine computes the in situ specific volume of sea water (specvol in \mbox{[}m3 kg-\/1\mbox{]}) from salinity (S \mbox{[}P\+SU\mbox{]}), potential temperature (T \mbox{[}degC\mbox{]}) and pressure \mbox{[}Pa\mbox{]}, using the U\+N\+E\+S\+CO (1981) equation of state. If spv\+\_\+ref is present, specvol is an anomaly from spv\+\_\+ref. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{interfacemom__eos__unesco_1_1calculate__spec__vol__unesco_af1f0cc2a61bb5f17dbe20dcd36555abc}{calculate\+\_\+spec\+\_\+vol\+\_\+array\+\_\+unesco}} (T, S, pressure, specvol, start, npts, spv\+\_\+ref)
\begin{DoxyCompactList}\small\item\em This subroutine computes the in situ specific volume of sea water (specvol in \mbox{[}m3 kg-\/1\mbox{]}) from salinity (S \mbox{[}P\+SU\mbox{]}), potential temperature (T \mbox{[}degC\mbox{]}) and pressure \mbox{[}Pa\mbox{]}, using the U\+N\+E\+S\+CO (1981) equation of state. If spv\+\_\+ref is present, specvol is an anomaly from spv\+\_\+ref. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Compute the in situ specific volume of sea water (in \mbox{[}m3 kg-\/1\mbox{]}), or an anomaly with respect to a reference specific volume, from salinity \mbox{[}P\+SU\mbox{]}, potential temperature \mbox{[}degC\mbox{]}, and pressure \mbox{[}Pa\mbox{]}, using the U\+N\+E\+S\+CO (1981) equation of state. 

Definition at line 29 of file M\+O\+M\+\_\+\+E\+O\+S\+\_\+\+U\+N\+E\+S\+C\+O.\+F90.



\doxysubsection{Functions and subroutines}
\mbox{\Hypertarget{interfacemom__eos__unesco_1_1calculate__spec__vol__unesco_af1f0cc2a61bb5f17dbe20dcd36555abc}\label{interfacemom__eos__unesco_1_1calculate__spec__vol__unesco_af1f0cc2a61bb5f17dbe20dcd36555abc}} 
\index{mom\_eos\_unesco::calculate\_spec\_vol\_unesco@{mom\_eos\_unesco::calculate\_spec\_vol\_unesco}!calculate\_spec\_vol\_array\_unesco@{calculate\_spec\_vol\_array\_unesco}}
\index{calculate\_spec\_vol\_array\_unesco@{calculate\_spec\_vol\_array\_unesco}!mom\_eos\_unesco::calculate\_spec\_vol\_unesco@{mom\_eos\_unesco::calculate\_spec\_vol\_unesco}}
\doxysubsubsection{\texorpdfstring{calculate\_spec\_vol\_array\_unesco()}{calculate\_spec\_vol\_array\_unesco()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+\_\+unesco\+::calculate\+\_\+spec\+\_\+vol\+\_\+unesco\+::calculate\+\_\+spec\+\_\+vol\+\_\+array\+\_\+unesco (\begin{DoxyParamCaption}\item[{real, dimension(\+:), intent(in)}]{T,  }\item[{real, dimension(\+:), intent(in)}]{S,  }\item[{real, dimension(\+:), intent(in)}]{pressure,  }\item[{real, dimension(\+:), intent(out)}]{specvol,  }\item[{integer, intent(in)}]{start,  }\item[{integer, intent(in)}]{npts,  }\item[{real, intent(in), optional}]{spv\+\_\+ref }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine computes the in situ specific volume of sea water (specvol in \mbox{[}m3 kg-\/1\mbox{]}) from salinity (S \mbox{[}P\+SU\mbox{]}), potential temperature (T \mbox{[}degC\mbox{]}) and pressure \mbox{[}Pa\mbox{]}, using the U\+N\+E\+S\+CO (1981) equation of state. If spv\+\_\+ref is present, specvol is an anomaly from spv\+\_\+ref. 


\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 specvol} & in situ specific volume \mbox{[}m3 kg-\/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
\mbox{\texttt{ in}}  & {\em spv\+\_\+ref} & A reference specific volume \mbox{[}m3 kg-\/1\mbox{]}. \\
\hline
\end{DoxyParams}


Definition at line 159 of file M\+O\+M\+\_\+\+E\+O\+S\+\_\+\+U\+N\+E\+S\+C\+O.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{159 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: T\textcolor{comment}{        !< potential temperature relative to the surface}}
\DoxyCodeLine{160 \textcolor{comment}{                                              !! [degC].}}
\DoxyCodeLine{161 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: S\textcolor{comment}{        !< salinity [PSU].}}
\DoxyCodeLine{162 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}  :: pressure\textcolor{comment}{ !< pressure [Pa].}}
\DoxyCodeLine{163 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(out)} :: specvol\textcolor{comment}{  !< in situ specific volume [m3 kg-\/1].}}
\DoxyCodeLine{164   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}  :: start\textcolor{comment}{    !< the starting point in the arrays.}}
\DoxyCodeLine{165   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}  :: npts\textcolor{comment}{     !< the number of values to calculate.}}
\DoxyCodeLine{166 \textcolor{keywordtype}{  real},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: spv\_ref\textcolor{comment}{  !< A reference specific volume [m3 kg-\/1].}}
\DoxyCodeLine{167 }
\DoxyCodeLine{168   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{169 \textcolor{keywordtype}{  real} :: t\_local, t2, t3, t4, t5  \textcolor{comment}{! Temperature to the 1st -\/ 5th power [degC\string^n].}}
\DoxyCodeLine{170 \textcolor{keywordtype}{  real} :: s\_local, s32, s2         \textcolor{comment}{! Salinity to the 1st, 3/2, \& 2nd power [PSU\string^n].}}
\DoxyCodeLine{171 \textcolor{keywordtype}{  real} :: p1, p2       \textcolor{comment}{! Pressure (in bars) to the 1st and 2nd power [bar] and [bar2].}}
\DoxyCodeLine{172 \textcolor{keywordtype}{  real} :: rho0         \textcolor{comment}{! Density at 1 bar pressure [kg m-\/3].}}
\DoxyCodeLine{173 \textcolor{keywordtype}{  real} :: ks           \textcolor{comment}{! The secant bulk modulus [bar].}}
\DoxyCodeLine{174   \textcolor{keywordtype}{integer} :: j}
\DoxyCodeLine{175 }
\DoxyCodeLine{176   \textcolor{keywordflow}{do} j=start,start+npts-\/1}
\DoxyCodeLine{177     \textcolor{keywordflow}{if} (s(j) < -\/1.0e-\/10) \textcolor{keywordflow}{then} \textcolor{comment}{!Can we assume safely that this is a missing value?}}
\DoxyCodeLine{178       specvol(j) = 0.001}
\DoxyCodeLine{179       \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(spv\_ref)) specvol(j) = 0.001 -\/ spv\_ref}
\DoxyCodeLine{180       cycle}
\DoxyCodeLine{181 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{182 }
\DoxyCodeLine{183     p1 = pressure(j)*1.0e-\/5; p2 = p1*p1}
\DoxyCodeLine{184     t\_local = t(j); t2 = t\_local*t\_local; t3 = t\_local*t2; t4 = t2*t2; t5 = t3*t2}
\DoxyCodeLine{185     s\_local = s(j); s2 = s\_local*s\_local; s32 = s\_local*sqrt(s\_local)}
\DoxyCodeLine{186 }
\DoxyCodeLine{187 \textcolor{comment}{!  Compute rho(s,theta,p=0) -\/ (same as rho(s,t\_insitu,p=0) ).}}
\DoxyCodeLine{188 }
\DoxyCodeLine{189     rho0 = r00 + r10*t\_local + r20*t2 + r30*t3 + r40*t4 + r50*t5 + \&}
\DoxyCodeLine{190            s\_local*(r01 + r11*t\_local + r21*t2 + r31*t3 + r41*t4) + \&}
\DoxyCodeLine{191            s32*(r032 + r132*t\_local + r232*t2) + r02*s2}
\DoxyCodeLine{192 }
\DoxyCodeLine{193 \textcolor{comment}{!  Compute rho(s,theta,p), first calculating the secant bulk modulus.}}
\DoxyCodeLine{194 }
\DoxyCodeLine{195     ks = s00 + s10*t\_local + s20*t2 + s30*t3 + s40*t4 + s\_local*(s01 + s11*t\_local + s21*t2 + s31*t3) + \&}
\DoxyCodeLine{196          s32*(s032 + s132*t\_local + s232*t2) + \&}
\DoxyCodeLine{197          p1*(sp00 + sp10*t\_local + sp20*t2 + sp30*t3 + \&}
\DoxyCodeLine{198              s\_local*(sp01 + sp11*t\_local + sp21*t2) + sp032*s32) + \&}
\DoxyCodeLine{199          p2*(sp000 + sp010*t\_local + sp020*t2 + s\_local*(sp001 + sp011*t\_local + sp021*t2))}
\DoxyCodeLine{200 }
\DoxyCodeLine{201     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(spv\_ref)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{202       specvol(j) = (ks*(1.0 -\/ (rho0*spv\_ref)) -\/ p1) / (rho0*ks)}
\DoxyCodeLine{203     \textcolor{keywordflow}{else}}
\DoxyCodeLine{204       specvol(j) = (ks -\/ p1) / (rho0*ks)}
\DoxyCodeLine{205 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{206 \textcolor{keywordflow}{  enddo}}

\end{DoxyCode}
\mbox{\Hypertarget{interfacemom__eos__unesco_1_1calculate__spec__vol__unesco_aaabb09e61b69e2de31c2acc4878fe451}\label{interfacemom__eos__unesco_1_1calculate__spec__vol__unesco_aaabb09e61b69e2de31c2acc4878fe451}} 
\index{mom\_eos\_unesco::calculate\_spec\_vol\_unesco@{mom\_eos\_unesco::calculate\_spec\_vol\_unesco}!calculate\_spec\_vol\_scalar\_unesco@{calculate\_spec\_vol\_scalar\_unesco}}
\index{calculate\_spec\_vol\_scalar\_unesco@{calculate\_spec\_vol\_scalar\_unesco}!mom\_eos\_unesco::calculate\_spec\_vol\_unesco@{mom\_eos\_unesco::calculate\_spec\_vol\_unesco}}
\doxysubsubsection{\texorpdfstring{calculate\_spec\_vol\_scalar\_unesco()}{calculate\_spec\_vol\_scalar\_unesco()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+\_\+unesco\+::calculate\+\_\+spec\+\_\+vol\+\_\+unesco\+::calculate\+\_\+spec\+\_\+vol\+\_\+scalar\+\_\+unesco (\begin{DoxyParamCaption}\item[{real, intent(in)}]{T,  }\item[{real, intent(in)}]{S,  }\item[{real, intent(in)}]{pressure,  }\item[{real, intent(out)}]{specvol,  }\item[{real, intent(in), optional}]{spv\+\_\+ref }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine computes the in situ specific volume of sea water (specvol in \mbox{[}m3 kg-\/1\mbox{]}) from salinity (S \mbox{[}P\+SU\mbox{]}), potential temperature (T \mbox{[}degC\mbox{]}) and pressure \mbox{[}Pa\mbox{]}, using the U\+N\+E\+S\+CO (1981) equation of state. If spv\+\_\+ref is present, specvol is an anomaly from spv\+\_\+ref. 


\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 specvol} & in situ specific volume \mbox{[}m3 kg-\/1\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em spv\+\_\+ref} & A reference specific volume \mbox{[}m3 kg-\/1\mbox{]}. \\
\hline
\end{DoxyParams}


Definition at line 138 of file M\+O\+M\+\_\+\+E\+O\+S\+\_\+\+U\+N\+E\+S\+C\+O.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{138 \textcolor{keywordtype}{  real},           \textcolor{keywordtype}{intent(in)}  :: T\textcolor{comment}{        !< potential temperature relative to the surface}}
\DoxyCodeLine{139 \textcolor{comment}{                                          !! [degC].}}
\DoxyCodeLine{140 \textcolor{keywordtype}{  real},           \textcolor{keywordtype}{intent(in)}  :: S\textcolor{comment}{        !< salinity [PSU].}}
\DoxyCodeLine{141 \textcolor{keywordtype}{  real},           \textcolor{keywordtype}{intent(in)}  :: pressure\textcolor{comment}{ !< pressure [Pa].}}
\DoxyCodeLine{142 \textcolor{keywordtype}{  real},           \textcolor{keywordtype}{intent(out)} :: specvol\textcolor{comment}{  !< in situ specific volume [m3 kg-\/1].}}
\DoxyCodeLine{143 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: spv\_ref\textcolor{comment}{  !< A reference specific volume [m3 kg-\/1].}}
\DoxyCodeLine{144 }
\DoxyCodeLine{145   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{146 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(1)} :: T0, S0, pressure0, spv0}
\DoxyCodeLine{147 }
\DoxyCodeLine{148   t0(1) = t ; s0(1) = s ; pressure0(1) = pressure}
\DoxyCodeLine{149 }
\DoxyCodeLine{150   \textcolor{keyword}{call }calculate\_spec\_vol\_array\_unesco(t0, s0, pressure0, spv0, 1, 1, spv\_ref)}
\DoxyCodeLine{151   specvol = spv0(1)}

\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\+\_\+\+U\+N\+E\+S\+C\+O.\+F90\end{DoxyCompactItemize}
