\hypertarget{namespacemom__continuity}{}\section{mom\+\_\+continuity Module Reference}
\label{namespacemom__continuity}\index{mom\_continuity@{mom\_continuity}}


\subsection{Detailed Description}
Solve the layer continuity equation. \subsection*{Data Types}
\begin{DoxyCompactItemize}
\item 
type \mbox{\hyperlink{structmom__continuity_1_1continuity__cs}{continuity\+\_\+cs}}
\begin{DoxyCompactList}\small\item\em Control structure for \mbox{\hyperlink{namespacemom__continuity}{mom\+\_\+continuity}}. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \mbox{\hyperlink{namespacemom__continuity_af5199f6dd73755cc33c133723339a0ff}{continuity}} (u, v, hin, h, uh, vh, dt, G, GV, US, CS, uhbt, vhbt, O\+BC, visc\+\_\+rem\+\_\+u, visc\+\_\+rem\+\_\+v, u\+\_\+cor, v\+\_\+cor, B\+T\+\_\+cont)
\begin{DoxyCompactList}\small\item\em Time steps the layer thicknesses, using a monotonically limited, directionally split P\+PM scheme, based on Lin (1994). \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__continuity_a458ebf2ce1b5dede05607b2d644dcfad}{continuity\+\_\+init}} (Time, G, GV, US, param\+\_\+file, diag, CS)
\begin{DoxyCompactList}\small\item\em Initializes \mbox{\hyperlink{structmom__continuity_1_1continuity__cs}{continuity\+\_\+cs}}. \end{DoxyCompactList}\item 
integer function, public \mbox{\hyperlink{namespacemom__continuity_afb0ed16b38c098805a3a9caf4b60ceff}{continuity\+\_\+stencil}} (CS)
\begin{DoxyCompactList}\small\item\em continuity\+\_\+stencil returns the continuity solver stencil size \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__continuity_aa91ed69484f54d0bba361bfe60d89d60}{continuity\+\_\+end}} (CS)
\begin{DoxyCompactList}\small\item\em Destructor for \mbox{\hyperlink{structmom__continuity_1_1continuity__cs}{continuity\+\_\+cs}}. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{namespacemom__continuity_a89cc7674e8c8f8f248a02eca930c4ec8}\label{namespacemom__continuity_a89cc7674e8c8f8f248a02eca930c4ec8}} 
integer, parameter \mbox{\hyperlink{namespacemom__continuity_a89cc7674e8c8f8f248a02eca930c4ec8}{ppm\+\_\+scheme}} = 1
\begin{DoxyCompactList}\small\item\em Enumerated constant to select P\+PM. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__continuity_aa812945b4fe598341c19e296ec4a89ef}\label{namespacemom__continuity_aa812945b4fe598341c19e296ec4a89ef}} 
character(len=20), parameter \mbox{\hyperlink{namespacemom__continuity_aa812945b4fe598341c19e296ec4a89ef}{ppm\+\_\+string}} = \char`\"{}P\+PM\char`\"{}
\begin{DoxyCompactList}\small\item\em String to select P\+PM. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacemom__continuity_af5199f6dd73755cc33c133723339a0ff}\label{namespacemom__continuity_af5199f6dd73755cc33c133723339a0ff}} 
\index{mom\_continuity@{mom\_continuity}!continuity@{continuity}}
\index{continuity@{continuity}!mom\_continuity@{mom\_continuity}}
\subsubsection{\texorpdfstring{continuity()}{continuity()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+continuity\+::continuity (\begin{DoxyParamCaption}\item[{real, dimension( g \%isdb\+: g \%iedb, g \%jsd\+: g \%jed, g \%ke), intent(in)}]{u,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsdb\+: g \%jedb, g \%ke), intent(in)}]{v,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed, g \%ke), intent(in)}]{hin,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsd\+: g \%jed, g \%ke), intent(inout)}]{h,  }\item[{real, dimension( g \%isdb\+: g \%iedb, g \%jsd\+: g \%jed, g \%ke), intent(out)}]{uh,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsdb\+: g \%jedb, g \%ke), intent(out)}]{vh,  }\item[{real, intent(in)}]{dt,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(inout)}]{G,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US,  }\item[{type(\mbox{\hyperlink{structmom__continuity_1_1continuity__cs}{continuity\+\_\+cs}}), pointer}]{CS,  }\item[{real, dimension( g \%isdb\+: g \%iedb, g \%jsd\+: g \%jed), intent(in), optional}]{uhbt,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsdb\+: g \%jedb), intent(in), optional}]{vhbt,  }\item[{type(ocean\+\_\+obc\+\_\+type), optional, pointer}]{O\+BC,  }\item[{real, dimension( g \%isdb\+: g \%iedb, g \%jsd\+: g \%jed, g \%ke), intent(in), optional}]{visc\+\_\+rem\+\_\+u,  }\item[{real, dimension(szi\+\_\+(g),szjb\+\_\+(g),szk\+\_\+(g)), intent(in), optional}]{visc\+\_\+rem\+\_\+v,  }\item[{real, dimension( g \%isdb\+: g \%iedb, g \%jsd\+: g \%jed, g \%ke), intent(out), optional}]{u\+\_\+cor,  }\item[{real, dimension( g \%isd\+: g \%ied, g \%jsdb\+: g \%jedb, g \%ke), intent(out), optional}]{v\+\_\+cor,  }\item[{type(bt\+\_\+cont\+\_\+type), optional, pointer}]{B\+T\+\_\+cont }\end{DoxyParamCaption})}



