\hypertarget{interfacemom__eos_1_1calculate__tfreeze}{}\section{mom\+\_\+eos\+:\+:calculate\+\_\+tfreeze Interface Reference}
\label{interfacemom__eos_1_1calculate__tfreeze}\index{mom\+\_\+eos\+::calculate\+\_\+tfreeze@{mom\+\_\+eos\+::calculate\+\_\+tfreeze}}


\subsection{Detailed Description}
Calculates the freezing point of sea water from T, S and P. 

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

\subsection*{Private functions}
\begin{DoxyCompactItemize}
\item 
subroutine \mbox{\hyperlink{interfacemom__eos_1_1calculate__tfreeze_a22160f1c3ed306f7cf2d1fd097f5041b}{calculate\+\_\+tfreeze\+\_\+scalar}} (S, pressure, T\+\_\+fr, E\+OS, pres\+\_\+scale)
\begin{DoxyCompactList}\small\item\em Calls the appropriate subroutine to calculate the freezing point for scalar inputs. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{interfacemom__eos_1_1calculate__tfreeze_afed01373d8771af8e079d7dca9d8c4ba}{calculate\+\_\+tfreeze\+\_\+array}} (S, pressure, T\+\_\+fr, start, npts, E\+OS, pres\+\_\+scale)
\begin{DoxyCompactList}\small\item\em Calls the appropriate subroutine to calculate the freezing point for a 1-\/D array. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Calculates the freezing point of sea water from T, S and P. 

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