Time steps the layer thicknesses, using a monotonically limited, directionally split P\+PM scheme, based on Lin (1994). 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em g} & Ocean grid structure. \\
\hline
\mbox{\texttt{ in}}  & {\em gv} & Vertical grid structure. \\
\hline
\mbox{\texttt{ in}}  & {\em u} & Zonal velocity \mbox{[}L T-\/1 $\sim$$>$ m s-\/1\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em v} & Meridional velocity \mbox{[}L T-\/1 $\sim$$>$ m s-\/1\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em hin} & Initial layer thickness \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}. \\
\hline
\mbox{\texttt{ in,out}}  & {\em h} & Final layer thickness \mbox{[}H $\sim$$>$ m or kg m-\/2\mbox{]}. \\
\hline
\mbox{\texttt{ out}}  & {\em uh} & Volume flux through zonal faces = \\
\hline
\mbox{\texttt{ out}}  & {\em vh} & Volume flux through meridional faces = \\
\hline
\mbox{\texttt{ in}}  & {\em dt} & Time increment \mbox{[}T $\sim$$>$ s\mbox{]}. \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type \\
\hline
 & {\em cs} & Control structure for \mbox{\hyperlink{namespacemom__continuity}{mom\+\_\+continuity}}. \\
\hline
\mbox{\texttt{ in}}  & {\em uhbt} & The vertically summed volume \\
\hline
\mbox{\texttt{ in}}  & {\em vhbt} & The vertically summed volume \\
\hline
 & {\em obc} & Open boundaries control structure. \\
\hline
\mbox{\texttt{ in}}  & {\em visc\+\_\+rem\+\_\+u} & Both the fraction of \\
\hline
\mbox{\texttt{ in}}  & {\em visc\+\_\+rem\+\_\+v} & Both the fraction of \\
\hline
\mbox{\texttt{ out}}  & {\em u\+\_\+cor} & The zonal velocities that \\
\hline
\mbox{\texttt{ out}}  & {\em v\+\_\+cor} & The meridional velocities that \\
\hline
 & {\em bt\+\_\+cont} & A structure with elements \\
\hline
\end{DoxyParams}