\subsection{Functions and subroutines}
\mbox{\Hypertarget{interfacemom__eos_1_1calculate__tfreeze_afed01373d8771af8e079d7dca9d8c4ba}\label{interfacemom__eos_1_1calculate__tfreeze_afed01373d8771af8e079d7dca9d8c4ba}} 
\index{mom\+\_\+eos\+::calculate\+\_\+tfreeze@{mom\+\_\+eos\+::calculate\+\_\+tfreeze}!calculate\+\_\+tfreeze\+\_\+array@{calculate\+\_\+tfreeze\+\_\+array}}
\index{calculate\+\_\+tfreeze\+\_\+array@{calculate\+\_\+tfreeze\+\_\+array}!mom\+\_\+eos\+::calculate\+\_\+tfreeze@{mom\+\_\+eos\+::calculate\+\_\+tfreeze}}
\subsubsection{\texorpdfstring{calculate\+\_\+tfreeze\+\_\+array()}{calculate\_tfreeze\_array()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+::calculate\+\_\+tfreeze\+::calculate\+\_\+tfreeze\+\_\+array (\begin{DoxyParamCaption}\item[{real, dimension(\+:), intent(in)}]{S,  }\item[{real, dimension(\+:), intent(in)}]{pressure,  }\item[{real, dimension(\+:), intent(inout)}]{T\+\_\+fr,  }\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}]{pres\+\_\+scale }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Calls the appropriate subroutine to calculate the freezing point for a 1-\/D array. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em s} & Salinity \mbox{[}ppt\mbox{]}\\
\hline
\mbox{\tt in}  & {\em pressure} & Pressure \mbox{[}Pa\mbox{]} or \mbox{[}other\mbox{]}\\
\hline
\mbox{\tt in,out}  & {\em t\+\_\+fr} & Freezing point potential temperature referenced to the surface \mbox{[}degC\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 pres\+\_\+scale} & A multiplicative factor to convert pressure into Pa. \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}
656   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}    :: S\textcolor{comment}{        !< Salinity [ppt]}
657   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)}    :: pressure\textcolor{comment}{ !< Pressure [Pa] or [other]}
658   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: T\_fr\textcolor{comment}{     !< Freezing point potential temperature referenced}
659 \textcolor{comment}{                                                !! to the surface [degC]}
660   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}    :: start\textcolor{comment}{    !< Starting index within the array}
661   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)}    :: npts\textcolor{comment}{     !< The number of values to calculate}
662   \textcolor{keywordtype}{type}(EOS\_type),     \textcolor{keywordtype}{pointer}       :: EOS\textcolor{comment}{      !< Equation of state structure}
663   \textcolor{keywordtype}{real},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: pres\_scale\textcolor{comment}{ !< A multiplicative factor to convert pressure into Pa.}
664 
665   \textcolor{comment}{! Local variables}
666   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(size(pressure))} :: pres  \textcolor{comment}{! Pressure converted to [Pa]}
667   \textcolor{keywordtype}{real} :: p\_scale \textcolor{comment}{! A factor to convert pressure to units of Pa.}
668   \textcolor{keywordtype}{integer} :: j
669 
670   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(eos)) \textcolor{keyword}{call }mom\_error(fatal, &
671     \textcolor{stringliteral}{"calculate\_TFreeze\_scalar called with an unassociated EOS\_type EOS."})
672 
673   p\_scale = 1.0 ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(pres\_scale)) p\_scale = pres\_scale
674 
675   \textcolor{keywordflow}{if} (p\_scale == 1.0) \textcolor{keywordflow}{then}
676     \textcolor{keywordflow}{select case} (eos%form\_of\_TFreeze)
677       \textcolor{keywordflow}{case} (tfreeze\_linear)
678         \textcolor{keyword}{call }calculate\_tfreeze\_linear(s, pressure, t\_fr, start, npts, &
679                                       eos%TFr\_S0\_P0, eos%dTFr\_dS, eos%dTFr\_dp)
680       \textcolor{keywordflow}{case} (tfreeze\_millero)
681         \textcolor{keyword}{call }calculate\_tfreeze\_millero(s, pressure, t\_fr, start, npts)
682       \textcolor{keywordflow}{case} (tfreeze\_teos10)
683         \textcolor{keyword}{call }calculate\_tfreeze\_teos10(s, pressure, t\_fr, start, npts)
684 \textcolor{keywordflow}{      case default}
685         \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"calculate\_TFreeze\_scalar: form\_of\_TFreeze is not valid."})
686 \textcolor{keywordflow}{    end select}
687   \textcolor{keywordflow}{else}
688     \textcolor{keywordflow}{do} j=start,start+npts-1 ; pres(j) = p\_scale * pressure(j) ;\textcolor{keywordflow}{ enddo}
689     \textcolor{keywordflow}{select case} (eos%form\_of\_TFreeze)
690       \textcolor{keywordflow}{case} (tfreeze\_linear)
691         \textcolor{keyword}{call }calculate\_tfreeze\_linear(s, pres, t\_fr, start, npts, &
692                                       eos%TFr\_S0\_P0, eos%dTFr\_dS, eos%dTFr\_dp)
693       \textcolor{keywordflow}{case} (tfreeze\_millero)
694         \textcolor{keyword}{call }calculate\_tfreeze\_millero(s, pres, t\_fr, start, npts)
695       \textcolor{keywordflow}{case} (tfreeze\_teos10)
696         \textcolor{keyword}{call }calculate\_tfreeze\_teos10(s, pres, t\_fr, start, npts)
697 \textcolor{keywordflow}{      case default}
698         \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"calculate\_TFreeze\_scalar: form\_of\_TFreeze is not valid."})
699 \textcolor{keywordflow}{    end select}
700 \textcolor{keywordflow}{  endif}
701 
\end{DoxyCode}
\mbox{\Hypertarget{interfacemom__eos_1_1calculate__tfreeze_a22160f1c3ed306f7cf2d1fd097f5041b}\label{interfacemom__eos_1_1calculate__tfreeze_a22160f1c3ed306f7cf2d1fd097f5041b}} 
\index{mom\+\_\+eos\+::calculate\+\_\+tfreeze@{mom\+\_\+eos\+::calculate\+\_\+tfreeze}!calculate\+\_\+tfreeze\+\_\+scalar@{calculate\+\_\+tfreeze\+\_\+scalar}}
\index{calculate\+\_\+tfreeze\+\_\+scalar@{calculate\+\_\+tfreeze\+\_\+scalar}!mom\+\_\+eos\+::calculate\+\_\+tfreeze@{mom\+\_\+eos\+::calculate\+\_\+tfreeze}}
\subsubsection{\texorpdfstring{calculate\+\_\+tfreeze\+\_\+scalar()}{calculate\_tfreeze\_scalar()}}
{\footnotesize\ttfamily subroutine mom\+\_\+eos\+::calculate\+\_\+tfreeze\+::calculate\+\_\+tfreeze\+\_\+scalar (\begin{DoxyParamCaption}\item[{real, intent(in)}]{S,  }\item[{real, intent(in)}]{pressure,  }\item[{real, intent(out)}]{T\+\_\+fr,  }\item[{type(\mbox{\hyperlink{structmom__eos_1_1eos__type}{eos\+\_\+type}}), pointer}]{E\+OS,  }\item[{real, intent(in), optional}]{pres\+\_\+scale }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Calls the appropriate subroutine to calculate the freezing point for scalar inputs. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em s} & Salinity \mbox{[}ppt\mbox{]}\\
\hline
\mbox{\tt in}  & {\em pressure} & Pressure \mbox{[}Pa\mbox{]} or \mbox{[}other\mbox{]}\\
\hline
\mbox{\tt out}  & {\em t\+\_\+fr} & Freezing point potential temperature referenced to the surface \mbox{[}degC\mbox{]}\\
\hline
 & {\em eos} & Equation of state structure\\
\hline
\mbox{\tt in}  & {\em pres\+\_\+scale} & A multiplicative factor to convert pressure into Pa \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}
625   \textcolor{keywordtype}{real},           \textcolor{keywordtype}{intent(in)}  :: S\textcolor{comment}{ !< Salinity [ppt]}
626   \textcolor{keywordtype}{real},           \textcolor{keywordtype}{intent(in)}  :: pressure\textcolor{comment}{ !< Pressure [Pa] or [other]}
627   \textcolor{keywordtype}{real},           \textcolor{keywordtype}{intent(out)} :: T\_fr\textcolor{comment}{ !< Freezing point potential temperature referenced}
628 \textcolor{comment}{                                      !! to the surface [degC]}
629   \textcolor{keywordtype}{type}(EOS\_type), \textcolor{keywordtype}{pointer}     :: EOS\textcolor{comment}{ !< Equation of state structure}
630   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: pres\_scale\textcolor{comment}{ !< A multiplicative factor to convert pressure into Pa}
631 
632   \textcolor{comment}{! Local variables}
633   \textcolor{keywordtype}{real} :: p\_scale \textcolor{comment}{! A factor to convert pressure to units of Pa.}
634 
635   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(eos)) \textcolor{keyword}{call }mom\_error(fatal, &
636     \textcolor{stringliteral}{"calculate\_TFreeze\_scalar called with an unassociated EOS\_type EOS."})
637 
638   p\_scale = 1.0 ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(pres\_scale)) p\_scale = pres\_scale
639 
640   \textcolor{keywordflow}{select case} (eos%form\_of\_TFreeze)
641     \textcolor{keywordflow}{case} (tfreeze\_linear)
642       \textcolor{keyword}{call }calculate\_tfreeze\_linear(s, p\_scale*pressure, t\_fr, eos%TFr\_S0\_P0, &
643                                     eos%dTFr\_dS, eos%dTFr\_dp)
644     \textcolor{keywordflow}{case} (tfreeze\_millero)
645       \textcolor{keyword}{call }calculate\_tfreeze\_millero(s, p\_scale*pressure, t\_fr)
646     \textcolor{keywordflow}{case} (tfreeze\_teos10)
647       \textcolor{keyword}{call }calculate\_tfreeze\_teos10(s, p\_scale*pressure, t\_fr)
648 \textcolor{keywordflow}{    case default}
649       \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"calculate\_TFreeze\_scalar: form\_of\_TFreeze is not valid."})
650 \textcolor{keywordflow}{  end select}
651 
\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}