Definition at line 44 of file M\+O\+M\+\_\+continuity.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{44   \textcolor{keywordtype}{type}(ocean\_grid\_type),   \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{   !< Ocean grid structure.}}
\DoxyCodeLine{45   \textcolor{keywordtype}{type}(verticalGrid\_type), \textcolor{keywordtype}{intent(in)}    :: GV\textcolor{comment}{  !< Vertical grid structure.}}
\DoxyCodeLine{46 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZIB\_(G),SZJ\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{47                            \textcolor{keywordtype}{intent(in)}    :: u\textcolor{comment}{   !< Zonal velocity [L T-1 ~> m s-1].}}
\DoxyCodeLine{48 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJB\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{49                            \textcolor{keywordtype}{intent(in)}    :: v\textcolor{comment}{   !< Meridional velocity [L T-1 ~> m s-1].}}
\DoxyCodeLine{50 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))},  \&}
\DoxyCodeLine{51                            \textcolor{keywordtype}{intent(in)}    :: hin\textcolor{comment}{ !< Initial layer thickness [H ~> m or kg m-2].}}
\DoxyCodeLine{52 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJ\_(G),SZK\_(G))},  \&}
\DoxyCodeLine{53                            \textcolor{keywordtype}{intent(inout)} :: h\textcolor{comment}{   !< Final layer thickness [H ~> m or kg m-2].}}
\DoxyCodeLine{54 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZIB\_(G),SZJ\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{55                            \textcolor{keywordtype}{intent(out)}   :: uh\textcolor{comment}{  !< Volume flux through zonal faces =}}
\DoxyCodeLine{56 \textcolor{comment}{                                                !! u*h*dy [H L2 T-1 ~> m3 s-1 or kg s-1].}}
\DoxyCodeLine{57 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJB\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{58                            \textcolor{keywordtype}{intent(out)}   :: vh\textcolor{comment}{  !< Volume flux through meridional faces =}}
\DoxyCodeLine{59 \textcolor{comment}{                                                !! v*h*dx [H L2 T-1 ~> m3 s-1 or kg s-1].}}
\DoxyCodeLine{60 \textcolor{keywordtype}{  real},                    \textcolor{keywordtype}{intent(in)}    :: dt\textcolor{comment}{  !< Time increment [T ~> s].}}
\DoxyCodeLine{61   \textcolor{keywordtype}{type}(unit\_scale\_type),   \textcolor{keywordtype}{intent(in)}    :: US\textcolor{comment}{  !< A dimensional unit scaling type}}
\DoxyCodeLine{62   \textcolor{keywordtype}{type}(continuity\_CS),     \textcolor{keywordtype}{pointer}       :: CS\textcolor{comment}{  !< Control structure for mom\_continuity.}}
\DoxyCodeLine{63 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZIB\_(G),SZJ\_(G))}, \&}
\DoxyCodeLine{64                  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: uhbt\textcolor{comment}{ !< The vertically summed volume}}
\DoxyCodeLine{65 \textcolor{comment}{                                                !! flux through zonal faces [H L2 T-1 ~> m3 s-1 or kg s-1].}}
\DoxyCodeLine{66 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJB\_(G))}, \&}
\DoxyCodeLine{67                  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: vhbt\textcolor{comment}{ !< The vertically summed volume}}
\DoxyCodeLine{68 \textcolor{comment}{                                                !! flux through meridional faces [H L2 T-1 ~> m3 s-1 or kg s-1].}}
\DoxyCodeLine{69   \textcolor{keywordtype}{type}(ocean\_OBC\_type), \&}
\DoxyCodeLine{70                  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{pointer}       :: OBC\textcolor{comment}{ !< Open boundaries control structure.}}
\DoxyCodeLine{71 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZIB\_(G),SZJ\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{72                  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: visc\_rem\_u\textcolor{comment}{ !< Both the fraction of}}
\DoxyCodeLine{73 \textcolor{comment}{          !! zonal momentum that remains after a time-step of viscosity, and the fraction of a time-step's}}
\DoxyCodeLine{74 \textcolor{comment}{          !! worth of a barotropic acceleration that a layer experiences after viscosity is applied.}}
\DoxyCodeLine{75 \textcolor{comment}{          !! Non-dimensional between 0 (at the bottom) and 1 (far above the bottom).}}
\DoxyCodeLine{76 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJB\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{77                  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: visc\_rem\_v\textcolor{comment}{ !< Both the fraction of}}
\DoxyCodeLine{78 \textcolor{comment}{          !! meridional momentum that remains after a time-step of viscosity, and the fraction of a time-step's}}
\DoxyCodeLine{79 \textcolor{comment}{          !! worth of a barotropic acceleration that a layer experiences after viscosity is applied.}}
\DoxyCodeLine{80 \textcolor{comment}{          !! Non-dimensional between 0 (at the bottom) and 1 (far above the bottom).}}
\DoxyCodeLine{81 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZIB\_(G),SZJ\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{82                  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)}   :: u\_cor\textcolor{comment}{ !< The zonal velocities that}}
\DoxyCodeLine{83 \textcolor{comment}{          !! give uhbt as the depth-integrated transport [L T-1 ~> m s-1].}}
\DoxyCodeLine{84 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(SZI\_(G),SZJB\_(G),SZK\_(G))}, \&}
\DoxyCodeLine{85                  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)}   :: v\_cor\textcolor{comment}{ !< The meridional velocities that}}
\DoxyCodeLine{86 \textcolor{comment}{          !! give vhbt as the depth-integrated transport [L T-1 ~> m s-1].}}
\DoxyCodeLine{87   \textcolor{keywordtype}{type}(BT\_cont\_type), \&}
\DoxyCodeLine{88                  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{pointer}       :: BT\_cont\textcolor{comment}{ !< A structure with elements}}
\DoxyCodeLine{89 \textcolor{comment}{          !! that describe the effective open face areas as a function of barotropic flow.}}
\DoxyCodeLine{90 }
\DoxyCodeLine{91   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(visc\_rem\_u) .neqv. \textcolor{keyword}{present}(visc\_rem\_v)) \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{92       \textcolor{stringliteral}{"MOM\_continuity: Either both visc\_rem\_u and visc\_rem\_v or neither"}// \&}
\DoxyCodeLine{93        \textcolor{stringliteral}{" one must be present in call to continuity."})}
\DoxyCodeLine{94   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(u\_cor) .neqv. \textcolor{keyword}{present}(v\_cor)) \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{95       \textcolor{stringliteral}{"MOM\_continuity: Either both u\_cor and v\_cor or neither"}// \&}
\DoxyCodeLine{96        \textcolor{stringliteral}{" one must be present in call to continuity."})}
\DoxyCodeLine{97 }
\DoxyCodeLine{98   \textcolor{keywordflow}{if} (cs\%continuity\_scheme == ppm\_scheme) \textcolor{keywordflow}{then}}
\DoxyCodeLine{99     \textcolor{keyword}{call }continuity\_ppm(u, v, hin, h, uh, vh, dt, g, gv, us, cs\%PPM\_CSp, uhbt, vhbt, obc, \&}
\DoxyCodeLine{100                         visc\_rem\_u, visc\_rem\_v, u\_cor, v\_cor, bt\_cont=bt\_cont)}
\DoxyCodeLine{101   \textcolor{keywordflow}{else}}
\DoxyCodeLine{102     \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"continuity: Unrecognized value of continuity\_scheme"})}
\DoxyCodeLine{103 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{104 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__continuity_aa91ed69484f54d0bba361bfe60d89d60}\label{namespacemom__continuity_aa91ed69484f54d0bba361bfe60d89d60}} 
\index{mom\_continuity@{mom\_continuity}!continuity\_end@{continuity\_end}}
\index{continuity\_end@{continuity\_end}!mom\_continuity@{mom\_continuity}}
\subsubsection{\texorpdfstring{continuity\_end()}{continuity\_end()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+continuity\+::continuity\+\_\+end (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__continuity_1_1continuity__cs}{continuity\+\_\+cs}}), pointer}]{CS }\end{DoxyParamCaption})}



Destructor for \mbox{\hyperlink{structmom__continuity_1_1continuity__cs}{continuity\+\_\+cs}}. 


\begin{DoxyParams}{Parameters}
{\em cs} & Control structure for \mbox{\hyperlink{namespacemom__continuity}{mom\+\_\+continuity}}. \\
\hline
\end{DoxyParams}


Definition at line 170 of file M\+O\+M\+\_\+continuity.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{170   \textcolor{keywordtype}{type}(continuity\_CS), \textcolor{keywordtype}{pointer} :: CS\textcolor{comment}{ !< Control structure for mom\_continuity.}}
\DoxyCodeLine{171 }
\DoxyCodeLine{172   \textcolor{keywordflow}{if} (cs\%continuity\_scheme == ppm\_scheme) \textcolor{keywordflow}{then}}
\DoxyCodeLine{173     \textcolor{keyword}{call }continuity\_ppm\_end(cs\%PPM\_CSp)}
\DoxyCodeLine{174 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{175 }
\DoxyCodeLine{176   \textcolor{keyword}{deallocate}(cs)}
\DoxyCodeLine{177 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__continuity_a458ebf2ce1b5dede05607b2d644dcfad}\label{namespacemom__continuity_a458ebf2ce1b5dede05607b2d644dcfad}} 
\index{mom\_continuity@{mom\_continuity}!continuity\_init@{continuity\_init}}
\index{continuity\_init@{continuity\_init}!mom\_continuity@{mom\_continuity}}
\subsubsection{\texorpdfstring{continuity\_init()}{continuity\_init()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+continuity\+::continuity\+\_\+init (\begin{DoxyParamCaption}\item[{type(time\+\_\+type), intent(in), target}]{Time,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{G,  }\item[{type(verticalgrid\+\_\+type), intent(in)}]{GV,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US,  }\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file,  }\item[{type(diag\+\_\+ctrl), intent(inout), target}]{diag,  }\item[{type(\mbox{\hyperlink{structmom__continuity_1_1continuity__cs}{continuity\+\_\+cs}}), pointer}]{CS }\end{DoxyParamCaption})}



Initializes \mbox{\hyperlink{structmom__continuity_1_1continuity__cs}{continuity\+\_\+cs}}. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em time} & Current model time. \\
\hline
\mbox{\texttt{ in}}  & {\em g} & Ocean grid structure. \\
\hline
\mbox{\texttt{ in}}  & {\em gv} & Vertical grid structure. \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type \\
\hline
\mbox{\texttt{ in}}  & {\em param\+\_\+file} & Parameter file handles. \\
\hline
\mbox{\texttt{ in,out}}  & {\em diag} & Diagnostics control structure. \\
\hline
 & {\em cs} & Control structure for \mbox{\hyperlink{namespacemom__continuity}{mom\+\_\+continuity}}. \\
\hline
\end{DoxyParams}


Definition at line 109 of file M\+O\+M\+\_\+continuity.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{109   \textcolor{keywordtype}{type}(time\_type), \textcolor{keywordtype}{target}, \textcolor{keywordtype}{intent(in)}    :: Time\textcolor{comment}{       !< Current model time.}}
\DoxyCodeLine{110   \textcolor{keywordtype}{type}(ocean\_grid\_type),   \textcolor{keywordtype}{intent(in)}    :: G\textcolor{comment}{          !< Ocean grid structure.}}
\DoxyCodeLine{111   \textcolor{keywordtype}{type}(verticalGrid\_type), \textcolor{keywordtype}{intent(in)}    :: GV\textcolor{comment}{         !< Vertical grid structure.}}
\DoxyCodeLine{112   \textcolor{keywordtype}{type}(unit\_scale\_type),   \textcolor{keywordtype}{intent(in)}    :: US\textcolor{comment}{  !< A dimensional unit scaling type}}
\DoxyCodeLine{113   \textcolor{keywordtype}{type}(param\_file\_type),   \textcolor{keywordtype}{intent(in)}    :: param\_file\textcolor{comment}{ !< Parameter file handles.}}
\DoxyCodeLine{114   \textcolor{keywordtype}{type}(diag\_ctrl), \textcolor{keywordtype}{target}, \textcolor{keywordtype}{intent(inout)} :: diag\textcolor{comment}{       !< Diagnostics control structure.}}
\DoxyCodeLine{115   \textcolor{keywordtype}{type}(continuity\_CS),     \textcolor{keywordtype}{pointer}       :: CS\textcolor{comment}{         !< Control structure for mom\_continuity.}}
\DoxyCodeLine{116 }
\DoxyCodeLine{117   \textcolor{comment}{! This include declares and sets the variable "version".}}
\DoxyCodeLine{118 \textcolor{preprocessor}{\# include "version\_variable.h"}}
\DoxyCodeLine{119 \textcolor{preprocessor}{}  \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"MOM\_continuity"} \textcolor{comment}{! This module's name.}}
\DoxyCodeLine{120   \textcolor{keywordtype}{character(len=20)}  :: tmpstr}
\DoxyCodeLine{121 }
\DoxyCodeLine{122   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{123     \textcolor{keyword}{call }mom\_error(warning, \textcolor{stringliteral}{"continuity\_init called with associated control structure."})}
\DoxyCodeLine{124     \textcolor{keywordflow}{return}}
\DoxyCodeLine{125 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{126   \textcolor{keyword}{allocate}(cs)}
\DoxyCodeLine{127 }
\DoxyCodeLine{128   \textcolor{comment}{! Read all relevant parameters and write them to the model log.}}
\DoxyCodeLine{129   \textcolor{keyword}{call }log\_version(param\_file, mdl, version, \textcolor{stringliteral}{""})}
\DoxyCodeLine{130   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"CONTINUITY\_SCHEME"}, tmpstr, \&}
\DoxyCodeLine{131                  \textcolor{stringliteral}{"CONTINUITY\_SCHEME selects the discretization for the "}//\&}
\DoxyCodeLine{132                  \textcolor{stringliteral}{"continuity solver. The only valid value currently is: \(\backslash\)n"}//\&}
\DoxyCodeLine{133                  \textcolor{stringliteral}{"\(\backslash\)t PPM - use a positive-definite (or monotonic) \(\backslash\)n"}//\&}
\DoxyCodeLine{134                  \textcolor{stringliteral}{"\(\backslash\)t       piecewise parabolic reconstruction solver."}, \&}
\DoxyCodeLine{135                  default=ppm\_string)}
\DoxyCodeLine{136 }
\DoxyCodeLine{137   tmpstr = uppercase(tmpstr) ; cs\%continuity\_scheme = 0}
\DoxyCodeLine{138   \textcolor{keywordflow}{select case} (trim(tmpstr))}
\DoxyCodeLine{139     \textcolor{keywordflow}{case} (ppm\_string) ; cs\%continuity\_scheme = ppm\_scheme}
\DoxyCodeLine{140 \textcolor{keywordflow}{    case default}}
\DoxyCodeLine{141       \textcolor{keyword}{call }mom\_mesg(\textcolor{stringliteral}{'continuity\_init: CONTINUITY\_SCHEME ="'}//trim(tmpstr)//\textcolor{stringliteral}{'"'}, 0)}
\DoxyCodeLine{142       \textcolor{keyword}{call }mom\_mesg(\textcolor{stringliteral}{"continuity\_init: The only valid value is currently "}// \&}
\DoxyCodeLine{143                      trim(ppm\_string), 0)}
\DoxyCodeLine{144       \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"continuity\_init: Unrecognized setting "}// \&}
\DoxyCodeLine{145             \textcolor{stringliteral}{"\#define CONTINUITY\_SCHEME "}//trim(tmpstr)//\textcolor{stringliteral}{" found in input file."})}
\DoxyCodeLine{146 \textcolor{keywordflow}{  end select}}
\DoxyCodeLine{147 }
\DoxyCodeLine{148   \textcolor{keywordflow}{if} (cs\%continuity\_scheme == ppm\_scheme) \textcolor{keywordflow}{then}}
\DoxyCodeLine{149     \textcolor{keyword}{call }continuity\_ppm\_init(time, g, gv, us, param\_file, diag, cs\%PPM\_CSp)}
\DoxyCodeLine{150 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{151 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__continuity_afb0ed16b38c098805a3a9caf4b60ceff}\label{namespacemom__continuity_afb0ed16b38c098805a3a9caf4b60ceff}} 
\index{mom\_continuity@{mom\_continuity}!continuity\_stencil@{continuity\_stencil}}
\index{continuity\_stencil@{continuity\_stencil}!mom\_continuity@{mom\_continuity}}
\subsubsection{\texorpdfstring{continuity\_stencil()}{continuity\_stencil()}}
{\footnotesize\ttfamily integer function, public mom\+\_\+continuity\+::continuity\+\_\+stencil (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__continuity_1_1continuity__cs}{continuity\+\_\+cs}}), pointer}]{CS }\end{DoxyParamCaption})}



continuity\+\_\+stencil returns the continuity solver stencil size 


\begin{DoxyParams}{Parameters}
{\em cs} & Module\textquotesingle{}s control structure. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The continuity solver stencil size with the current settings. 
\end{DoxyReturn}


Definition at line 157 of file M\+O\+M\+\_\+continuity.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{157   \textcolor{keywordtype}{type}(continuity\_CS), \textcolor{keywordtype}{pointer}       :: CS\textcolor{comment}{  !< Module's control structure.}}
\DoxyCodeLine{158   \textcolor{keywordtype}{integer} ::  stencil\textcolor{comment}{ !< The continuity solver stencil size with the current settings.}}
\DoxyCodeLine{159 }
\DoxyCodeLine{160   stencil = 1}
\DoxyCodeLine{161 }
\DoxyCodeLine{162   \textcolor{keywordflow}{if} (cs\%continuity\_scheme == ppm\_scheme) \textcolor{keywordflow}{then}}
\DoxyCodeLine{163     stencil = continuity\_ppm\_stencil(cs\%PPM\_CSp)}
\DoxyCodeLine{164 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{165 }

\end{DoxyCode}
