\hypertarget{namespacemom__domains}{}\section{mom\+\_\+domains Module Reference}
\label{namespacemom__domains}\index{mom\_domains@{mom\_domains}}


\subsection{Detailed Description}
Describes the decomposed M\+OM domain and has routines for communications across P\+Es. \subsection*{Data Types}
\begin{DoxyCompactItemize}
\item 
interface \mbox{\hyperlink{interfacemom__domains_1_1clone__mom__domain}{clone\+\_\+mom\+\_\+domain}}
\begin{DoxyCompactList}\small\item\em Copy one M\+O\+M\+\_\+domain\+\_\+type into another. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__domains_1_1create__group__pass}{create\+\_\+group\+\_\+pass}}
\begin{DoxyCompactList}\small\item\em Set up a group of halo updates. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__domains_1_1fill__symmetric__edges}{fill\+\_\+symmetric\+\_\+edges}}
\begin{DoxyCompactList}\small\item\em Do a set of halo updates that fill in the values at the duplicated edges of a staggered symmetric memory domain. \end{DoxyCompactList}\item 
type \mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}
\begin{DoxyCompactList}\small\item\em The M\+O\+M\+\_\+domain\+\_\+type contains information about the domain decompositoin. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__domains_1_1pass__var}{pass\+\_\+var}}
\begin{DoxyCompactList}\small\item\em Do a halo update on an array. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__domains_1_1pass__var__complete}{pass\+\_\+var\+\_\+complete}}
\begin{DoxyCompactList}\small\item\em Complete a non-\/blocking halo update on an array. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__domains_1_1pass__var__start}{pass\+\_\+var\+\_\+start}}
\begin{DoxyCompactList}\small\item\em Initiate a non-\/blocking halo update on an array. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__domains_1_1pass__vector}{pass\+\_\+vector}}
\begin{DoxyCompactList}\small\item\em Do a halo update on a pair of arrays representing the two components of a vector. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__domains_1_1pass__vector__complete}{pass\+\_\+vector\+\_\+complete}}
\begin{DoxyCompactList}\small\item\em Complete a halo update on a pair of arrays representing the two components of a vector. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__domains_1_1pass__vector__start}{pass\+\_\+vector\+\_\+start}}
\begin{DoxyCompactList}\small\item\em Initiate a halo update on a pair of arrays representing the two components of a vector. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \mbox{\hyperlink{namespacemom__domains_a999a002240cf83d613c2c792c1a55a3e}{pass\+\_\+var\+\_\+3d}} (array, M\+O\+M\+\_\+dom, sideflag, complete, position, halo, clock)
\begin{DoxyCompactList}\small\item\em pass\+\_\+var\+\_\+3d does a halo update for a three-\/dimensional array. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__domains_a98ff318d433bfde36936967df2f5187a}{pass\+\_\+var\+\_\+2d}} (array, M\+O\+M\+\_\+dom, sideflag, complete, position, halo, inner\+\_\+halo, clock)
\begin{DoxyCompactList}\small\item\em pass\+\_\+var\+\_\+2d does a halo update for a two-\/dimensional array. \end{DoxyCompactList}\item 
integer function \mbox{\hyperlink{namespacemom__domains_a12e2e78eaf5b2d63da34a190052881e2}{pass\+\_\+var\+\_\+start\+\_\+2d}} (array, M\+O\+M\+\_\+dom, sideflag, position, complete, halo, clock)
\begin{DoxyCompactList}\small\item\em pass\+\_\+var\+\_\+start\+\_\+2d starts a halo update for a two-\/dimensional array. \end{DoxyCompactList}\item 
integer function \mbox{\hyperlink{namespacemom__domains_ae69b74b11620d559736ee87e644fcd7f}{pass\+\_\+var\+\_\+start\+\_\+3d}} (array, M\+O\+M\+\_\+dom, sideflag, position, complete, halo, clock)
\begin{DoxyCompactList}\small\item\em pass\+\_\+var\+\_\+start\+\_\+3d starts a halo update for a three-\/dimensional array. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__domains_ab7f3448204f6b2b959174c7458299efd}{pass\+\_\+var\+\_\+complete\+\_\+2d}} (id\+\_\+update, array, M\+O\+M\+\_\+dom, sideflag, position, halo, clock)
\begin{DoxyCompactList}\small\item\em pass\+\_\+var\+\_\+complete\+\_\+2d completes a halo update for a two-\/dimensional array. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__domains_aaf84cb739a4915a17a12898a0bd33ace}{pass\+\_\+var\+\_\+complete\+\_\+3d}} (id\+\_\+update, array, M\+O\+M\+\_\+dom, sideflag, position, halo, clock)
\begin{DoxyCompactList}\small\item\em pass\+\_\+var\+\_\+complete\+\_\+3d completes a halo update for a three-\/dimensional array. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__domains_af0e7230b07b8bdce96b89475a87c0622}{pass\+\_\+vector\+\_\+2d}} (u\+\_\+cmpt, v\+\_\+cmpt, M\+O\+M\+\_\+dom, direction, stagger, complete, halo, clock)
\begin{DoxyCompactList}\small\item\em pass\+\_\+vector\+\_\+2d does a halo update for a pair of two-\/dimensional arrays representing the compontents of a two-\/dimensional horizontal vector. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__domains_a3ad88dc636a6d2d6092332235f99f9b8}{fill\+\_\+vector\+\_\+symmetric\+\_\+edges\+\_\+2d}} (u\+\_\+cmpt, v\+\_\+cmpt, M\+O\+M\+\_\+dom, stagger, scalar, clock)
\begin{DoxyCompactList}\small\item\em fill\+\_\+vector\+\_\+symmetric\+\_\+edges\+\_\+2d does an usual set of halo updates that only fill in the values at the edge of a pair of symmetric memory two-\/dimensional arrays representing the compontents of a two-\/dimensional horizontal vector. If symmetric memory is not being used, this subroutine does nothing except to possibly turn optional cpu clocks on or off. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__domains_ad6af3f884cc89a6239f0fe240bfd3580}{pass\+\_\+vector\+\_\+3d}} (u\+\_\+cmpt, v\+\_\+cmpt, M\+O\+M\+\_\+dom, direction, stagger, complete, halo, clock)
\begin{DoxyCompactList}\small\item\em pass\+\_\+vector\+\_\+3d does a halo update for a pair of three-\/dimensional arrays representing the compontents of a three-\/dimensional horizontal vector. \end{DoxyCompactList}\item 
integer function \mbox{\hyperlink{namespacemom__domains_a30e9d0831d2c44339c2891e9250ca683}{pass\+\_\+vector\+\_\+start\+\_\+2d}} (u\+\_\+cmpt, v\+\_\+cmpt, M\+O\+M\+\_\+dom, direction, stagger, complete, halo, clock)
\begin{DoxyCompactList}\small\item\em pass\+\_\+vector\+\_\+start\+\_\+2d starts a halo update for a pair of two-\/dimensional arrays representing the compontents of a two-\/dimensional horizontal vector. \end{DoxyCompactList}\item 
integer function \mbox{\hyperlink{namespacemom__domains_a873cbcdb86ae700c1d1aaf340b28d8f8}{pass\+\_\+vector\+\_\+start\+\_\+3d}} (u\+\_\+cmpt, v\+\_\+cmpt, M\+O\+M\+\_\+dom, direction, stagger, complete, halo, clock)
\begin{DoxyCompactList}\small\item\em pass\+\_\+vector\+\_\+start\+\_\+3d starts a halo update for a pair of three-\/dimensional arrays representing the compontents of a three-\/dimensional horizontal vector. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__domains_a1fe9c30fcc37098454d5bb11c6925116}{pass\+\_\+vector\+\_\+complete\+\_\+2d}} (id\+\_\+update, u\+\_\+cmpt, v\+\_\+cmpt, M\+O\+M\+\_\+dom, direction, stagger, halo, clock)
\begin{DoxyCompactList}\small\item\em pass\+\_\+vector\+\_\+complete\+\_\+2d completes a halo update for a pair of two-\/dimensional arrays representing the compontents of a two-\/dimensional horizontal vector. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__domains_ae5cd6e7c49fc4f9a631753f25c30683b}{pass\+\_\+vector\+\_\+complete\+\_\+3d}} (id\+\_\+update, u\+\_\+cmpt, v\+\_\+cmpt, M\+O\+M\+\_\+dom, direction, stagger, halo, clock)
\begin{DoxyCompactList}\small\item\em pass\+\_\+vector\+\_\+complete\+\_\+3d completes a halo update for a pair of three-\/dimensional arrays representing the compontents of a three-\/dimensional horizontal vector. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__domains_ae8983ffd009810e38975f32cb34a0f65}{create\+\_\+var\+\_\+group\+\_\+pass\+\_\+2d}} (group, array, M\+O\+M\+\_\+dom, sideflag, position, halo, clock)
\begin{DoxyCompactList}\small\item\em create\+\_\+var\+\_\+group\+\_\+pass\+\_\+2d sets up a group of two-\/dimensional array halo updates. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__domains_a98e7ddef6138d57f457f05e6ebc326b0}{create\+\_\+var\+\_\+group\+\_\+pass\+\_\+3d}} (group, array, M\+O\+M\+\_\+dom, sideflag, position, halo, clock)
\begin{DoxyCompactList}\small\item\em create\+\_\+var\+\_\+group\+\_\+pass\+\_\+3d sets up a group of three-\/dimensional array halo updates. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__domains_a71883f8a7b981797b20b83ca277d32dd}{create\+\_\+vector\+\_\+group\+\_\+pass\+\_\+2d}} (group, u\+\_\+cmpt, v\+\_\+cmpt, M\+O\+M\+\_\+dom, direction, stagger, halo, clock)
\begin{DoxyCompactList}\small\item\em create\+\_\+vector\+\_\+group\+\_\+pass\+\_\+2d sets up a group of two-\/dimensional vector halo updates. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__domains_aa224a5c2409ffe99157e4cc51e979cf4}{create\+\_\+vector\+\_\+group\+\_\+pass\+\_\+3d}} (group, u\+\_\+cmpt, v\+\_\+cmpt, M\+O\+M\+\_\+dom, direction, stagger, halo, clock)
\begin{DoxyCompactList}\small\item\em create\+\_\+vector\+\_\+group\+\_\+pass\+\_\+3d sets up a group of three-\/dimensional vector halo updates. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__domains_aac3bc012a8c214cbd73bb00668ff165e}{do\+\_\+group\+\_\+pass}} (group, M\+O\+M\+\_\+dom, clock)
\begin{DoxyCompactList}\small\item\em do\+\_\+group\+\_\+pass carries out a group halo update. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__domains_ab27e1cc5953c88e733e0f9f55e4fd446}{start\+\_\+group\+\_\+pass}} (group, M\+O\+M\+\_\+dom, clock)
\begin{DoxyCompactList}\small\item\em start\+\_\+group\+\_\+pass starts out a group halo update. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__domains_a242daf83cdf6041f5023f7da49d6da37}{complete\+\_\+group\+\_\+pass}} (group, M\+O\+M\+\_\+dom, clock)
\begin{DoxyCompactList}\small\item\em complete\+\_\+group\+\_\+pass completes a group halo update. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__domains_a1f46e6c3ac2f2728924617edfa6f22b5}{mom\+\_\+domains\+\_\+init}} (M\+O\+M\+\_\+dom, param\+\_\+file, symmetric, static\+\_\+memory, N\+I\+H\+A\+LO, N\+J\+H\+A\+LO, N\+I\+G\+L\+O\+B\+AL, N\+J\+G\+L\+O\+B\+AL, N\+I\+P\+R\+OC, N\+J\+P\+R\+OC, min\+\_\+halo, domain\+\_\+name, include\+\_\+name, param\+\_\+suffix)
\begin{DoxyCompactList}\small\item\em M\+O\+M\+\_\+domains\+\_\+init initalizes a M\+O\+M\+\_\+domain\+\_\+type variable, based on the information read in from a param\+\_\+file\+\_\+type, and optionally returns data describing various\textquotesingle{} properties of the domain type. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__domains_a5491fcd88dc84d1a0daf6f5dff140174}{clone\+\_\+md\+\_\+to\+\_\+md}} (M\+D\+\_\+in, M\+O\+M\+\_\+dom, min\+\_\+halo, halo\+\_\+size, symmetric, domain\+\_\+name, turns)
\begin{DoxyCompactList}\small\item\em clone\+\_\+\+M\+D\+\_\+to\+\_\+\+MD copies one M\+O\+M\+\_\+domain\+\_\+type into another, while allowing some properties of the new type to differ from the original one. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__domains_a3f432e94ab08c826f07c64df5b0762f5}{clone\+\_\+md\+\_\+to\+\_\+d2d}} (M\+D\+\_\+in, mpp\+\_\+domain, min\+\_\+halo, halo\+\_\+size, symmetric, domain\+\_\+name, turns)
\begin{DoxyCompactList}\small\item\em clone\+\_\+\+M\+D\+\_\+to\+\_\+d2D uses information from a M\+O\+M\+\_\+domain\+\_\+type to create a new domain2d type, while allowing some properties of the new type to differ from the original one. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__domains_a1f1063ac5a049926d4ad00b43752aee6}{get\+\_\+domain\+\_\+extent}} (Domain, isc, iec, jsc, jec, isd, ied, jsd, jed, isg, ieg, jsg, jeg, idg\+\_\+offset, jdg\+\_\+offset, symmetric, local\+\_\+indexing, index\+\_\+offset)
\begin{DoxyCompactList}\small\item\em Returns various data that has been stored in a M\+O\+M\+\_\+domain\+\_\+type. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__domains_a15fdef1c434c81da4d1f5ab3d9234290}{get\+\_\+domain\+\_\+extent\+\_\+dsamp2}} (Domain, isc\+\_\+d2, iec\+\_\+d2, jsc\+\_\+d2, jec\+\_\+d2, isd\+\_\+d2, ied\+\_\+d2, jsd\+\_\+d2, jed\+\_\+d2, isg\+\_\+d2, ieg\+\_\+d2, jsg\+\_\+d2, jeg\+\_\+d2)
\item 
subroutine, public \mbox{\hyperlink{namespacemom__domains_af34281b52f789238cc85cf2ff1d20d3b}{get\+\_\+simple\+\_\+array\+\_\+i\+\_\+ind}} (domain, size, is, ie, symmetric)
\begin{DoxyCompactList}\small\item\em Return the (potentially symmetric) computational domain i-\/bounds for an array passed without index specifications (i.\+e. indices start at 1) based on an array size. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__domains_ae301b36598e7b9c3f3e087b75147d8d4}{get\+\_\+simple\+\_\+array\+\_\+j\+\_\+ind}} (domain, size, js, je, symmetric)
\begin{DoxyCompactList}\small\item\em Return the (potentially symmetric) computational domain j-\/bounds for an array passed without index specifications (i.\+e. indices start at 1) based on an array size. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__domains_abc0b09896aa9f5b4c795f85c813aa59f}{get\+\_\+global\+\_\+shape}} (domain, niglobal, njglobal)
\begin{DoxyCompactList}\small\item\em Returns the global shape of h-\/point arrays. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{namespacemom__domains_aa7d2122aa278771209b860dbd6788097}\label{namespacemom__domains_aa7d2122aa278771209b860dbd6788097}} 
integer, parameter, public \mbox{\hyperlink{namespacemom__domains_aa7d2122aa278771209b860dbd6788097}{to\+\_\+all}} = To\+\_\+\+East + To\+\_\+\+West + To\+\_\+\+North + To\+\_\+\+South
\begin{DoxyCompactList}\small\item\em A flag for passing in all directions. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacemom__domains_a3f432e94ab08c826f07c64df5b0762f5}\label{namespacemom__domains_a3f432e94ab08c826f07c64df5b0762f5}} 
\index{mom\_domains@{mom\_domains}!clone\_md\_to\_d2d@{clone\_md\_to\_d2d}}
\index{clone\_md\_to\_d2d@{clone\_md\_to\_d2d}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{clone\_md\_to\_d2d()}{clone\_md\_to\_d2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+domains\+::clone\+\_\+md\+\_\+to\+\_\+d2d (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(in)}]{M\+D\+\_\+in,  }\item[{type(domain2d), intent(inout)}]{mpp\+\_\+domain,  }\item[{integer, dimension(2), intent(inout), optional}]{min\+\_\+halo,  }\item[{integer, intent(in), optional}]{halo\+\_\+size,  }\item[{logical, intent(in), optional}]{symmetric,  }\item[{character(len=$\ast$), intent(in), optional}]{domain\+\_\+name,  }\item[{integer, intent(in), optional}]{turns }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



clone\+\_\+\+M\+D\+\_\+to\+\_\+d2D uses information from a M\+O\+M\+\_\+domain\+\_\+type to create a new domain2d type, while allowing some properties of the new type to differ from the original one. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em md\+\_\+in} & An existing M\+O\+M\+\_\+domain to be cloned \\
\hline
\mbox{\texttt{ in,out}}  & {\em mpp\+\_\+domain} & The new mpp\+\_\+domain to be set up \\
\hline
\mbox{\texttt{ in,out}}  & {\em min\+\_\+halo} & If present, this sets the \\
\hline
\mbox{\texttt{ in}}  & {\em halo\+\_\+size} & If present, this sets the halo size for the domain in the i-\/ and j-\/directions. min\+\_\+halo and halo\+\_\+size can not both be present. \\
\hline
\mbox{\texttt{ in}}  & {\em symmetric} & If present, this specifies whether the new domain is symmetric, regardless of whether the macro S\+Y\+M\+M\+E\+T\+R\+I\+C\+\_\+\+M\+E\+M\+O\+R\+Y\+\_\+ is defined. \\
\hline
\mbox{\texttt{ in}}  & {\em domain\+\_\+name} & A name for the new domain, \char`\"{}\+M\+O\+M\char`\"{} \\
\hline
\mbox{\texttt{ in}}  & {\em turns} & If true, swap X and Y axes \\
\hline
\end{DoxyParams}


Definition at line 1737 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1737   \textcolor{keywordtype}{type}(MOM\_domain\_type), \textcolor{keywordtype}{intent(in)}    :: MD\_in\textcolor{comment}{ !< An existing MOM\_domain to be cloned}}
\DoxyCodeLine{1738   \textcolor{keywordtype}{type}(domain2d),        \textcolor{keywordtype}{intent(inout)} :: mpp\_domain\textcolor{comment}{ !< The new mpp\_domain to be set up}}
\DoxyCodeLine{1739   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{dimension(2)}, \&}
\DoxyCodeLine{1740                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(inout)} :: min\_halo\textcolor{comment}{ !< If present, this sets the}}
\DoxyCodeLine{1741 \textcolor{comment}{                                  !! minimum halo size for this domain in the i- and j-}}
\DoxyCodeLine{1742 \textcolor{comment}{                                  !! directions, and returns the actual halo size used.}}
\DoxyCodeLine{1743   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\_size\textcolor{comment}{ !< If present, this sets the halo}}
\DoxyCodeLine{1744 \textcolor{comment}{                                  !! size for the domain in the i- and j-directions.}}
\DoxyCodeLine{1745 \textcolor{comment}{                                  !! min\_halo and halo\_size can not both be present.}}
\DoxyCodeLine{1746   \textcolor{keywordtype}{logical},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: symmetric\textcolor{comment}{ !< If present, this specifies}}
\DoxyCodeLine{1747 \textcolor{comment}{                                  !! whether the new domain is symmetric, regardless of}}
\DoxyCodeLine{1748 \textcolor{comment}{                                  !! whether the macro SYMMETRIC\_MEMORY\_ is defined.}}
\DoxyCodeLine{1749   \textcolor{keywordtype}{character(len=*)}, \&}
\DoxyCodeLine{1750                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: domain\_name\textcolor{comment}{ !< A name for the new domain, "MOM"}}
\DoxyCodeLine{1751 \textcolor{comment}{                                  !! if missing.}}
\DoxyCodeLine{1752   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{   !< If true, swap X and Y axes}}
\DoxyCodeLine{1753 }
\DoxyCodeLine{1754   \textcolor{keywordtype}{integer} :: global\_indices(4), layout(2), io\_layout(2)}
\DoxyCodeLine{1755   \textcolor{keywordtype}{integer} :: X\_FLAGS, Y\_FLAGS, niglobal, njglobal, nihalo, njhalo}
\DoxyCodeLine{1756   \textcolor{keywordtype}{logical} :: symmetric\_dom}
\DoxyCodeLine{1757   \textcolor{keywordtype}{character(len=64)} :: dom\_name}
\DoxyCodeLine{1758 }
\DoxyCodeLine{1759   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(turns)) \&}
\DoxyCodeLine{1760     \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"Rotation not supported for MOM\_domain to domain2d"})}
\DoxyCodeLine{1761 }
\DoxyCodeLine{1762 \textcolor{comment}{! Save the extra data for creating other domains of different resolution that overlay this domain}}
\DoxyCodeLine{1763   niglobal = md\_in\%niglobal ; njglobal = md\_in\%njglobal}
\DoxyCodeLine{1764   nihalo = md\_in\%nihalo ; njhalo = md\_in\%njhalo}
\DoxyCodeLine{1765 }
\DoxyCodeLine{1766   symmetric\_dom = md\_in\%symmetric}
\DoxyCodeLine{1767 }
\DoxyCodeLine{1768   x\_flags = md\_in\%X\_FLAGS ; y\_flags = md\_in\%Y\_FLAGS}
\DoxyCodeLine{1769   layout(:) = md\_in\%layout(:) ; io\_layout(:) = md\_in\%io\_layout(:)}
\DoxyCodeLine{1770 }
\DoxyCodeLine{1771   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo\_size) .and. \textcolor{keyword}{present}(min\_halo)) \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{1772       \textcolor{stringliteral}{"clone\_MOM\_domain can not have both halo\_size and min\_halo present."})}
\DoxyCodeLine{1773 }
\DoxyCodeLine{1774   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(min\_halo)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1775     nihalo = max(nihalo, min\_halo(1))}
\DoxyCodeLine{1776     njhalo = max(njhalo, min\_halo(2))}
\DoxyCodeLine{1777     min\_halo(1) = nihalo ; min\_halo(2) = njhalo}
\DoxyCodeLine{1778 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1779 }
\DoxyCodeLine{1780   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo\_size)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1781     nihalo = halo\_size ; njhalo = halo\_size}
\DoxyCodeLine{1782 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1783 }
\DoxyCodeLine{1784   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(symmetric)) \textcolor{keywordflow}{then} ; symmetric\_dom = symmetric ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1785 }
\DoxyCodeLine{1786   dom\_name = \textcolor{stringliteral}{"MOM"}}
\DoxyCodeLine{1787   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(domain\_name)) dom\_name = trim(domain\_name)}
\DoxyCodeLine{1788 }
\DoxyCodeLine{1789   global\_indices(1) = 1 ; global\_indices(2) = niglobal}
\DoxyCodeLine{1790   global\_indices(3) = 1 ; global\_indices(4) = njglobal}
\DoxyCodeLine{1791   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(md\_in\%maskmap)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1792     \textcolor{keyword}{call }mom\_define\_domain( global\_indices, layout, mpp\_domain, \&}
\DoxyCodeLine{1793                 xflags=x\_flags, yflags=y\_flags, \&}
\DoxyCodeLine{1794                 xhalo=nihalo, yhalo=njhalo, \&}
\DoxyCodeLine{1795                 symmetry = symmetric, name=dom\_name, \&}
\DoxyCodeLine{1796                 maskmap=md\_in\%maskmap )}
\DoxyCodeLine{1797   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1798     \textcolor{keyword}{call }mom\_define\_domain( global\_indices, layout, mpp\_domain, \&}
\DoxyCodeLine{1799                 xflags=x\_flags, yflags=y\_flags, \&}
\DoxyCodeLine{1800                 xhalo=nihalo, yhalo=njhalo, \&}
\DoxyCodeLine{1801                 symmetry = symmetric, name=dom\_name)}
\DoxyCodeLine{1802 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1803 }
\DoxyCodeLine{1804   \textcolor{keywordflow}{if} ((io\_layout(1) + io\_layout(2) > 0) .and. \&}
\DoxyCodeLine{1805       (layout(1)*layout(2) > 1)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1806     \textcolor{keyword}{call }mom\_define\_io\_domain(mpp\_domain, io\_layout)}
\DoxyCodeLine{1807 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1808 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_a5491fcd88dc84d1a0daf6f5dff140174}\label{namespacemom__domains_a5491fcd88dc84d1a0daf6f5dff140174}} 
\index{mom\_domains@{mom\_domains}!clone\_md\_to\_md@{clone\_md\_to\_md}}
\index{clone\_md\_to\_md@{clone\_md\_to\_md}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{clone\_md\_to\_md()}{clone\_md\_to\_md()}}
{\footnotesize\ttfamily subroutine mom\+\_\+domains\+::clone\+\_\+md\+\_\+to\+\_\+md (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(in)}]{M\+D\+\_\+in,  }\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), pointer}]{M\+O\+M\+\_\+dom,  }\item[{integer, dimension(2), intent(inout), optional}]{min\+\_\+halo,  }\item[{integer, intent(in), optional}]{halo\+\_\+size,  }\item[{logical, intent(in), optional}]{symmetric,  }\item[{character(len=$\ast$), intent(in), optional}]{domain\+\_\+name,  }\item[{integer, intent(in), optional}]{turns }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



clone\+\_\+\+M\+D\+\_\+to\+\_\+\+MD copies one M\+O\+M\+\_\+domain\+\_\+type into another, while allowing some properties of the new type to differ from the original one. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em md\+\_\+in} & An existing M\+O\+M\+\_\+domain \\
\hline
 & {\em mom\+\_\+dom} & A pointer to a M\+O\+M\+\_\+domain that will be allocated if it is unassociated, and will have data copied from M\+D\+\_\+in \\
\hline
\mbox{\texttt{ in,out}}  & {\em min\+\_\+halo} & If present, this sets the \\
\hline
\mbox{\texttt{ in}}  & {\em halo\+\_\+size} & If present, this sets the halo size for the domain in the i-\/ and j-\/directions. min\+\_\+halo and halo\+\_\+size can not both be present. \\
\hline
\mbox{\texttt{ in}}  & {\em symmetric} & If present, this specifies whether the new domain is symmetric, regardless of whether the macro S\+Y\+M\+M\+E\+T\+R\+I\+C\+\_\+\+M\+E\+M\+O\+R\+Y\+\_\+ is defined. \\
\hline
\mbox{\texttt{ in}}  & {\em domain\+\_\+name} & A name for the new domain, \char`\"{}\+M\+O\+M\char`\"{} \\
\hline
\mbox{\texttt{ in}}  & {\em turns} & Number of quarter turns \\
\hline
\end{DoxyParams}


Definition at line 1607 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1607   \textcolor{keywordtype}{type}(MOM\_domain\_type), \textcolor{keywordtype}{intent(in)}    :: MD\_in\textcolor{comment}{  !< An existing MOM\_domain}}
\DoxyCodeLine{1608   \textcolor{keywordtype}{type}(MOM\_domain\_type), \textcolor{keywordtype}{pointer}       :: MOM\_dom\textcolor{comment}{ !< A pointer to a MOM\_domain that will be}}
\DoxyCodeLine{1609 \textcolor{comment}{                                  !! allocated if it is unassociated, and will have data}}
\DoxyCodeLine{1610 \textcolor{comment}{                                  !! copied from MD\_in}}
\DoxyCodeLine{1611   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{dimension(2)}, \&}
\DoxyCodeLine{1612                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(inout)} :: min\_halo\textcolor{comment}{ !< If present, this sets the}}
\DoxyCodeLine{1613 \textcolor{comment}{                                  !! minimum halo size for this domain in the i- and j-}}
\DoxyCodeLine{1614 \textcolor{comment}{                                  !! directions, and returns the actual halo size used.}}
\DoxyCodeLine{1615   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\_size\textcolor{comment}{ !< If present, this sets the halo}}
\DoxyCodeLine{1616 \textcolor{comment}{                                  !! size for the domain in the i- and j-directions.}}
\DoxyCodeLine{1617 \textcolor{comment}{                                  !! min\_halo and halo\_size can not both be present.}}
\DoxyCodeLine{1618   \textcolor{keywordtype}{logical},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: symmetric\textcolor{comment}{ !< If present, this specifies}}
\DoxyCodeLine{1619 \textcolor{comment}{                                  !! whether the new domain is symmetric, regardless of}}
\DoxyCodeLine{1620 \textcolor{comment}{                                  !! whether the macro SYMMETRIC\_MEMORY\_ is defined.}}
\DoxyCodeLine{1621   \textcolor{keywordtype}{character(len=*)}, \&}
\DoxyCodeLine{1622                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: domain\_name\textcolor{comment}{ !< A name for the new domain, "MOM"}}
\DoxyCodeLine{1623 \textcolor{comment}{                                  !! if missing.}}
\DoxyCodeLine{1624   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{   !< Number of quarter turns}}
\DoxyCodeLine{1625 }
\DoxyCodeLine{1626   \textcolor{keywordtype}{integer} :: global\_indices(4)}
\DoxyCodeLine{1627   \textcolor{keywordtype}{logical} :: mask\_table\_exists}
\DoxyCodeLine{1628   \textcolor{keywordtype}{character(len=64)} :: dom\_name}
\DoxyCodeLine{1629   \textcolor{keywordtype}{integer} :: qturns}
\DoxyCodeLine{1630 }
\DoxyCodeLine{1631   qturns = 0}
\DoxyCodeLine{1632   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(turns)) qturns = turns}
\DoxyCodeLine{1633 }
\DoxyCodeLine{1634   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(mom\_dom)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1635     \textcolor{keyword}{allocate}(mom\_dom)}
\DoxyCodeLine{1636     \textcolor{keyword}{allocate}(mom\_dom\%mpp\_domain)}
\DoxyCodeLine{1637     \textcolor{keyword}{allocate}(mom\_dom\%mpp\_domain\_d2)}
\DoxyCodeLine{1638 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1639 }
\DoxyCodeLine{1640 \textcolor{comment}{! Save the extra data for creating other domains of different resolution that overlay this domain}}
\DoxyCodeLine{1641   mom\_dom\%symmetric = md\_in\%symmetric}
\DoxyCodeLine{1642   mom\_dom\%nonblocking\_updates = md\_in\%nonblocking\_updates}
\DoxyCodeLine{1643   mom\_dom\%thin\_halo\_updates = md\_in\%thin\_halo\_updates}
\DoxyCodeLine{1644 }
\DoxyCodeLine{1645   \textcolor{keywordflow}{if} (modulo(qturns, 2) /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1646     mom\_dom\%niglobal = md\_in\%njglobal ; mom\_dom\%njglobal = md\_in\%niglobal}
\DoxyCodeLine{1647     mom\_dom\%nihalo = md\_in\%njhalo ; mom\_dom\%njhalo = md\_in\%nihalo}
\DoxyCodeLine{1648 }
\DoxyCodeLine{1649     mom\_dom\%X\_FLAGS = md\_in\%Y\_FLAGS ; mom\_dom\%Y\_FLAGS = md\_in\%X\_FLAGS}
\DoxyCodeLine{1650     mom\_dom\%layout(:) = md\_in\%layout(2:1:-1)}
\DoxyCodeLine{1651     mom\_dom\%io\_layout(:) = md\_in\%io\_layout(2:1:-1)}
\DoxyCodeLine{1652   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1653     mom\_dom\%niglobal = md\_in\%niglobal ; mom\_dom\%njglobal = md\_in\%njglobal}
\DoxyCodeLine{1654     mom\_dom\%nihalo = md\_in\%nihalo ; mom\_dom\%njhalo = md\_in\%njhalo}
\DoxyCodeLine{1655 }
\DoxyCodeLine{1656     mom\_dom\%X\_FLAGS = md\_in\%X\_FLAGS ; mom\_dom\%Y\_FLAGS = md\_in\%Y\_FLAGS}
\DoxyCodeLine{1657     mom\_dom\%layout(:) = md\_in\%layout(:)}
\DoxyCodeLine{1658     mom\_dom\%io\_layout(:) = md\_in\%io\_layout(:)}
\DoxyCodeLine{1659 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1660 }
\DoxyCodeLine{1661   global\_indices(1) = 1 ; global\_indices(2) = mom\_dom\%niglobal}
\DoxyCodeLine{1662   global\_indices(3) = 1 ; global\_indices(4) = mom\_dom\%njglobal}
\DoxyCodeLine{1663 }
\DoxyCodeLine{1664   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(md\_in\%maskmap)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1665     mask\_table\_exists = .true.}
\DoxyCodeLine{1666     \textcolor{keyword}{allocate}(mom\_dom\%maskmap(mom\_dom\%layout(1), mom\_dom\%layout(2)))}
\DoxyCodeLine{1667     \textcolor{keywordflow}{if} (qturns /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1668       \textcolor{keyword}{call }rotate\_array(md\_in\%maskmap(:,:), qturns, mom\_dom\%maskmap(:,:))}
\DoxyCodeLine{1669     \textcolor{keywordflow}{else}}
\DoxyCodeLine{1670       mom\_dom\%maskmap(:,:) = md\_in\%maskmap(:,:)}
\DoxyCodeLine{1671 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1672   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1673     mask\_table\_exists = .false.}
\DoxyCodeLine{1674 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1675 }
\DoxyCodeLine{1676   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo\_size) .and. \textcolor{keyword}{present}(min\_halo)) \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{1677       \textcolor{stringliteral}{"clone\_MOM\_domain can not have both halo\_size and min\_halo present."})}
\DoxyCodeLine{1678 }
\DoxyCodeLine{1679   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(min\_halo)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1680     mom\_dom\%nihalo = max(mom\_dom\%nihalo, min\_halo(1))}
\DoxyCodeLine{1681     min\_halo(1) = mom\_dom\%nihalo}
\DoxyCodeLine{1682     mom\_dom\%njhalo = max(mom\_dom\%njhalo, min\_halo(2))}
\DoxyCodeLine{1683     min\_halo(2) = mom\_dom\%njhalo}
\DoxyCodeLine{1684 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1685 }
\DoxyCodeLine{1686   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo\_size)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1687     mom\_dom\%nihalo = halo\_size ; mom\_dom\%njhalo = halo\_size}
\DoxyCodeLine{1688 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1689 }
\DoxyCodeLine{1690   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(symmetric)) \textcolor{keywordflow}{then} ; mom\_dom\%symmetric = symmetric ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1691 }
\DoxyCodeLine{1692   dom\_name = \textcolor{stringliteral}{"MOM"}}
\DoxyCodeLine{1693   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(domain\_name)) dom\_name = trim(domain\_name)}
\DoxyCodeLine{1694 }
\DoxyCodeLine{1695   \textcolor{keywordflow}{if} (mask\_table\_exists) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1696     \textcolor{keyword}{call }mom\_define\_domain(global\_indices, mom\_dom\%layout, mom\_dom\%mpp\_domain, \&}
\DoxyCodeLine{1697                 xflags=mom\_dom\%X\_FLAGS, yflags=mom\_dom\%Y\_FLAGS, \&}
\DoxyCodeLine{1698                 xhalo=mom\_dom\%nihalo, yhalo=mom\_dom\%njhalo, \&}
\DoxyCodeLine{1699                 symmetry=mom\_dom\%symmetric, name=dom\_name, \&}
\DoxyCodeLine{1700                 maskmap=mom\_dom\%maskmap)}
\DoxyCodeLine{1701 }
\DoxyCodeLine{1702     global\_indices(2) = global\_indices(2) / 2}
\DoxyCodeLine{1703     global\_indices(4) = global\_indices(4) / 2}
\DoxyCodeLine{1704     \textcolor{keyword}{call }mom\_define\_domain(global\_indices, mom\_dom\%layout, \&}
\DoxyCodeLine{1705                 mom\_dom\%mpp\_domain\_d2, \&}
\DoxyCodeLine{1706                 xflags=mom\_dom\%X\_FLAGS, yflags=mom\_dom\%Y\_FLAGS, \&}
\DoxyCodeLine{1707                 xhalo=(mom\_dom\%nihalo/2), yhalo=(mom\_dom\%njhalo/2), \&}
\DoxyCodeLine{1708                 symmetry=mom\_dom\%symmetric, name=dom\_name, \&}
\DoxyCodeLine{1709                 maskmap=mom\_dom\%maskmap)}
\DoxyCodeLine{1710   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1711     \textcolor{keyword}{call }mom\_define\_domain(global\_indices, mom\_dom\%layout, mom\_dom\%mpp\_domain, \&}
\DoxyCodeLine{1712                 xflags=mom\_dom\%X\_FLAGS, yflags=mom\_dom\%Y\_FLAGS, \&}
\DoxyCodeLine{1713                 xhalo=mom\_dom\%nihalo, yhalo=mom\_dom\%njhalo, \&}
\DoxyCodeLine{1714                 symmetry=mom\_dom\%symmetric, name=dom\_name)}
\DoxyCodeLine{1715 }
\DoxyCodeLine{1716     global\_indices(2) = global\_indices(2) / 2}
\DoxyCodeLine{1717     global\_indices(4) = global\_indices(4) / 2}
\DoxyCodeLine{1718     \textcolor{keyword}{call }mom\_define\_domain(global\_indices, mom\_dom\%layout, \&}
\DoxyCodeLine{1719                 mom\_dom\%mpp\_domain\_d2, \&}
\DoxyCodeLine{1720                 xflags=mom\_dom\%X\_FLAGS, yflags=mom\_dom\%Y\_FLAGS, \&}
\DoxyCodeLine{1721                 xhalo=(mom\_dom\%nihalo/2), yhalo=(mom\_dom\%njhalo/2), \&}
\DoxyCodeLine{1722                 symmetry=mom\_dom\%symmetric, name=dom\_name)}
\DoxyCodeLine{1723 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1724 }
\DoxyCodeLine{1725   \textcolor{keywordflow}{if} ((mom\_dom\%io\_layout(1) + mom\_dom\%io\_layout(2) > 0) .and. \&}
\DoxyCodeLine{1726       (mom\_dom\%layout(1)*mom\_dom\%layout(2) > 1)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1727     \textcolor{keyword}{call }mom\_define\_io\_domain(mom\_dom\%mpp\_domain, mom\_dom\%io\_layout)}
\DoxyCodeLine{1728 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1729 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_a242daf83cdf6041f5023f7da49d6da37}\label{namespacemom__domains_a242daf83cdf6041f5023f7da49d6da37}} 
\index{mom\_domains@{mom\_domains}!complete\_group\_pass@{complete\_group\_pass}}
\index{complete\_group\_pass@{complete\_group\_pass}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{complete\_group\_pass()}{complete\_group\_pass()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+domains\+::complete\+\_\+group\+\_\+pass (\begin{DoxyParamCaption}\item[{type(group\+\_\+pass\+\_\+type), intent(inout)}]{group,  }\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(inout)}]{M\+O\+M\+\_\+dom,  }\item[{integer, intent(in), optional}]{clock }\end{DoxyParamCaption})}



complete\+\_\+group\+\_\+pass completes a group halo update. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em group} & The data type that store information for group update. This data will be used in do\+\_\+group\+\_\+pass. \\
\hline
\mbox{\texttt{ in,out}}  & {\em mom\+\_\+dom} & The M\+O\+M\+\_\+domain\+\_\+type containing the mpp\+\_\+domain needed to determine where data should be sent. \\
\hline
\mbox{\texttt{ in}}  & {\em clock} & The handle for a cpu time clock that should be started then stopped to time this routine. \\
\hline
\end{DoxyParams}


Definition at line 1154 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1154   \textcolor{keywordtype}{type}(group\_pass\_type), \textcolor{keywordtype}{intent(inout)} :: group\textcolor{comment}{    !< The data type that store information for}}
\DoxyCodeLine{1155 \textcolor{comment}{                                                   !! group update. This data will be used in}}
\DoxyCodeLine{1156 \textcolor{comment}{                                                   !! do\_group\_pass.}}
\DoxyCodeLine{1157   \textcolor{keywordtype}{type}(MOM\_domain\_type), \textcolor{keywordtype}{intent(inout)} :: MOM\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}}
\DoxyCodeLine{1158 \textcolor{comment}{                                                   !! needed to determine where data should be}}
\DoxyCodeLine{1159 \textcolor{comment}{                                                   !! sent.}}
\DoxyCodeLine{1160   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}}
\DoxyCodeLine{1161 \textcolor{comment}{                                                   !! started then stopped to time this routine.}}
\DoxyCodeLine{1162 \textcolor{keywordtype}{  real}                                 :: d\_type}
\DoxyCodeLine{1163 }
\DoxyCodeLine{1164   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_begin(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1165 }
\DoxyCodeLine{1166   \textcolor{keyword}{call }mpp\_complete\_group\_update(group, mom\_dom\%mpp\_domain, d\_type)}
\DoxyCodeLine{1167 }
\DoxyCodeLine{1168   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_end(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1169 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_ae8983ffd009810e38975f32cb34a0f65}\label{namespacemom__domains_ae8983ffd009810e38975f32cb34a0f65}} 
\index{mom\_domains@{mom\_domains}!create\_var\_group\_pass\_2d@{create\_var\_group\_pass\_2d}}
\index{create\_var\_group\_pass\_2d@{create\_var\_group\_pass\_2d}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{create\_var\_group\_pass\_2d()}{create\_var\_group\_pass\_2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+domains\+::create\+\_\+var\+\_\+group\+\_\+pass\+\_\+2d (\begin{DoxyParamCaption}\item[{type(group\+\_\+pass\+\_\+type), intent(inout)}]{group,  }\item[{real, dimension(\+:,\+:), intent(inout)}]{array,  }\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(inout)}]{M\+O\+M\+\_\+dom,  }\item[{integer, intent(in), optional}]{sideflag,  }\item[{integer, intent(in), optional}]{position,  }\item[{integer, intent(in), optional}]{halo,  }\item[{integer, intent(in), optional}]{clock }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



create\+\_\+var\+\_\+group\+\_\+pass\+\_\+2d sets up a group of two-\/dimensional array halo updates. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em group} & The data type that store information for group update. This data will be used in do\+\_\+group\+\_\+pass. \\
\hline
\mbox{\texttt{ in,out}}  & {\em array} & The array which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em mom\+\_\+dom} & The M\+O\+M\+\_\+domain\+\_\+type containing the mpp\+\_\+domain needed to determine where data should be sent. \\
\hline
\mbox{\texttt{ in}}  & {\em sideflag} & An optional integer indicating which directions the data should be sent. It is T\+O\+\_\+\+A\+LL or the sum of any of T\+O\+\_\+\+E\+A\+ST, T\+O\+\_\+\+W\+E\+ST, T\+O\+\_\+\+N\+O\+R\+TH, and T\+O\+\_\+\+S\+O\+U\+TH. For example, T\+O\+\_\+\+E\+A\+ST sends the data to the processor to the east, so the halos on the western side are filled. T\+O\+\_\+\+A\+LL is the default if sideflag is omitted. \\
\hline
\mbox{\texttt{ in}}  & {\em position} & An optional argument indicating the position. This is C\+E\+N\+T\+ER by default and is often C\+O\+R\+N\+ER, but could also be E\+A\+S\+T\+\_\+\+F\+A\+CE or N\+O\+R\+T\+H\+\_\+\+F\+A\+CE. \\
\hline
\mbox{\texttt{ in}}  & {\em halo} & The size of the halo to update -\/ the full halo by default. \\
\hline
\mbox{\texttt{ in}}  & {\em clock} & The handle for a cpu time clock that should be started then stopped to time this routine. \\
\hline
\end{DoxyParams}


Definition at line 911 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{911   \textcolor{keywordtype}{type}(group\_pass\_type),  \textcolor{keywordtype}{intent(inout)} :: group\textcolor{comment}{    !< The data type that store information for}}
\DoxyCodeLine{912 \textcolor{comment}{                                                    !! group update. This data will be used in}}
\DoxyCodeLine{913 \textcolor{comment}{                                                    !! do\_group\_pass.}}
\DoxyCodeLine{914 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:)},   \textcolor{keywordtype}{intent(inout)} :: array\textcolor{comment}{    !< The array which is having its halos points}}
\DoxyCodeLine{915 \textcolor{comment}{                                                    !! exchanged.}}
\DoxyCodeLine{916   \textcolor{keywordtype}{type}(MOM\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: MOM\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}}
\DoxyCodeLine{917 \textcolor{comment}{                                                    !! needed to determine where data should be}}
\DoxyCodeLine{918 \textcolor{comment}{                                                    !! sent.}}
\DoxyCodeLine{919   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: sideflag\textcolor{comment}{ !< An optional integer indicating which}}
\DoxyCodeLine{920 \textcolor{comment}{      !! directions the data should be sent. It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}}
\DoxyCodeLine{921 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH.  For example, TO\_EAST sends the data to the processor to the east,}}
\DoxyCodeLine{922 \textcolor{comment}{      !! so the halos on the western side are filled.  TO\_ALL is the default if sideflag is omitted.}}
\DoxyCodeLine{923   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: position\textcolor{comment}{ !< An optional argument indicating the position.}}
\DoxyCodeLine{924 \textcolor{comment}{                                                    !! This is CENTER by default and is often CORNER,}}
\DoxyCodeLine{925 \textcolor{comment}{                                                    !! but could also be EAST\_FACE or NORTH\_FACE.}}
\DoxyCodeLine{926   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}}
\DoxyCodeLine{927 \textcolor{comment}{                                                    !! halo by default.}}
\DoxyCodeLine{928   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}}
\DoxyCodeLine{929 \textcolor{comment}{                                                    !! started then stopped to time this routine.}}
\DoxyCodeLine{930   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{931   \textcolor{keywordtype}{integer} :: dirflag}
\DoxyCodeLine{932 }
\DoxyCodeLine{933   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_begin(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{934 }
\DoxyCodeLine{935   dirflag = to\_all \textcolor{comment}{! 60}}
\DoxyCodeLine{936   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(sideflag)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (sideflag > 0) dirflag = sideflag ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{937 }
\DoxyCodeLine{938   \textcolor{keywordflow}{if} (mpp\_group\_update\_initialized(group)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{939     \textcolor{keyword}{call }mpp\_reset\_group\_update\_field(group,array)}
\DoxyCodeLine{940   \textcolor{keywordflow}{elseif} (\textcolor{keyword}{present}(halo) .and. mom\_dom\%thin\_halo\_updates) \textcolor{keywordflow}{then}}
\DoxyCodeLine{941     \textcolor{keyword}{call }mpp\_create\_group\_update(group, array, mom\_dom\%mpp\_domain, flags=dirflag, \&}
\DoxyCodeLine{942                                  position=position, whalo=halo, ehalo=halo, \&}
\DoxyCodeLine{943                                  shalo=halo, nhalo=halo)}
\DoxyCodeLine{944   \textcolor{keywordflow}{else}}
\DoxyCodeLine{945     \textcolor{keyword}{call }mpp\_create\_group\_update(group, array, mom\_dom\%mpp\_domain, flags=dirflag, \&}
\DoxyCodeLine{946                                  position=position)}
\DoxyCodeLine{947 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{948 }
\DoxyCodeLine{949   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_end(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{950 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_a98e7ddef6138d57f457f05e6ebc326b0}\label{namespacemom__domains_a98e7ddef6138d57f457f05e6ebc326b0}} 
\index{mom\_domains@{mom\_domains}!create\_var\_group\_pass\_3d@{create\_var\_group\_pass\_3d}}
\index{create\_var\_group\_pass\_3d@{create\_var\_group\_pass\_3d}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{create\_var\_group\_pass\_3d()}{create\_var\_group\_pass\_3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+domains\+::create\+\_\+var\+\_\+group\+\_\+pass\+\_\+3d (\begin{DoxyParamCaption}\item[{type(group\+\_\+pass\+\_\+type), intent(inout)}]{group,  }\item[{real, dimension(\+:,\+:,\+:), intent(inout)}]{array,  }\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(inout)}]{M\+O\+M\+\_\+dom,  }\item[{integer, intent(in), optional}]{sideflag,  }\item[{integer, intent(in), optional}]{position,  }\item[{integer, intent(in), optional}]{halo,  }\item[{integer, intent(in), optional}]{clock }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



create\+\_\+var\+\_\+group\+\_\+pass\+\_\+3d sets up a group of three-\/dimensional array halo updates. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em group} & The data type that store information for group update. This data will be used in do\+\_\+group\+\_\+pass. \\
\hline
\mbox{\texttt{ in,out}}  & {\em array} & The array which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em mom\+\_\+dom} & The M\+O\+M\+\_\+domain\+\_\+type containing the mpp\+\_\+domain needed to determine where data should be sent. \\
\hline
\mbox{\texttt{ in}}  & {\em sideflag} & An optional integer indicating which directions the data should be sent. It is T\+O\+\_\+\+A\+LL or the sum of any of T\+O\+\_\+\+E\+A\+ST, T\+O\+\_\+\+W\+E\+ST, T\+O\+\_\+\+N\+O\+R\+TH, and T\+O\+\_\+\+S\+O\+U\+TH. For example, T\+O\+\_\+\+E\+A\+ST sends the data to the processor to the east, so the halos on the western side are filled. T\+O\+\_\+\+A\+LL is the default if sideflag is omitted. \\
\hline
\mbox{\texttt{ in}}  & {\em position} & An optional argument indicating the position. This is C\+E\+N\+T\+ER by default and is often C\+O\+R\+N\+ER, but could also be E\+A\+S\+T\+\_\+\+F\+A\+CE or N\+O\+R\+T\+H\+\_\+\+F\+A\+CE. \\
\hline
\mbox{\texttt{ in}}  & {\em halo} & The size of the halo to update -\/ the full halo by default. \\
\hline
\mbox{\texttt{ in}}  & {\em clock} & The handle for a cpu time clock that should be started then stopped to time this routine. \\
\hline
\end{DoxyParams}


Definition at line 956 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{956   \textcolor{keywordtype}{type}(group\_pass\_type),  \textcolor{keywordtype}{intent(inout)} :: group\textcolor{comment}{    !< The data type that store information for}}
\DoxyCodeLine{957 \textcolor{comment}{                                                    !! group update. This data will be used in}}
\DoxyCodeLine{958 \textcolor{comment}{                                                    !! do\_group\_pass.}}
\DoxyCodeLine{959 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: array\textcolor{comment}{    !< The array which is having its halos points}}
\DoxyCodeLine{960 \textcolor{comment}{                                                    !! exchanged.}}
\DoxyCodeLine{961   \textcolor{keywordtype}{type}(MOM\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: MOM\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}}
\DoxyCodeLine{962 \textcolor{comment}{                                                    !! needed to determine where data should be}}
\DoxyCodeLine{963 \textcolor{comment}{                                                    !! sent.}}
\DoxyCodeLine{964   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: sideflag\textcolor{comment}{ !< An optional integer indicating which}}
\DoxyCodeLine{965 \textcolor{comment}{      !! directions the data should be sent. It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}}
\DoxyCodeLine{966 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH.  For example, TO\_EAST sends the data to the processor to the east,}}
\DoxyCodeLine{967 \textcolor{comment}{      !! so the halos on the western side are filled.  TO\_ALL is the default if sideflag is omitted.}}
\DoxyCodeLine{968   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: position\textcolor{comment}{ !< An optional argument indicating the position.}}
\DoxyCodeLine{969 \textcolor{comment}{                                                    !! This is CENTER by default and is often CORNER,}}
\DoxyCodeLine{970 \textcolor{comment}{                                                    !! but could also be EAST\_FACE or NORTH\_FACE.}}
\DoxyCodeLine{971   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}}
\DoxyCodeLine{972 \textcolor{comment}{                                                    !! halo by default.}}
\DoxyCodeLine{973   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}}
\DoxyCodeLine{974 \textcolor{comment}{                                                    !! started then stopped to time this routine.}}
\DoxyCodeLine{975   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{976   \textcolor{keywordtype}{integer} :: dirflag}
\DoxyCodeLine{977 }
\DoxyCodeLine{978   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_begin(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{979 }
\DoxyCodeLine{980   dirflag = to\_all \textcolor{comment}{! 60}}
\DoxyCodeLine{981   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(sideflag)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (sideflag > 0) dirflag = sideflag ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{982 }
\DoxyCodeLine{983   \textcolor{keywordflow}{if} (mpp\_group\_update\_initialized(group)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{984     \textcolor{keyword}{call }mpp\_reset\_group\_update\_field(group,array)}
\DoxyCodeLine{985   \textcolor{keywordflow}{elseif} (\textcolor{keyword}{present}(halo) .and. mom\_dom\%thin\_halo\_updates) \textcolor{keywordflow}{then}}
\DoxyCodeLine{986     \textcolor{keyword}{call }mpp\_create\_group\_update(group, array, mom\_dom\%mpp\_domain, flags=dirflag, \&}
\DoxyCodeLine{987                                  position=position, whalo=halo, ehalo=halo, \&}
\DoxyCodeLine{988                                  shalo=halo, nhalo=halo)}
\DoxyCodeLine{989   \textcolor{keywordflow}{else}}
\DoxyCodeLine{990     \textcolor{keyword}{call }mpp\_create\_group\_update(group, array, mom\_dom\%mpp\_domain, flags=dirflag, \&}
\DoxyCodeLine{991                                  position=position)}
\DoxyCodeLine{992 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{993 }
\DoxyCodeLine{994   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_end(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{995 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_a71883f8a7b981797b20b83ca277d32dd}\label{namespacemom__domains_a71883f8a7b981797b20b83ca277d32dd}} 
\index{mom\_domains@{mom\_domains}!create\_vector\_group\_pass\_2d@{create\_vector\_group\_pass\_2d}}
\index{create\_vector\_group\_pass\_2d@{create\_vector\_group\_pass\_2d}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{create\_vector\_group\_pass\_2d()}{create\_vector\_group\_pass\_2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+domains\+::create\+\_\+vector\+\_\+group\+\_\+pass\+\_\+2d (\begin{DoxyParamCaption}\item[{type(group\+\_\+pass\+\_\+type), intent(inout)}]{group,  }\item[{real, dimension(\+:,\+:), intent(inout)}]{u\+\_\+cmpt,  }\item[{real, dimension(\+:,\+:), intent(inout)}]{v\+\_\+cmpt,  }\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(inout)}]{M\+O\+M\+\_\+dom,  }\item[{integer, intent(in), optional}]{direction,  }\item[{integer, intent(in), optional}]{stagger,  }\item[{integer, intent(in), optional}]{halo,  }\item[{integer, intent(in), optional}]{clock }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



create\+\_\+vector\+\_\+group\+\_\+pass\+\_\+2d sets up a group of two-\/dimensional vector halo updates. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em group} & The data type that store information for group update. This data will be used in do\+\_\+group\+\_\+pass. \\
\hline
\mbox{\texttt{ in,out}}  & {\em u\+\_\+cmpt} & The nominal zonal (u) component of the vector pair which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em v\+\_\+cmpt} & The nominal meridional (v) component of the vector pair which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em mom\+\_\+dom} & The M\+O\+M\+\_\+domain\+\_\+type containing the mpp\+\_\+domain needed to determine where data should be sent \\
\hline
\mbox{\texttt{ in}}  & {\em direction} & An optional integer indicating which directions the data should be sent. It is T\+O\+\_\+\+A\+LL or the sum of any of T\+O\+\_\+\+E\+A\+ST, T\+O\+\_\+\+W\+E\+ST, T\+O\+\_\+\+N\+O\+R\+TH, and T\+O\+\_\+\+S\+O\+U\+TH, possibly plus S\+C\+A\+L\+A\+R\+\_\+\+P\+A\+IR if these are paired non-\/directional scalars discretized at the typical vector component locations. For example, T\+O\+\_\+\+E\+A\+ST sends the data to the processor to the east, so the halos on the western side are filled. T\+O\+\_\+\+A\+LL is the default if omitted. \\
\hline
\mbox{\texttt{ in}}  & {\em stagger} & An optional flag, which may be one of A\+\_\+\+G\+R\+ID, B\+G\+R\+I\+D\+\_\+\+NE, or C\+G\+R\+I\+D\+\_\+\+NE, indicating where the two components of the vector are discretized. Omitting stagger is the same as setting it to C\+G\+R\+I\+D\+\_\+\+NE. \\
\hline
\mbox{\texttt{ in}}  & {\em halo} & The size of the halo to update -\/ the full halo by default. \\
\hline
\mbox{\texttt{ in}}  & {\em clock} & The handle for a cpu time clock that should be started then stopped to time this routine. \\
\hline
\end{DoxyParams}


Definition at line 1001 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1001   \textcolor{keywordtype}{type}(group\_pass\_type),  \textcolor{keywordtype}{intent(inout)} :: group\textcolor{comment}{    !< The data type that store information for}}
\DoxyCodeLine{1002 \textcolor{comment}{                                                    !! group update. This data will be used in}}
\DoxyCodeLine{1003 \textcolor{comment}{                                                    !! do\_group\_pass.}}
\DoxyCodeLine{1004 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:)},   \textcolor{keywordtype}{intent(inout)} :: u\_cmpt\textcolor{comment}{   !< The nominal zonal (u) component of the vector}}
\DoxyCodeLine{1005 \textcolor{comment}{                                                    !! pair which is having its halos points}}
\DoxyCodeLine{1006 \textcolor{comment}{                                                    !! exchanged.}}
\DoxyCodeLine{1007 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:)},   \textcolor{keywordtype}{intent(inout)} :: v\_cmpt\textcolor{comment}{   !< The nominal meridional (v) component of the}}
\DoxyCodeLine{1008 \textcolor{comment}{                                                    !! vector pair which is having its halos points}}
\DoxyCodeLine{1009 \textcolor{comment}{                                                    !! exchanged.}}
\DoxyCodeLine{1010 }
\DoxyCodeLine{1011   \textcolor{keywordtype}{type}(MOM\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: MOM\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}}
\DoxyCodeLine{1012 \textcolor{comment}{                                                    !! needed to determine where data should be}}
\DoxyCodeLine{1013 \textcolor{comment}{                                                    !! sent}}
\DoxyCodeLine{1014   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< An optional integer indicating which}}
\DoxyCodeLine{1015 \textcolor{comment}{      !! directions the data should be sent.  It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}}
\DoxyCodeLine{1016 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH, possibly plus SCALAR\_PAIR if these are paired non-directional}}
\DoxyCodeLine{1017 \textcolor{comment}{      !! scalars discretized at the typical vector component locations.  For example, TO\_EAST sends}}
\DoxyCodeLine{1018 \textcolor{comment}{      !! the data to the processor to the east, so the halos on the western side are filled. TO\_ALL}}
\DoxyCodeLine{1019 \textcolor{comment}{      !! is the default if omitted.}}
\DoxyCodeLine{1020   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: stagger\textcolor{comment}{  !< An optional flag, which may be one of A\_GRID,}}
\DoxyCodeLine{1021 \textcolor{comment}{                     !! BGRID\_NE, or CGRID\_NE, indicating where the two components of the vector are}}
\DoxyCodeLine{1022 \textcolor{comment}{                     !! discretized. Omitting stagger is the same as setting it to CGRID\_NE.}}
\DoxyCodeLine{1023   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}}
\DoxyCodeLine{1024 \textcolor{comment}{                                                    !! halo by default.}}
\DoxyCodeLine{1025   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}}
\DoxyCodeLine{1026 \textcolor{comment}{                                                    !! started then stopped to time this routine.}}
\DoxyCodeLine{1027   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{1028   \textcolor{keywordtype}{integer} :: stagger\_local}
\DoxyCodeLine{1029   \textcolor{keywordtype}{integer} :: dirflag}
\DoxyCodeLine{1030 }
\DoxyCodeLine{1031   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_begin(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1032 }
\DoxyCodeLine{1033   stagger\_local = cgrid\_ne \textcolor{comment}{! Default value for type of grid}}
\DoxyCodeLine{1034   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stagger)) stagger\_local = stagger}
\DoxyCodeLine{1035 }
\DoxyCodeLine{1036   dirflag = to\_all \textcolor{comment}{! 60}}
\DoxyCodeLine{1037   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(direction)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (direction > 0) dirflag = direction ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1038 }
\DoxyCodeLine{1039   \textcolor{keywordflow}{if} (mpp\_group\_update\_initialized(group)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1040     \textcolor{keyword}{call }mpp\_reset\_group\_update\_field(group,u\_cmpt, v\_cmpt)}
\DoxyCodeLine{1041   \textcolor{keywordflow}{elseif} (\textcolor{keyword}{present}(halo) .and. mom\_dom\%thin\_halo\_updates) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1042     \textcolor{keyword}{call }mpp\_create\_group\_update(group, u\_cmpt, v\_cmpt, mom\_dom\%mpp\_domain, \&}
\DoxyCodeLine{1043             flags=dirflag, gridtype=stagger\_local, whalo=halo, ehalo=halo, \&}
\DoxyCodeLine{1044             shalo=halo, nhalo=halo)}
\DoxyCodeLine{1045   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1046     \textcolor{keyword}{call }mpp\_create\_group\_update(group, u\_cmpt, v\_cmpt, mom\_dom\%mpp\_domain, \&}
\DoxyCodeLine{1047             flags=dirflag, gridtype=stagger\_local)}
\DoxyCodeLine{1048 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1049 }
\DoxyCodeLine{1050   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_end(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1051 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_aa224a5c2409ffe99157e4cc51e979cf4}\label{namespacemom__domains_aa224a5c2409ffe99157e4cc51e979cf4}} 
\index{mom\_domains@{mom\_domains}!create\_vector\_group\_pass\_3d@{create\_vector\_group\_pass\_3d}}
\index{create\_vector\_group\_pass\_3d@{create\_vector\_group\_pass\_3d}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{create\_vector\_group\_pass\_3d()}{create\_vector\_group\_pass\_3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+domains\+::create\+\_\+vector\+\_\+group\+\_\+pass\+\_\+3d (\begin{DoxyParamCaption}\item[{type(group\+\_\+pass\+\_\+type), intent(inout)}]{group,  }\item[{real, dimension(\+:,\+:,\+:), intent(inout)}]{u\+\_\+cmpt,  }\item[{real, dimension(\+:,\+:,\+:), intent(inout)}]{v\+\_\+cmpt,  }\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(inout)}]{M\+O\+M\+\_\+dom,  }\item[{integer, intent(in), optional}]{direction,  }\item[{integer, intent(in), optional}]{stagger,  }\item[{integer, intent(in), optional}]{halo,  }\item[{integer, intent(in), optional}]{clock }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



create\+\_\+vector\+\_\+group\+\_\+pass\+\_\+3d sets up a group of three-\/dimensional vector halo updates. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em group} & The data type that store information for group update. This data will be used in do\+\_\+group\+\_\+pass. \\
\hline
\mbox{\texttt{ in,out}}  & {\em u\+\_\+cmpt} & The nominal zonal (u) component of the vector pair which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em v\+\_\+cmpt} & The nominal meridional (v) component of the vector pair which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em mom\+\_\+dom} & The M\+O\+M\+\_\+domain\+\_\+type containing the mpp\+\_\+domain needed to determine where data should be sent. \\
\hline
\mbox{\texttt{ in}}  & {\em direction} & An optional integer indicating which directions the data should be sent. It is T\+O\+\_\+\+A\+LL or the sum of any of T\+O\+\_\+\+E\+A\+ST, T\+O\+\_\+\+W\+E\+ST, T\+O\+\_\+\+N\+O\+R\+TH, and T\+O\+\_\+\+S\+O\+U\+TH, possibly plus S\+C\+A\+L\+A\+R\+\_\+\+P\+A\+IR if these are paired non-\/directional scalars discretized at the typical vector component locations. For example, T\+O\+\_\+\+E\+A\+ST sends the data to the processor to the east, so the halos on the western side are filled. T\+O\+\_\+\+A\+LL is the default if omitted. \\
\hline
\mbox{\texttt{ in}}  & {\em stagger} & An optional flag, which may be one of A\+\_\+\+G\+R\+ID, B\+G\+R\+I\+D\+\_\+\+NE, or C\+G\+R\+I\+D\+\_\+\+NE, indicating where the two components of the vector are discretized. Omitting stagger is the same as setting it to C\+G\+R\+I\+D\+\_\+\+NE. \\
\hline
\mbox{\texttt{ in}}  & {\em halo} & The size of the halo to update -\/ the full halo by default. \\
\hline
\mbox{\texttt{ in}}  & {\em clock} & The handle for a cpu time clock that should be started then stopped to time this routine. \\
\hline
\end{DoxyParams}


Definition at line 1057 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1057   \textcolor{keywordtype}{type}(group\_pass\_type),  \textcolor{keywordtype}{intent(inout)} :: group\textcolor{comment}{    !< The data type that store information for}}
\DoxyCodeLine{1058 \textcolor{comment}{                                                    !! group update. This data will be used in}}
\DoxyCodeLine{1059 \textcolor{comment}{                                                    !! do\_group\_pass.}}
\DoxyCodeLine{1060 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: u\_cmpt\textcolor{comment}{   !< The nominal zonal (u) component of the vector}}
\DoxyCodeLine{1061 \textcolor{comment}{                                                    !! pair which is having its halos points}}
\DoxyCodeLine{1062 \textcolor{comment}{                                                    !! exchanged.}}
\DoxyCodeLine{1063 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: v\_cmpt\textcolor{comment}{   !< The nominal meridional (v) component of the}}
\DoxyCodeLine{1064 \textcolor{comment}{                                                    !! vector pair which is having its halos points}}
\DoxyCodeLine{1065 \textcolor{comment}{                                                    !! exchanged.}}
\DoxyCodeLine{1066 }
\DoxyCodeLine{1067   \textcolor{keywordtype}{type}(MOM\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: MOM\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}}
\DoxyCodeLine{1068 \textcolor{comment}{                                                    !! needed to determine where data should be}}
\DoxyCodeLine{1069 \textcolor{comment}{                                                    !! sent.}}
\DoxyCodeLine{1070   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< An optional integer indicating which}}
\DoxyCodeLine{1071 \textcolor{comment}{      !! directions the data should be sent.  It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}}
\DoxyCodeLine{1072 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH, possibly plus SCALAR\_PAIR if these are paired non-directional}}
\DoxyCodeLine{1073 \textcolor{comment}{      !! scalars discretized at the typical vector component locations.  For example, TO\_EAST sends}}
\DoxyCodeLine{1074 \textcolor{comment}{      !! the data to the processor to the east, so the halos on the western side are filled. TO\_ALL}}
\DoxyCodeLine{1075 \textcolor{comment}{      !! is the default if omitted.}}
\DoxyCodeLine{1076   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: stagger\textcolor{comment}{  !< An optional flag, which may be one of A\_GRID,}}
\DoxyCodeLine{1077 \textcolor{comment}{                     !! BGRID\_NE, or CGRID\_NE, indicating where the two components of the vector are}}
\DoxyCodeLine{1078 \textcolor{comment}{                     !! discretized. Omitting stagger is the same as setting it to CGRID\_NE.}}
\DoxyCodeLine{1079   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}}
\DoxyCodeLine{1080 \textcolor{comment}{                                                    !! halo by default.}}
\DoxyCodeLine{1081   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}}
\DoxyCodeLine{1082 \textcolor{comment}{                                                    !! started then stopped to time this routine.}}
\DoxyCodeLine{1083 }
\DoxyCodeLine{1084   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{1085   \textcolor{keywordtype}{integer} :: stagger\_local}
\DoxyCodeLine{1086   \textcolor{keywordtype}{integer} :: dirflag}
\DoxyCodeLine{1087 }
\DoxyCodeLine{1088   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_begin(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1089 }
\DoxyCodeLine{1090   stagger\_local = cgrid\_ne \textcolor{comment}{! Default value for type of grid}}
\DoxyCodeLine{1091   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stagger)) stagger\_local = stagger}
\DoxyCodeLine{1092 }
\DoxyCodeLine{1093   dirflag = to\_all \textcolor{comment}{! 60}}
\DoxyCodeLine{1094   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(direction)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (direction > 0) dirflag = direction ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1095 }
\DoxyCodeLine{1096   \textcolor{keywordflow}{if} (mpp\_group\_update\_initialized(group)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1097     \textcolor{keyword}{call }mpp\_reset\_group\_update\_field(group,u\_cmpt, v\_cmpt)}
\DoxyCodeLine{1098   \textcolor{keywordflow}{elseif} (\textcolor{keyword}{present}(halo) .and. mom\_dom\%thin\_halo\_updates) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1099     \textcolor{keyword}{call }mpp\_create\_group\_update(group, u\_cmpt, v\_cmpt, mom\_dom\%mpp\_domain, \&}
\DoxyCodeLine{1100             flags=dirflag, gridtype=stagger\_local, whalo=halo, ehalo=halo, \&}
\DoxyCodeLine{1101             shalo=halo, nhalo=halo)}
\DoxyCodeLine{1102   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1103     \textcolor{keyword}{call }mpp\_create\_group\_update(group, u\_cmpt, v\_cmpt, mom\_dom\%mpp\_domain, \&}
\DoxyCodeLine{1104             flags=dirflag, gridtype=stagger\_local)}
\DoxyCodeLine{1105 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1106 }
\DoxyCodeLine{1107   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_end(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1108 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_aac3bc012a8c214cbd73bb00668ff165e}\label{namespacemom__domains_aac3bc012a8c214cbd73bb00668ff165e}} 
\index{mom\_domains@{mom\_domains}!do\_group\_pass@{do\_group\_pass}}
\index{do\_group\_pass@{do\_group\_pass}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{do\_group\_pass()}{do\_group\_pass()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+domains\+::do\+\_\+group\+\_\+pass (\begin{DoxyParamCaption}\item[{type(group\+\_\+pass\+\_\+type), intent(inout)}]{group,  }\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(inout)}]{M\+O\+M\+\_\+dom,  }\item[{integer, intent(in), optional}]{clock }\end{DoxyParamCaption})}



do\+\_\+group\+\_\+pass carries out a group halo update. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em group} & The data type that store information for group update. This data will be used in do\+\_\+group\+\_\+pass. \\
\hline
\mbox{\texttt{ in,out}}  & {\em mom\+\_\+dom} & The M\+O\+M\+\_\+domain\+\_\+type containing the mpp\+\_\+domain needed to determine where data should be sent. \\
\hline
\mbox{\texttt{ in}}  & {\em clock} & The handle for a cpu time clock that should be started then stopped to time this routine. \\
\hline
\end{DoxyParams}


Definition at line 1113 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1113   \textcolor{keywordtype}{type}(group\_pass\_type), \textcolor{keywordtype}{intent(inout)} :: group\textcolor{comment}{     !< The data type that store information for}}
\DoxyCodeLine{1114 \textcolor{comment}{                                                    !! group update. This data will be used in}}
\DoxyCodeLine{1115 \textcolor{comment}{                                                    !! do\_group\_pass.}}
\DoxyCodeLine{1116   \textcolor{keywordtype}{type}(MOM\_domain\_type), \textcolor{keywordtype}{intent(inout)} :: MOM\_dom\textcolor{comment}{   !< The MOM\_domain\_type containing the mpp\_domain}}
\DoxyCodeLine{1117 \textcolor{comment}{                                                    !! needed to determine where data should be}}
\DoxyCodeLine{1118 \textcolor{comment}{                                                    !! sent.}}
\DoxyCodeLine{1119   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}}
\DoxyCodeLine{1120 \textcolor{comment}{                                                    !! started then stopped to time this routine.}}
\DoxyCodeLine{1121 \textcolor{keywordtype}{  real} :: d\_type}
\DoxyCodeLine{1122 }
\DoxyCodeLine{1123   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_begin(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1124 }
\DoxyCodeLine{1125   \textcolor{keyword}{call }mpp\_do\_group\_update(group, mom\_dom\%mpp\_domain, d\_type)}
\DoxyCodeLine{1126 }
\DoxyCodeLine{1127   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_end(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1128 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_a3ad88dc636a6d2d6092332235f99f9b8}\label{namespacemom__domains_a3ad88dc636a6d2d6092332235f99f9b8}} 
\index{mom\_domains@{mom\_domains}!fill\_vector\_symmetric\_edges\_2d@{fill\_vector\_symmetric\_edges\_2d}}
\index{fill\_vector\_symmetric\_edges\_2d@{fill\_vector\_symmetric\_edges\_2d}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{fill\_vector\_symmetric\_edges\_2d()}{fill\_vector\_symmetric\_edges\_2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+domains\+::fill\+\_\+vector\+\_\+symmetric\+\_\+edges\+\_\+2d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:), intent(inout)}]{u\+\_\+cmpt,  }\item[{real, dimension(\+:,\+:), intent(inout)}]{v\+\_\+cmpt,  }\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(inout)}]{M\+O\+M\+\_\+dom,  }\item[{integer, intent(in), optional}]{stagger,  }\item[{logical, intent(in), optional}]{scalar,  }\item[{integer, intent(in), optional}]{clock }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



fill\+\_\+vector\+\_\+symmetric\+\_\+edges\+\_\+2d does an usual set of halo updates that only fill in the values at the edge of a pair of symmetric memory two-\/dimensional arrays representing the compontents of a two-\/dimensional horizontal vector. If symmetric memory is not being used, this subroutine does nothing except to possibly turn optional cpu clocks on or off. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em u\+\_\+cmpt} & The nominal zonal (u) component of the vector pair which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em v\+\_\+cmpt} & The nominal meridional (v) component of the vector pair which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em mom\+\_\+dom} & The M\+O\+M\+\_\+domain\+\_\+type containing the mpp\+\_\+domain needed to determine where data should be sent. \\
\hline
\mbox{\texttt{ in}}  & {\em stagger} & An optional flag, which may be one of A\+\_\+\+G\+R\+ID, B\+G\+R\+I\+D\+\_\+\+NE, or C\+G\+R\+I\+D\+\_\+\+NE, indicating where the two components of the vector are discretized. Omitting stagger is the same as setting it to C\+G\+R\+I\+D\+\_\+\+NE. \\
\hline
\mbox{\texttt{ in}}  & {\em scalar} & An optional argument indicating whether. \\
\hline
\mbox{\texttt{ in}}  & {\em clock} & The handle for a cpu time clock that should be started then stopped to time this routine. \\
\hline
\end{DoxyParams}


Definition at line 548 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{548 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:)},  \textcolor{keywordtype}{intent(inout)} :: u\_cmpt\textcolor{comment}{  !< The nominal zonal (u) component of the vector}}
\DoxyCodeLine{549 \textcolor{comment}{                                                  !! pair which is having its halos points}}
\DoxyCodeLine{550 \textcolor{comment}{                                                  !! exchanged.}}
\DoxyCodeLine{551 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:)},  \textcolor{keywordtype}{intent(inout)} :: v\_cmpt\textcolor{comment}{  !< The nominal meridional (v) component of the}}
\DoxyCodeLine{552 \textcolor{comment}{                                                  !! vector pair which is having its halos points}}
\DoxyCodeLine{553 \textcolor{comment}{                                                  !! exchanged.}}
\DoxyCodeLine{554   \textcolor{keywordtype}{type}(MOM\_domain\_type), \textcolor{keywordtype}{intent(inout)} :: MOM\_dom\textcolor{comment}{ !< The MOM\_domain\_type containing the mpp\_domain}}
\DoxyCodeLine{555 \textcolor{comment}{                                                  !! needed to determine where data should be}}
\DoxyCodeLine{556 \textcolor{comment}{                                                  !! sent.}}
\DoxyCodeLine{557   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: stagger\textcolor{comment}{ !< An optional flag, which may be one of A\_GRID,}}
\DoxyCodeLine{558 \textcolor{comment}{                     !! BGRID\_NE, or CGRID\_NE, indicating where the two components of the vector are}}
\DoxyCodeLine{559 \textcolor{comment}{                     !! discretized. Omitting stagger is the same as setting it to CGRID\_NE.}}
\DoxyCodeLine{560   \textcolor{keywordtype}{logical},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scalar\textcolor{comment}{  !< An optional argument indicating whether.}}
\DoxyCodeLine{561   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}}
\DoxyCodeLine{562 \textcolor{comment}{                                                   !! started then stopped to time this routine.}}
\DoxyCodeLine{563 }
\DoxyCodeLine{564   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{565   \textcolor{keywordtype}{integer} :: stagger\_local}
\DoxyCodeLine{566   \textcolor{keywordtype}{integer} :: dirflag}
\DoxyCodeLine{567   \textcolor{keywordtype}{integer} :: i, j, isc, iec, jsc, jec, isd, ied, jsd, jed, IscB, IecB, JscB, JecB}
\DoxyCodeLine{568 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{dimension(:)} :: sbuff\_x, sbuff\_y, wbuff\_x, wbuff\_y}
\DoxyCodeLine{569   \textcolor{keywordtype}{logical} :: block\_til\_complete}
\DoxyCodeLine{570 }
\DoxyCodeLine{571   \textcolor{keywordflow}{if} (.not. mom\_dom\%symmetric) \textcolor{keywordflow}{then}}
\DoxyCodeLine{572       \textcolor{keywordflow}{return}}
\DoxyCodeLine{573 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{574 }
\DoxyCodeLine{575   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_begin(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{576 }
\DoxyCodeLine{577   stagger\_local = cgrid\_ne \textcolor{comment}{! Default value for type of grid}}
\DoxyCodeLine{578   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stagger)) stagger\_local = stagger}
\DoxyCodeLine{579 }
\DoxyCodeLine{580   \textcolor{keywordflow}{if} (.not.(stagger\_local == cgrid\_ne .or. stagger\_local == bgrid\_ne)) \textcolor{keywordflow}{return}}
\DoxyCodeLine{581 }
\DoxyCodeLine{582   \textcolor{keyword}{call }mpp\_get\_compute\_domain(mom\_dom\%mpp\_domain, isc, iec, jsc, jec)}
\DoxyCodeLine{583   \textcolor{keyword}{call }mpp\_get\_data\_domain(mom\_dom\%mpp\_domain, isd, ied, jsd, jed)}
\DoxyCodeLine{584 }
\DoxyCodeLine{585   \textcolor{comment}{! Adjust isc, etc., to account for the fact that the input arrays indices all}}
\DoxyCodeLine{586   \textcolor{comment}{! start at 1 (and are effectively on a SW grid!).}}
\DoxyCodeLine{587   isc = isc - (isd-1) ; iec = iec - (isd-1)}
\DoxyCodeLine{588   jsc = jsc - (jsd-1) ; jec = jec - (jsd-1)}
\DoxyCodeLine{589   iscb = isc ; iecb = iec+1 ; jscb = jsc ; jecb = jec+1}
\DoxyCodeLine{590 }
\DoxyCodeLine{591   dirflag = to\_all \textcolor{comment}{! 60}}
\DoxyCodeLine{592   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scalar)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (scalar) dirflag = to\_all+scalar\_pair ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{593 }
\DoxyCodeLine{594   \textcolor{keywordflow}{if} (stagger\_local == cgrid\_ne) \textcolor{keywordflow}{then}}
\DoxyCodeLine{595     \textcolor{keyword}{allocate}(wbuff\_x(jsc:jec)) ; \textcolor{keyword}{allocate}(sbuff\_y(isc:iec))}
\DoxyCodeLine{596     wbuff\_x(:) = 0.0 ; sbuff\_y(:) = 0.0}
\DoxyCodeLine{597     \textcolor{keyword}{call }mpp\_get\_boundary(u\_cmpt, v\_cmpt, mom\_dom\%mpp\_domain, flags=dirflag, \&}
\DoxyCodeLine{598                           wbufferx=wbuff\_x, sbuffery=sbuff\_y, \&}
\DoxyCodeLine{599                           gridtype=cgrid\_ne)}
\DoxyCodeLine{600     \textcolor{keywordflow}{do} i=isc,iec}
\DoxyCodeLine{601       v\_cmpt(i,jscb) = sbuff\_y(i)}
\DoxyCodeLine{602 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{603     \textcolor{keywordflow}{do} j=jsc,jec}
\DoxyCodeLine{604       u\_cmpt(iscb,j) = wbuff\_x(j)}
\DoxyCodeLine{605 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{606     \textcolor{keyword}{deallocate}(wbuff\_x) ; \textcolor{keyword}{deallocate}(sbuff\_y)}
\DoxyCodeLine{607   \textcolor{keywordflow}{elseif}  (stagger\_local == bgrid\_ne) \textcolor{keywordflow}{then}}
\DoxyCodeLine{608     \textcolor{keyword}{allocate}(wbuff\_x(jscb:jecb)) ; \textcolor{keyword}{allocate}(sbuff\_x(iscb:iecb))}
\DoxyCodeLine{609     \textcolor{keyword}{allocate}(wbuff\_y(jscb:jecb)) ; \textcolor{keyword}{allocate}(sbuff\_y(iscb:iecb))}
\DoxyCodeLine{610     wbuff\_x(:) = 0.0 ; wbuff\_y(:) = 0.0 ; sbuff\_x(:) = 0.0 ; sbuff\_y(:) = 0.0}
\DoxyCodeLine{611     \textcolor{keyword}{call }mpp\_get\_boundary(u\_cmpt, v\_cmpt, mom\_dom\%mpp\_domain, flags=dirflag, \&}
\DoxyCodeLine{612                           wbufferx=wbuff\_x, sbufferx=sbuff\_x, \&}
\DoxyCodeLine{613                           wbuffery=wbuff\_y, sbuffery=sbuff\_y, \&}
\DoxyCodeLine{614                           gridtype=bgrid\_ne)}
\DoxyCodeLine{615     \textcolor{keywordflow}{do} i=iscb,iecb}
\DoxyCodeLine{616       u\_cmpt(i,jscb) = sbuff\_x(i) ; v\_cmpt(i,jscb) = sbuff\_y(i)}
\DoxyCodeLine{617 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{618     \textcolor{keywordflow}{do} j=jscb,jecb}
\DoxyCodeLine{619       u\_cmpt(iscb,j) = wbuff\_x(j) ; v\_cmpt(iscb,j) = wbuff\_y(j)}
\DoxyCodeLine{620 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{621     \textcolor{keyword}{deallocate}(wbuff\_x) ; \textcolor{keyword}{deallocate}(sbuff\_x)}
\DoxyCodeLine{622     \textcolor{keyword}{deallocate}(wbuff\_y) ; \textcolor{keyword}{deallocate}(sbuff\_y)}
\DoxyCodeLine{623 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{624 }
\DoxyCodeLine{625   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_end(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{626 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_a1f1063ac5a049926d4ad00b43752aee6}\label{namespacemom__domains_a1f1063ac5a049926d4ad00b43752aee6}} 
\index{mom\_domains@{mom\_domains}!get\_domain\_extent@{get\_domain\_extent}}
\index{get\_domain\_extent@{get\_domain\_extent}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{get\_domain\_extent()}{get\_domain\_extent()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+domains\+::get\+\_\+domain\+\_\+extent (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(in)}]{Domain,  }\item[{integer, intent(out)}]{isc,  }\item[{integer, intent(out)}]{iec,  }\item[{integer, intent(out)}]{jsc,  }\item[{integer, intent(out)}]{jec,  }\item[{integer, intent(out)}]{isd,  }\item[{integer, intent(out)}]{ied,  }\item[{integer, intent(out)}]{jsd,  }\item[{integer, intent(out)}]{jed,  }\item[{integer, intent(out)}]{isg,  }\item[{integer, intent(out)}]{ieg,  }\item[{integer, intent(out)}]{jsg,  }\item[{integer, intent(out)}]{jeg,  }\item[{integer, intent(out)}]{idg\+\_\+offset,  }\item[{integer, intent(out)}]{jdg\+\_\+offset,  }\item[{logical, intent(out)}]{symmetric,  }\item[{logical, intent(in), optional}]{local\+\_\+indexing,  }\item[{integer, intent(in), optional}]{index\+\_\+offset }\end{DoxyParamCaption})}



Returns various data that has been stored in a M\+O\+M\+\_\+domain\+\_\+type. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em domain} & The M\+OM domain from which to extract information \\
\hline
\mbox{\texttt{ out}}  & {\em isc} & The start i-\/index of the computational domain \\
\hline
\mbox{\texttt{ out}}  & {\em iec} & The end i-\/index of the computational domain \\
\hline
\mbox{\texttt{ out}}  & {\em jsc} & The start j-\/index of the computational domain \\
\hline
\mbox{\texttt{ out}}  & {\em jec} & The end j-\/index of the computational domain \\
\hline
\mbox{\texttt{ out}}  & {\em isd} & The start i-\/index of the data domain \\
\hline
\mbox{\texttt{ out}}  & {\em ied} & The end i-\/index of the data domain \\
\hline
\mbox{\texttt{ out}}  & {\em jsd} & The start j-\/index of the data domain \\
\hline
\mbox{\texttt{ out}}  & {\em jed} & The end j-\/index of the data domain \\
\hline
\mbox{\texttt{ out}}  & {\em isg} & The start i-\/index of the global domain \\
\hline
\mbox{\texttt{ out}}  & {\em ieg} & The end i-\/index of the global domain \\
\hline
\mbox{\texttt{ out}}  & {\em jsg} & The start j-\/index of the global domain \\
\hline
\mbox{\texttt{ out}}  & {\em jeg} & The end j-\/index of the global domain \\
\hline
\mbox{\texttt{ out}}  & {\em idg\+\_\+offset} & The offset between the corresponding global and data i-\/index spaces. \\
\hline
\mbox{\texttt{ out}}  & {\em jdg\+\_\+offset} & The offset between the corresponding global and data j-\/index spaces. \\
\hline
\mbox{\texttt{ out}}  & {\em symmetric} & True if symmetric memory is used. \\
\hline
\mbox{\texttt{ in}}  & {\em local\+\_\+indexing} & If true, local tracer array indices start at 1, as in most M\+O\+M6 code. \\
\hline
\mbox{\texttt{ in}}  & {\em index\+\_\+offset} & A fixed additional offset to all indices. This can be useful for some types of debugging with dynamic memory allocation. \\
\hline
\end{DoxyParams}


Definition at line 1815 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1815   \textcolor{keywordtype}{type}(MOM\_domain\_type), \&}
\DoxyCodeLine{1816            \textcolor{keywordtype}{intent(in)}  :: Domain\textcolor{comment}{ !< The MOM domain from which to extract information}}
\DoxyCodeLine{1817   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: isc\textcolor{comment}{    !< The start i-index of the computational domain}}
\DoxyCodeLine{1818   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: iec\textcolor{comment}{    !< The end i-index of the computational domain}}
\DoxyCodeLine{1819   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jsc\textcolor{comment}{    !< The start j-index of the computational domain}}
\DoxyCodeLine{1820   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jec\textcolor{comment}{    !< The end j-index of the computational domain}}
\DoxyCodeLine{1821   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: isd\textcolor{comment}{    !< The start i-index of the data domain}}
\DoxyCodeLine{1822   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: ied\textcolor{comment}{    !< The end i-index of the data domain}}
\DoxyCodeLine{1823   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jsd\textcolor{comment}{    !< The start j-index of the data domain}}
\DoxyCodeLine{1824   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jed\textcolor{comment}{    !< The end j-index of the data domain}}
\DoxyCodeLine{1825   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: isg\textcolor{comment}{    !< The start i-index of the global domain}}
\DoxyCodeLine{1826   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: ieg\textcolor{comment}{    !< The end i-index of the global domain}}
\DoxyCodeLine{1827   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jsg\textcolor{comment}{    !< The start j-index of the global domain}}
\DoxyCodeLine{1828   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jeg\textcolor{comment}{    !< The end j-index of the global domain}}
\DoxyCodeLine{1829   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: idg\_offset\textcolor{comment}{ !< The offset between the corresponding global and}}
\DoxyCodeLine{1830 \textcolor{comment}{                                 !! data i-index spaces.}}
\DoxyCodeLine{1831   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jdg\_offset\textcolor{comment}{ !< The offset between the corresponding global and}}
\DoxyCodeLine{1832 \textcolor{comment}{                                 !! data j-index spaces.}}
\DoxyCodeLine{1833   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)} :: symmetric\textcolor{comment}{  !< True if symmetric memory is used.}}
\DoxyCodeLine{1834   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: local\_indexing\textcolor{comment}{ !< If true, local tracer array indices start at 1,}}
\DoxyCodeLine{1835 \textcolor{comment}{                                           !! as in most MOM6 code.}}
\DoxyCodeLine{1836   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: index\_offset\textcolor{comment}{   !< A fixed additional offset to all indices. This}}
\DoxyCodeLine{1837 \textcolor{comment}{                                           !! can be useful for some types of debugging with}}
\DoxyCodeLine{1838 \textcolor{comment}{                                           !! dynamic memory allocation.}}
\DoxyCodeLine{1839   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{1840   \textcolor{keywordtype}{integer} :: ind\_off}
\DoxyCodeLine{1841   \textcolor{keywordtype}{logical} :: local}
\DoxyCodeLine{1842 }
\DoxyCodeLine{1843   local = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(local\_indexing)) local = local\_indexing}
\DoxyCodeLine{1844   ind\_off = 0 ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(index\_offset)) ind\_off = index\_offset}
\DoxyCodeLine{1845 }
\DoxyCodeLine{1846   \textcolor{keyword}{call }mpp\_get\_compute\_domain(domain\%mpp\_domain, isc, iec, jsc, jec)}
\DoxyCodeLine{1847   \textcolor{keyword}{call }mpp\_get\_data\_domain(domain\%mpp\_domain, isd, ied, jsd, jed)}
\DoxyCodeLine{1848   \textcolor{keyword}{call }mpp\_get\_global\_domain(domain\%mpp\_domain, isg, ieg, jsg, jeg)}
\DoxyCodeLine{1849 }
\DoxyCodeLine{1850   \textcolor{comment}{! This code institutes the MOM convention that local array indices start at 1.}}
\DoxyCodeLine{1851   \textcolor{keywordflow}{if} (local) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1852     idg\_offset = isd-1 ; jdg\_offset = jsd-1}
\DoxyCodeLine{1853     isc = isc-isd+1 ; iec = iec-isd+1 ; jsc = jsc-jsd+1 ; jec = jec-jsd+1}
\DoxyCodeLine{1854     ied = ied-isd+1 ; jed = jed-jsd+1}
\DoxyCodeLine{1855     isd = 1 ; jsd = 1}
\DoxyCodeLine{1856   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1857     idg\_offset = 0 ; jdg\_offset = 0}
\DoxyCodeLine{1858 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1859   \textcolor{keywordflow}{if} (ind\_off /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1860     idg\_offset = idg\_offset + ind\_off ; jdg\_offset = jdg\_offset + ind\_off}
\DoxyCodeLine{1861     isc = isc + ind\_off ; iec = iec + ind\_off}
\DoxyCodeLine{1862     jsc = jsc + ind\_off ; jec = jec + ind\_off}
\DoxyCodeLine{1863     isd = isd + ind\_off ; ied = ied + ind\_off}
\DoxyCodeLine{1864     jsd = jsd + ind\_off ; jed = jed + ind\_off}
\DoxyCodeLine{1865 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1866   symmetric = domain\%symmetric}
\DoxyCodeLine{1867 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_a15fdef1c434c81da4d1f5ab3d9234290}\label{namespacemom__domains_a15fdef1c434c81da4d1f5ab3d9234290}} 
\index{mom\_domains@{mom\_domains}!get\_domain\_extent\_dsamp2@{get\_domain\_extent\_dsamp2}}
\index{get\_domain\_extent\_dsamp2@{get\_domain\_extent\_dsamp2}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{get\_domain\_extent\_dsamp2()}{get\_domain\_extent\_dsamp2()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+domains\+::get\+\_\+domain\+\_\+extent\+\_\+dsamp2 (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(in)}]{Domain,  }\item[{integer, intent(out)}]{isc\+\_\+d2,  }\item[{integer, intent(out)}]{iec\+\_\+d2,  }\item[{integer, intent(out)}]{jsc\+\_\+d2,  }\item[{integer, intent(out)}]{jec\+\_\+d2,  }\item[{integer, intent(out)}]{isd\+\_\+d2,  }\item[{integer, intent(out)}]{ied\+\_\+d2,  }\item[{integer, intent(out)}]{jsd\+\_\+d2,  }\item[{integer, intent(out)}]{jed\+\_\+d2,  }\item[{integer, intent(out)}]{isg\+\_\+d2,  }\item[{integer, intent(out)}]{ieg\+\_\+d2,  }\item[{integer, intent(out)}]{jsg\+\_\+d2,  }\item[{integer, intent(out)}]{jeg\+\_\+d2 }\end{DoxyParamCaption})}


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em domain} & The M\+OM domain from which to extract information\\
\hline
\mbox{\texttt{ out}}  & {\em isc\+\_\+d2} & The start i-\/index of the computational domain\\
\hline
\mbox{\texttt{ out}}  & {\em iec\+\_\+d2} & The end i-\/index of the computational domain\\
\hline
\mbox{\texttt{ out}}  & {\em jsc\+\_\+d2} & The start j-\/index of the computational domain\\
\hline
\mbox{\texttt{ out}}  & {\em jec\+\_\+d2} & The end j-\/index of the computational domain\\
\hline
\mbox{\texttt{ out}}  & {\em isd\+\_\+d2} & The start i-\/index of the data domain\\
\hline
\mbox{\texttt{ out}}  & {\em ied\+\_\+d2} & The end i-\/index of the data domain\\
\hline
\mbox{\texttt{ out}}  & {\em jsd\+\_\+d2} & The start j-\/index of the data domain\\
\hline
\mbox{\texttt{ out}}  & {\em jed\+\_\+d2} & The end j-\/index of the data domain\\
\hline
\mbox{\texttt{ out}}  & {\em isg\+\_\+d2} & The start i-\/index of the global domain\\
\hline
\mbox{\texttt{ out}}  & {\em ieg\+\_\+d2} & The end i-\/index of the global domain\\
\hline
\mbox{\texttt{ out}}  & {\em jsg\+\_\+d2} & The start j-\/index of the global domain\\
\hline
\mbox{\texttt{ out}}  & {\em jeg\+\_\+d2} & The end j-\/index of the global domain \\
\hline
\end{DoxyParams}


Definition at line 1873 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1873   \textcolor{keywordtype}{type}(MOM\_domain\_type), \&}
\DoxyCodeLine{1874            \textcolor{keywordtype}{intent(in)}  :: Domain\textcolor{comment}{ !< The MOM domain from which to extract information}}
\DoxyCodeLine{1875   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: isc\_d2\textcolor{comment}{ !< The start i-index of the computational domain}}
\DoxyCodeLine{1876   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: iec\_d2\textcolor{comment}{ !< The end i-index of the computational domain}}
\DoxyCodeLine{1877   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jsc\_d2\textcolor{comment}{ !< The start j-index of the computational domain}}
\DoxyCodeLine{1878   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jec\_d2\textcolor{comment}{ !< The end j-index of the computational domain}}
\DoxyCodeLine{1879   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: isd\_d2\textcolor{comment}{ !< The start i-index of the data domain}}
\DoxyCodeLine{1880   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: ied\_d2\textcolor{comment}{ !< The end i-index of the data domain}}
\DoxyCodeLine{1881   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jsd\_d2\textcolor{comment}{ !< The start j-index of the data domain}}
\DoxyCodeLine{1882   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jed\_d2\textcolor{comment}{ !< The end j-index of the data domain}}
\DoxyCodeLine{1883   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: isg\_d2\textcolor{comment}{ !< The start i-index of the global domain}}
\DoxyCodeLine{1884   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: ieg\_d2\textcolor{comment}{ !< The end i-index of the global domain}}
\DoxyCodeLine{1885   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jsg\_d2\textcolor{comment}{ !< The start j-index of the global domain}}
\DoxyCodeLine{1886   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jeg\_d2\textcolor{comment}{ !< The end j-index of the global domain}}
\DoxyCodeLine{1887 }
\DoxyCodeLine{1888   \textcolor{keyword}{call }mpp\_get\_compute\_domain(domain\%mpp\_domain\_d2, isc\_d2, iec\_d2, jsc\_d2, jec\_d2)}
\DoxyCodeLine{1889   \textcolor{keyword}{call }mpp\_get\_data\_domain(domain\%mpp\_domain\_d2, isd\_d2, ied\_d2, jsd\_d2, jed\_d2)}
\DoxyCodeLine{1890   \textcolor{keyword}{call }mpp\_get\_global\_domain (domain\%mpp\_domain\_d2, isg\_d2, ieg\_d2, jsg\_d2, jeg\_d2)}
\DoxyCodeLine{1891   \textcolor{comment}{! This code institutes the MOM convention that local array indices start at 1.}}
\DoxyCodeLine{1892   isc\_d2 = isc\_d2-isd\_d2+1 ; iec\_d2 = iec\_d2-isd\_d2+1}
\DoxyCodeLine{1893   jsc\_d2 = jsc\_d2-jsd\_d2+1 ; jec\_d2 = jec\_d2-jsd\_d2+1}
\DoxyCodeLine{1894   ied\_d2 = ied\_d2-isd\_d2+1 ; jed\_d2 = jed\_d2-jsd\_d2+1}
\DoxyCodeLine{1895   isd\_d2 = 1 ; jsd\_d2 = 1}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_abc0b09896aa9f5b4c795f85c813aa59f}\label{namespacemom__domains_abc0b09896aa9f5b4c795f85c813aa59f}} 
\index{mom\_domains@{mom\_domains}!get\_global\_shape@{get\_global\_shape}}
\index{get\_global\_shape@{get\_global\_shape}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{get\_global\_shape()}{get\_global\_shape()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+domains\+::get\+\_\+global\+\_\+shape (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(in)}]{domain,  }\item[{integer, intent(out)}]{niglobal,  }\item[{integer, intent(out)}]{njglobal }\end{DoxyParamCaption})}



Returns the global shape of h-\/point arrays. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em domain} & M\+OM domain \\
\hline
\mbox{\texttt{ out}}  & {\em niglobal} & i-\/index global size of h-\/point arrays \\
\hline
\mbox{\texttt{ out}}  & {\em njglobal} & j-\/index global size of h-\/point arrays \\
\hline
\end{DoxyParams}


Definition at line 1973 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1973   \textcolor{keywordtype}{type}(MOM\_domain\_type), \textcolor{keywordtype}{intent(in)}  :: domain\textcolor{comment}{   !< MOM domain}}
\DoxyCodeLine{1974   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{intent(out)} :: niglobal\textcolor{comment}{ !< i-index global size of h-point arrays}}
\DoxyCodeLine{1975   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{intent(out)} :: njglobal\textcolor{comment}{ !< j-index global size of h-point arrays}}
\DoxyCodeLine{1976 }
\DoxyCodeLine{1977   niglobal = domain\%niglobal}
\DoxyCodeLine{1978   njglobal = domain\%njglobal}
\DoxyCodeLine{1979 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_af34281b52f789238cc85cf2ff1d20d3b}\label{namespacemom__domains_af34281b52f789238cc85cf2ff1d20d3b}} 
\index{mom\_domains@{mom\_domains}!get\_simple\_array\_i\_ind@{get\_simple\_array\_i\_ind}}
\index{get\_simple\_array\_i\_ind@{get\_simple\_array\_i\_ind}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{get\_simple\_array\_i\_ind()}{get\_simple\_array\_i\_ind()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+domains\+::get\+\_\+simple\+\_\+array\+\_\+i\+\_\+ind (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(in)}]{domain,  }\item[{integer, intent(in)}]{size,  }\item[{integer, intent(out)}]{is,  }\item[{integer, intent(out)}]{ie,  }\item[{logical, intent(in), optional}]{symmetric }\end{DoxyParamCaption})}



Return the (potentially symmetric) computational domain i-\/bounds for an array passed without index specifications (i.\+e. indices start at 1) based on an array size. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em domain} & M\+OM domain from which to extract information \\
\hline
\mbox{\texttt{ in}}  & {\em size} & The i-\/array size \\
\hline
\mbox{\texttt{ out}}  & {\em is} & The computational domain starting i-\/index. \\
\hline
\mbox{\texttt{ out}}  & {\em ie} & The computational domain ending i-\/index. \\
\hline
\mbox{\texttt{ in}}  & {\em symmetric} & If present, indicates whether symmetric sizes can be considered. \\
\hline
\end{DoxyParams}


Definition at line 1901 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1901   \textcolor{keywordtype}{type}(MOM\_domain\_type), \textcolor{keywordtype}{intent(in)}  :: domain\textcolor{comment}{ !< MOM domain from which to extract information}}
\DoxyCodeLine{1902   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{intent(in)}  :: size\textcolor{comment}{   !< The i-array size}}
\DoxyCodeLine{1903   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{intent(out)} :: is\textcolor{comment}{     !< The computational domain starting i-index.}}
\DoxyCodeLine{1904   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{intent(out)} :: ie\textcolor{comment}{     !< The computational domain ending i-index.}}
\DoxyCodeLine{1905   \textcolor{keywordtype}{logical},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: symmetric\textcolor{comment}{ !< If present, indicates whether symmetric sizes}}
\DoxyCodeLine{1906 \textcolor{comment}{                                               !! can be considered.}}
\DoxyCodeLine{1907   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{1908   \textcolor{keywordtype}{logical} :: sym}
\DoxyCodeLine{1909   \textcolor{keywordtype}{character(len=120)} :: mesg, mesg2}
\DoxyCodeLine{1910   \textcolor{keywordtype}{integer} :: isc, iec, jsc, jec, isd, ied, jsd, jed}
\DoxyCodeLine{1911 }
\DoxyCodeLine{1912   \textcolor{keyword}{call }mpp\_get\_compute\_domain(domain\%mpp\_domain, isc, iec, jsc, jec)}
\DoxyCodeLine{1913   \textcolor{keyword}{call }mpp\_get\_data\_domain(domain\%mpp\_domain, isd, ied, jsd, jed)}
\DoxyCodeLine{1914 }
\DoxyCodeLine{1915   isc = isc-isd+1 ; iec = iec-isd+1 ; ied = ied-isd+1 ; isd = 1}
\DoxyCodeLine{1916   sym = domain\%symmetric ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(symmetric)) sym = symmetric}
\DoxyCodeLine{1917 }
\DoxyCodeLine{1918   \textcolor{keywordflow}{if} (\textcolor{keyword}{size} == ied) \textcolor{keywordflow}{then} ; is = isc ; ie = iec}
\DoxyCodeLine{1919   \textcolor{keywordflow}{elseif} (\textcolor{keyword}{size} == 1+iec-isc) \textcolor{keywordflow}{then} ; is = 1 ; ie = \textcolor{keyword}{size}}
\DoxyCodeLine{1920   \textcolor{keywordflow}{elseif} (sym .and. (\textcolor{keyword}{size} == 1+ied)) \textcolor{keywordflow}{then} ; is = isc ; ie = iec+1}
\DoxyCodeLine{1921   \textcolor{keywordflow}{elseif} (sym .and. (\textcolor{keyword}{size} == 2+iec-isc)) \textcolor{keywordflow}{then} ; is = 1 ; ie = size+1}
\DoxyCodeLine{1922   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1923     \textcolor{keyword}{write}(mesg,\textcolor{stringliteral}{'("Unrecognized size ", i6, "in call to get\_simple\_array\_i\_ind.  \(\backslash\)")'}) \textcolor{keyword}{size}}
\DoxyCodeLine{1924     \textcolor{keywordflow}{if} (sym) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1925       \textcolor{keyword}{write}(mesg2,\textcolor{stringliteral}{'("Valid sizes are : ", 2i7)'}) ied, 1+iec-isc}
\DoxyCodeLine{1926     \textcolor{keywordflow}{else}}
\DoxyCodeLine{1927       \textcolor{keyword}{write}(mesg2,\textcolor{stringliteral}{'("Valid sizes are : ", 4i7)'}) ied, 1+iec-isc, 1+ied, 2+iec-isc}
\DoxyCodeLine{1928 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1929     \textcolor{keyword}{call }mom\_error(fatal, trim(mesg)//trim(mesg2))}
\DoxyCodeLine{1930 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1931 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_ae301b36598e7b9c3f3e087b75147d8d4}\label{namespacemom__domains_ae301b36598e7b9c3f3e087b75147d8d4}} 
\index{mom\_domains@{mom\_domains}!get\_simple\_array\_j\_ind@{get\_simple\_array\_j\_ind}}
\index{get\_simple\_array\_j\_ind@{get\_simple\_array\_j\_ind}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{get\_simple\_array\_j\_ind()}{get\_simple\_array\_j\_ind()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+domains\+::get\+\_\+simple\+\_\+array\+\_\+j\+\_\+ind (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(in)}]{domain,  }\item[{integer, intent(in)}]{size,  }\item[{integer, intent(out)}]{js,  }\item[{integer, intent(out)}]{je,  }\item[{logical, intent(in), optional}]{symmetric }\end{DoxyParamCaption})}



Return the (potentially symmetric) computational domain j-\/bounds for an array passed without index specifications (i.\+e. indices start at 1) based on an array size. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em domain} & M\+OM domain from which to extract information \\
\hline
\mbox{\texttt{ in}}  & {\em size} & The j-\/array size \\
\hline
\mbox{\texttt{ out}}  & {\em js} & The computational domain starting j-\/index. \\
\hline
\mbox{\texttt{ out}}  & {\em je} & The computational domain ending j-\/index. \\
\hline
\mbox{\texttt{ in}}  & {\em symmetric} & If present, indicates whether symmetric sizes can be considered. \\
\hline
\end{DoxyParams}


Definition at line 1938 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1938   \textcolor{keywordtype}{type}(MOM\_domain\_type), \textcolor{keywordtype}{intent(in)}  :: domain\textcolor{comment}{ !< MOM domain from which to extract information}}
\DoxyCodeLine{1939   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{intent(in)}  :: size\textcolor{comment}{   !< The j-array size}}
\DoxyCodeLine{1940   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{intent(out)} :: js\textcolor{comment}{     !< The computational domain starting j-index.}}
\DoxyCodeLine{1941   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{intent(out)} :: je\textcolor{comment}{     !< The computational domain ending j-index.}}
\DoxyCodeLine{1942   \textcolor{keywordtype}{logical},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: symmetric\textcolor{comment}{ !< If present, indicates whether symmetric sizes}}
\DoxyCodeLine{1943 \textcolor{comment}{                                               !! can be considered.}}
\DoxyCodeLine{1944   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{1945   \textcolor{keywordtype}{logical} :: sym}
\DoxyCodeLine{1946   \textcolor{keywordtype}{character(len=120)} :: mesg, mesg2}
\DoxyCodeLine{1947   \textcolor{keywordtype}{integer} :: isc, iec, jsc, jec, isd, ied, jsd, jed}
\DoxyCodeLine{1948 }
\DoxyCodeLine{1949   \textcolor{keyword}{call }mpp\_get\_compute\_domain(domain\%mpp\_domain, isc, iec, jsc, jec)}
\DoxyCodeLine{1950   \textcolor{keyword}{call }mpp\_get\_data\_domain(domain\%mpp\_domain, isd, ied, jsd, jed)}
\DoxyCodeLine{1951 }
\DoxyCodeLine{1952   jsc = jsc-jsd+1 ; jec = jec-jsd+1 ; jed = jed-jsd+1 ; jsd = 1}
\DoxyCodeLine{1953   sym = domain\%symmetric ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(symmetric)) sym = symmetric}
\DoxyCodeLine{1954 }
\DoxyCodeLine{1955   \textcolor{keywordflow}{if} (\textcolor{keyword}{size} == jed) \textcolor{keywordflow}{then} ; js = jsc ; je = jec}
\DoxyCodeLine{1956   \textcolor{keywordflow}{elseif} (\textcolor{keyword}{size} == 1+jec-jsc) \textcolor{keywordflow}{then} ; js = 1 ; je = \textcolor{keyword}{size}}
\DoxyCodeLine{1957   \textcolor{keywordflow}{elseif} (sym .and. (\textcolor{keyword}{size} == 1+jed)) \textcolor{keywordflow}{then} ; js = jsc ; je = jec+1}
\DoxyCodeLine{1958   \textcolor{keywordflow}{elseif} (sym .and. (\textcolor{keyword}{size} == 2+jec-jsc)) \textcolor{keywordflow}{then} ; js = 1 ; je = size+1}
\DoxyCodeLine{1959   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1960     \textcolor{keyword}{write}(mesg,\textcolor{stringliteral}{'("Unrecognized size ", i6, "in call to get\_simple\_array\_j\_ind.  \(\backslash\)")'}) \textcolor{keyword}{size}}
\DoxyCodeLine{1961     \textcolor{keywordflow}{if} (sym) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1962       \textcolor{keyword}{write}(mesg2,\textcolor{stringliteral}{'("Valid sizes are : ", 2i7)'}) jed, 1+jec-jsc}
\DoxyCodeLine{1963     \textcolor{keywordflow}{else}}
\DoxyCodeLine{1964       \textcolor{keyword}{write}(mesg2,\textcolor{stringliteral}{'("Valid sizes are : ", 4i7)'}) jed, 1+jec-jsc, 1+jed, 2+jec-jsc}
\DoxyCodeLine{1965 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1966     \textcolor{keyword}{call }mom\_error(fatal, trim(mesg)//trim(mesg2))}
\DoxyCodeLine{1967 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1968 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_a1f46e6c3ac2f2728924617edfa6f22b5}\label{namespacemom__domains_a1f46e6c3ac2f2728924617edfa6f22b5}} 
\index{mom\_domains@{mom\_domains}!mom\_domains\_init@{mom\_domains\_init}}
\index{mom\_domains\_init@{mom\_domains\_init}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{mom\_domains\_init()}{mom\_domains\_init()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+domains\+::mom\+\_\+domains\+\_\+init (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), pointer}]{M\+O\+M\+\_\+dom,  }\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file,  }\item[{logical, intent(in), optional}]{symmetric,  }\item[{logical, intent(in), optional}]{static\+\_\+memory,  }\item[{integer, intent(in), optional}]{N\+I\+H\+A\+LO,  }\item[{integer, intent(in), optional}]{N\+J\+H\+A\+LO,  }\item[{integer, intent(in), optional}]{N\+I\+G\+L\+O\+B\+AL,  }\item[{integer, intent(in), optional}]{N\+J\+G\+L\+O\+B\+AL,  }\item[{integer, intent(in), optional}]{N\+I\+P\+R\+OC,  }\item[{integer, intent(in), optional}]{N\+J\+P\+R\+OC,  }\item[{integer, dimension(2), intent(inout), optional}]{min\+\_\+halo,  }\item[{character(len=$\ast$), intent(in), optional}]{domain\+\_\+name,  }\item[{character(len=$\ast$), intent(in), optional}]{include\+\_\+name,  }\item[{character(len=$\ast$), intent(in), optional}]{param\+\_\+suffix }\end{DoxyParamCaption})}



M\+O\+M\+\_\+domains\+\_\+init initalizes a M\+O\+M\+\_\+domain\+\_\+type variable, based on the information read in from a param\+\_\+file\+\_\+type, and optionally returns data describing various\textquotesingle{} properties of the domain type. 


\begin{DoxyParams}[1]{Parameters}
 & {\em mom\+\_\+dom} & A pointer to the M\+O\+M\+\_\+domain\+\_\+type being defined here. \\
\hline
\mbox{\texttt{ in}}  & {\em param\+\_\+file} & A structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em symmetric} & If present, this specifies whether this domain is symmetric, regardless of whether the macro S\+Y\+M\+M\+E\+T\+R\+I\+C\+\_\+\+M\+E\+M\+O\+R\+Y\+\_\+ is defined. \\
\hline
\mbox{\texttt{ in}}  & {\em static\+\_\+memory} & If present and true, this domain type is set up for static memory and error checking of various input values is performed against those in the input file. \\
\hline
\mbox{\texttt{ in}}  & {\em nihalo} & Default halo sizes, required with static memory. \\
\hline
\mbox{\texttt{ in}}  & {\em njhalo} & Default halo sizes, required with static memory. \\
\hline
\mbox{\texttt{ in}}  & {\em niglobal} & Total domain sizes, required with static memory. \\
\hline
\mbox{\texttt{ in}}  & {\em njglobal} & Total domain sizes, required with static memory. \\
\hline
\mbox{\texttt{ in}}  & {\em niproc} & Processor counts, required with static memory. \\
\hline
\mbox{\texttt{ in}}  & {\em njproc} & Processor counts, required with static memory. \\
\hline
\mbox{\texttt{ in,out}}  & {\em min\+\_\+halo} & If present, this sets the minimum halo size for this domain in the i-\/ and j-\/ directions, and returns the actual halo size used. \\
\hline
\mbox{\texttt{ in}}  & {\em domain\+\_\+name} & A name for this domain, \char`\"{}\+M\+O\+M\char`\"{} if missing. \\
\hline
\mbox{\texttt{ in}}  & {\em include\+\_\+name} & A name for model\textquotesingle{}s include file, \char`\"{}\+M\+O\+M\+\_\+memory.\+h\char`\"{} if missing. \\
\hline
\mbox{\texttt{ in}}  & {\em param\+\_\+suffix} & A suffix to apply to layout-\/specific parameters. \\
\hline
\end{DoxyParams}


Definition at line 1178 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1178   \textcolor{keywordtype}{type}(MOM\_domain\_type),           \textcolor{keywordtype}{pointer}       :: MOM\_dom\textcolor{comment}{      !< A pointer to the MOM\_domain\_type}}
\DoxyCodeLine{1179 \textcolor{comment}{                                                                 !! being defined here.}}
\DoxyCodeLine{1180   \textcolor{keywordtype}{type}(param\_file\_type),           \textcolor{keywordtype}{intent(in)}    :: param\_file\textcolor{comment}{   !< A structure to parse for}}
\DoxyCodeLine{1181 \textcolor{comment}{                                                                 !! run-time parameters}}
\DoxyCodeLine{1182   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{optional},               \textcolor{keywordtype}{intent(in)}    :: symmetric\textcolor{comment}{    !< If present, this specifies}}
\DoxyCodeLine{1183 \textcolor{comment}{                                            !! whether this domain is symmetric, regardless of}}
\DoxyCodeLine{1184 \textcolor{comment}{                                            !! whether the macro SYMMETRIC\_MEMORY\_ is defined.}}
\DoxyCodeLine{1185   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{optional},               \textcolor{keywordtype}{intent(in)}    :: static\_memory\textcolor{comment}{ !< If present and true, this}}
\DoxyCodeLine{1186 \textcolor{comment}{                         !! domain type is set up for static memory and error checking of}}
\DoxyCodeLine{1187 \textcolor{comment}{                         !! various input values is performed against those in the input file.}}
\DoxyCodeLine{1188   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional},               \textcolor{keywordtype}{intent(in)}    :: NIHALO\textcolor{comment}{       !< Default halo sizes, required}}
\DoxyCodeLine{1189 \textcolor{comment}{                                                                 !! with static memory.}}
\DoxyCodeLine{1190   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional},               \textcolor{keywordtype}{intent(in)}    :: NJHALO\textcolor{comment}{       !< Default halo sizes, required}}
\DoxyCodeLine{1191 \textcolor{comment}{                                                                 !! with static memory.}}
\DoxyCodeLine{1192   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional},               \textcolor{keywordtype}{intent(in)}    :: NIGLOBAL\textcolor{comment}{     !< Total domain sizes, required}}
\DoxyCodeLine{1193 \textcolor{comment}{                                                                 !! with static memory.}}
\DoxyCodeLine{1194   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional},               \textcolor{keywordtype}{intent(in)}    :: NJGLOBAL\textcolor{comment}{     !< Total domain sizes, required}}
\DoxyCodeLine{1195 \textcolor{comment}{                                                                 !! with static memory.}}
\DoxyCodeLine{1196   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional},               \textcolor{keywordtype}{intent(in)}    :: NIPROC\textcolor{comment}{       !< Processor counts, required with}}
\DoxyCodeLine{1197 \textcolor{comment}{                                                                 !! static memory.}}
\DoxyCodeLine{1198   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional},               \textcolor{keywordtype}{intent(in)}    :: NJPROC\textcolor{comment}{       !< Processor counts, required with}}
\DoxyCodeLine{1199 \textcolor{comment}{                                                                 !! static memory.}}
\DoxyCodeLine{1200   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{dimension(2)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(inout)} :: min\_halo\textcolor{comment}{     !< If present, this sets the}}
\DoxyCodeLine{1201 \textcolor{comment}{                                        !! minimum halo size for this domain in the i- and j-}}
\DoxyCodeLine{1202 \textcolor{comment}{                                        !! directions, and returns the actual halo size used.}}
\DoxyCodeLine{1203   \textcolor{keywordtype}{character(len=*)},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: domain\_name\textcolor{comment}{  !< A name for this domain, "MOM"}}
\DoxyCodeLine{1204 \textcolor{comment}{                                                                 !! if missing.}}
\DoxyCodeLine{1205   \textcolor{keywordtype}{character(len=*)},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: include\_name\textcolor{comment}{ !< A name for model's include file,}}
\DoxyCodeLine{1206 \textcolor{comment}{                                                                 !! "MOM\_memory.h" if missing.}}
\DoxyCodeLine{1207   \textcolor{keywordtype}{character(len=*)},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: param\_suffix\textcolor{comment}{ !< A suffix to apply to}}
\DoxyCodeLine{1208 \textcolor{comment}{                                                                 !! layout-specific parameters.}}
\DoxyCodeLine{1209 }
\DoxyCodeLine{1210   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{1211   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{dimension(2)} :: layout = (/ 1, 1 /)}
\DoxyCodeLine{1212   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{dimension(2)} :: io\_layout = (/ 0, 0 /)}
\DoxyCodeLine{1213   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{dimension(4)} :: global\_indices}
\DoxyCodeLine{1214 \textcolor{comment}{!\$ integer :: ocean\_nthreads       ! Number of Openmp threads}}
\DoxyCodeLine{1215 \textcolor{comment}{!\$ integer :: get\_cpu\_affinity, omp\_get\_thread\_num, omp\_get\_num\_threads}}
\DoxyCodeLine{1216 \textcolor{comment}{!\$ logical :: ocean\_omp\_hyper\_thread}}
\DoxyCodeLine{1217   \textcolor{keywordtype}{integer} :: nihalo\_dflt, njhalo\_dflt}
\DoxyCodeLine{1218   \textcolor{keywordtype}{integer} :: pe, proc\_used}
\DoxyCodeLine{1219   \textcolor{keywordtype}{integer} :: X\_FLAGS, Y\_FLAGS}
\DoxyCodeLine{1220   \textcolor{keywordtype}{logical} :: reentrant\_x, reentrant\_y, tripolar\_N, is\_static}
\DoxyCodeLine{1221   \textcolor{keywordtype}{logical}            :: mask\_table\_exists}
\DoxyCodeLine{1222   \textcolor{keywordtype}{character(len=128)} :: mask\_table, inputdir}
\DoxyCodeLine{1223   \textcolor{keywordtype}{character(len=64)}  :: dom\_name, inc\_nm}
\DoxyCodeLine{1224   \textcolor{keywordtype}{character(len=200)} :: mesg}
\DoxyCodeLine{1225 }
\DoxyCodeLine{1226   \textcolor{keywordtype}{integer} :: xsiz, ysiz, nip\_parsed, njp\_parsed}
\DoxyCodeLine{1227   \textcolor{keywordtype}{integer} :: isc,iec,jsc,jec \textcolor{comment}{! The bounding indices of the computational domain.}}
\DoxyCodeLine{1228   \textcolor{keywordtype}{character(len=8)} :: char\_xsiz, char\_ysiz, char\_niglobal, char\_njglobal}
\DoxyCodeLine{1229   \textcolor{keywordtype}{character(len=40)} :: nihalo\_nm, njhalo\_nm, layout\_nm, io\_layout\_nm, masktable\_nm}
\DoxyCodeLine{1230   \textcolor{keywordtype}{character(len=40)} :: niproc\_nm, njproc\_nm}
\DoxyCodeLine{1231   \textcolor{keywordtype}{integer} :: xhalo\_d2,yhalo\_d2}
\DoxyCodeLine{1232 \textcolor{comment}{! This include declares and sets the variable "version".}}
\DoxyCodeLine{1233 \textcolor{preprocessor}{\#include "version\_variable.h"}}
\DoxyCodeLine{1234 \textcolor{preprocessor}{}  \textcolor{keywordtype}{character(len=40)}  :: mdl \textcolor{comment}{! This module's name.}}
\DoxyCodeLine{1235 }
\DoxyCodeLine{1236   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(mom\_dom)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1237     \textcolor{keyword}{allocate}(mom\_dom)}
\DoxyCodeLine{1238     \textcolor{keyword}{allocate}(mom\_dom\%mpp\_domain)}
\DoxyCodeLine{1239     \textcolor{keyword}{allocate}(mom\_dom\%mpp\_domain\_d2)}
\DoxyCodeLine{1240 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1241 }
\DoxyCodeLine{1242   pe = pe\_here()}
\DoxyCodeLine{1243   proc\_used = num\_pes()}
\DoxyCodeLine{1244 }
\DoxyCodeLine{1245   mdl = \textcolor{stringliteral}{"MOM\_domains"}}
\DoxyCodeLine{1246 }
\DoxyCodeLine{1247   mom\_dom\%symmetric = .true.}
\DoxyCodeLine{1248   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(symmetric)) \textcolor{keywordflow}{then} ; mom\_dom\%symmetric = symmetric ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1249   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(min\_halo)) mdl = trim(mdl)//\textcolor{stringliteral}{" min\_halo"}}
\DoxyCodeLine{1250 }
\DoxyCodeLine{1251   dom\_name = \textcolor{stringliteral}{"MOM"} ; inc\_nm = \textcolor{stringliteral}{"MOM\_memory.h"}}
\DoxyCodeLine{1252   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(domain\_name)) dom\_name = trim(domain\_name)}
\DoxyCodeLine{1253   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(include\_name)) inc\_nm = trim(include\_name)}
\DoxyCodeLine{1254 }
\DoxyCodeLine{1255   nihalo\_nm = \textcolor{stringliteral}{"NIHALO"} ; njhalo\_nm = \textcolor{stringliteral}{"NJHALO"}}
\DoxyCodeLine{1256   layout\_nm = \textcolor{stringliteral}{"LAYOUT"} ; io\_layout\_nm = \textcolor{stringliteral}{"IO\_LAYOUT"} ; masktable\_nm = \textcolor{stringliteral}{"MASKTABLE"}}
\DoxyCodeLine{1257   niproc\_nm = \textcolor{stringliteral}{"NIPROC"} ; njproc\_nm = \textcolor{stringliteral}{"NJPROC"}}
\DoxyCodeLine{1258   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(param\_suffix)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (len(trim(adjustl(param\_suffix))) > 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1259     nihalo\_nm = \textcolor{stringliteral}{"NIHALO"}//(trim(adjustl(param\_suffix)))}
\DoxyCodeLine{1260     njhalo\_nm = \textcolor{stringliteral}{"NJHALO"}//(trim(adjustl(param\_suffix)))}
\DoxyCodeLine{1261     layout\_nm = \textcolor{stringliteral}{"LAYOUT"}//(trim(adjustl(param\_suffix)))}
\DoxyCodeLine{1262     io\_layout\_nm = \textcolor{stringliteral}{"IO\_LAYOUT"}//(trim(adjustl(param\_suffix)))}
\DoxyCodeLine{1263     masktable\_nm = \textcolor{stringliteral}{"MASKTABLE"}//(trim(adjustl(param\_suffix)))}
\DoxyCodeLine{1264     niproc\_nm = \textcolor{stringliteral}{"NIPROC"}//(trim(adjustl(param\_suffix)))}
\DoxyCodeLine{1265     njproc\_nm = \textcolor{stringliteral}{"NJPROC"}//(trim(adjustl(param\_suffix)))}
\DoxyCodeLine{1266 \textcolor{keywordflow}{  endif} ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1267 }
\DoxyCodeLine{1268   is\_static = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(static\_memory)) is\_static = static\_memory}
\DoxyCodeLine{1269   \textcolor{keywordflow}{if} (is\_static) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1270     \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{present}(nihalo)) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"NIHALO must be "}// \&}
\DoxyCodeLine{1271       \textcolor{stringliteral}{"present in the call to MOM\_domains\_init with static memory."})}
\DoxyCodeLine{1272     \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{present}(njhalo)) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"NJHALO must be "}// \&}
\DoxyCodeLine{1273       \textcolor{stringliteral}{"present in the call to MOM\_domains\_init with static memory."})}
\DoxyCodeLine{1274     \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{present}(niglobal)) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"NIGLOBAL must be "}// \&}
\DoxyCodeLine{1275       \textcolor{stringliteral}{"present in the call to MOM\_domains\_init with static memory."})}
\DoxyCodeLine{1276     \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{present}(njglobal)) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"NJGLOBAL must be "}// \&}
\DoxyCodeLine{1277       \textcolor{stringliteral}{"present in the call to MOM\_domains\_init with static memory."})}
\DoxyCodeLine{1278     \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{present}(niproc)) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"NIPROC must be "}// \&}
\DoxyCodeLine{1279       \textcolor{stringliteral}{"present in the call to MOM\_domains\_init with static memory."})}
\DoxyCodeLine{1280     \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{present}(njproc)) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"NJPROC must be "}// \&}
\DoxyCodeLine{1281       \textcolor{stringliteral}{"present in the call to MOM\_domains\_init with static memory."})}
\DoxyCodeLine{1282 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1283 }
\DoxyCodeLine{1284   \textcolor{comment}{! Read all relevant parameters and write them to the model log.}}
\DoxyCodeLine{1285   \textcolor{keyword}{call }log\_version(param\_file, mdl, version, \textcolor{stringliteral}{""}, log\_to\_all=.true., layout=.true.)}
\DoxyCodeLine{1286   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"REENTRANT\_X"}, reentrant\_x, \&}
\DoxyCodeLine{1287                  \textcolor{stringliteral}{"If true, the domain is zonally reentrant."}, default=.true.)}
\DoxyCodeLine{1288   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"REENTRANT\_Y"}, reentrant\_y, \&}
\DoxyCodeLine{1289                  \textcolor{stringliteral}{"If true, the domain is meridionally reentrant."}, \&}
\DoxyCodeLine{1290                  default=.false.)}
\DoxyCodeLine{1291   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"TRIPOLAR\_N"}, tripolar\_n, \&}
\DoxyCodeLine{1292                  \textcolor{stringliteral}{"Use tripolar connectivity at the northern edge of the "}//\&}
\DoxyCodeLine{1293                  \textcolor{stringliteral}{"domain.  With TRIPOLAR\_N, NIGLOBAL must be even."}, \&}
\DoxyCodeLine{1294                  default=.false.)}
\DoxyCodeLine{1295 }
\DoxyCodeLine{1296 \textcolor{preprocessor}{\#ifndef NOT\_SET\_AFFINITY}}
\DoxyCodeLine{1297 \textcolor{preprocessor}{}\textcolor{comment}{!\$  call fms\_affinity\_init}}
\DoxyCodeLine{1298 \textcolor{comment}{!\$OMP PARALLEL}}
\DoxyCodeLine{1299 \textcolor{comment}{!\$OMP master}}
\DoxyCodeLine{1300 \textcolor{comment}{!\$ ocean\_nthreads = omp\_get\_num\_threads()}}
\DoxyCodeLine{1301 \textcolor{comment}{!\$OMP END MASTER}}
\DoxyCodeLine{1302 \textcolor{comment}{!\$OMP END PARALLEL}}
\DoxyCodeLine{1303 \textcolor{comment}{!\$ if(ocean\_nthreads < 2 ) then}}
\DoxyCodeLine{1304 \textcolor{comment}{!\$   call get\_param(param\_file, mdl, "OCEAN\_OMP\_THREADS", ocean\_nthreads, \&}}
\DoxyCodeLine{1305 \textcolor{comment}{!\$              "The number of OpenMP threads that MOM6 will use.", \&}}
\DoxyCodeLine{1306 \textcolor{comment}{!\$              default = 1, layoutParam=.true.)}}
\DoxyCodeLine{1307 \textcolor{comment}{!\$   call get\_param(param\_file, mdl, "OCEAN\_OMP\_HYPER\_THREAD", ocean\_omp\_hyper\_thread, \&}}
\DoxyCodeLine{1308 \textcolor{comment}{!\$              "If True, use hyper-threading.", default = .false., layoutParam=.true.)}}
\DoxyCodeLine{1309 \textcolor{comment}{!\$   call fms\_affinity\_set('OCEAN', ocean\_omp\_hyper\_thread, ocean\_nthreads)}}
\DoxyCodeLine{1310 \textcolor{comment}{!\$   call omp\_set\_num\_threads(ocean\_nthreads)}}
\DoxyCodeLine{1311 \textcolor{comment}{!\$   write(6,*) "MOM\_domains\_mod OMPthreading ", fms\_affinity\_get(), omp\_get\_thread\_num(), omp\_get\_num\_threads()}}
\DoxyCodeLine{1312 \textcolor{comment}{!\$   call flush(6)}}
\DoxyCodeLine{1313 \textcolor{comment}{!\$ endif}}
\DoxyCodeLine{1314 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{1315 \textcolor{preprocessor}{}  \textcolor{keyword}{call }log\_param(param\_file, mdl, \textcolor{stringliteral}{"!SYMMETRIC\_MEMORY\_"}, mom\_dom\%symmetric, \&}
\DoxyCodeLine{1316                  \textcolor{stringliteral}{"If defined, the velocity point data domain includes "}//\&}
\DoxyCodeLine{1317                  \textcolor{stringliteral}{"every face of the thickness points. In other words, "}//\&}
\DoxyCodeLine{1318                  \textcolor{stringliteral}{"some arrays are larger than others, depending on where "}//\&}
\DoxyCodeLine{1319                  \textcolor{stringliteral}{"they are on the staggered grid.  Also, the starting "}//\&}
\DoxyCodeLine{1320                  \textcolor{stringliteral}{"index of the velocity-point arrays is usually 0, not 1. "}//\&}
\DoxyCodeLine{1321                  \textcolor{stringliteral}{"This can only be set at compile time."},\&}
\DoxyCodeLine{1322                  layoutparam=.true.)}
\DoxyCodeLine{1323   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"NONBLOCKING\_UPDATES"}, mom\_dom\%nonblocking\_updates, \&}
\DoxyCodeLine{1324                  \textcolor{stringliteral}{"If true, non-blocking halo updates may be used."}, \&}
\DoxyCodeLine{1325                  default=.false., layoutparam=.true.)}
\DoxyCodeLine{1326   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"THIN\_HALO\_UPDATES"}, mom\_dom\%thin\_halo\_updates, \&}
\DoxyCodeLine{1327                  \textcolor{stringliteral}{"If true, optional arguments may be used to specify the "}//\&}
\DoxyCodeLine{1328                  \textcolor{stringliteral}{"the width of the halos that are updated with each call."}, \&}
\DoxyCodeLine{1329                  default=.true., layoutparam=.true.)}
\DoxyCodeLine{1330 }
\DoxyCodeLine{1331   nihalo\_dflt = 4 ; njhalo\_dflt = 4}
\DoxyCodeLine{1332   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(nihalo)) nihalo\_dflt = nihalo}
\DoxyCodeLine{1333   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(njhalo)) njhalo\_dflt = njhalo}
\DoxyCodeLine{1334 }
\DoxyCodeLine{1335   \textcolor{keyword}{call }log\_param(param\_file, mdl, \textcolor{stringliteral}{"!STATIC\_MEMORY\_"}, is\_static, \&}
\DoxyCodeLine{1336                  \textcolor{stringliteral}{"If STATIC\_MEMORY\_ is defined, the principle variables "}//\&}
\DoxyCodeLine{1337                  \textcolor{stringliteral}{"will have sizes that are statically determined at "}//\&}
\DoxyCodeLine{1338                  \textcolor{stringliteral}{"compile time.  Otherwise the sizes are not determined "}//\&}
\DoxyCodeLine{1339                  \textcolor{stringliteral}{"until run time. The STATIC option is substantially "}//\&}
\DoxyCodeLine{1340                  \textcolor{stringliteral}{"faster, but does not allow the PE count to be changed "}//\&}
\DoxyCodeLine{1341                  \textcolor{stringliteral}{"at run time.  This can only be set at compile time."},\&}
\DoxyCodeLine{1342                  layoutparam=.true.)}
\DoxyCodeLine{1343 }
\DoxyCodeLine{1344   \textcolor{keywordflow}{if} (is\_static) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1345     \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"NIGLOBAL"}, mom\_dom\%niglobal, \&}
\DoxyCodeLine{1346                  \textcolor{stringliteral}{"The total number of thickness grid points in the "}//\&}
\DoxyCodeLine{1347                  \textcolor{stringliteral}{"x-direction in the physical domain. With STATIC\_MEMORY\_ "}//\&}
\DoxyCodeLine{1348                  \textcolor{stringliteral}{"this is set in "}//trim(inc\_nm)//\textcolor{stringliteral}{" at compile time."}, \&}
\DoxyCodeLine{1349                  static\_value=niglobal)}
\DoxyCodeLine{1350     \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"NJGLOBAL"}, mom\_dom\%njglobal, \&}
\DoxyCodeLine{1351                  \textcolor{stringliteral}{"The total number of thickness grid points in the "}//\&}
\DoxyCodeLine{1352                  \textcolor{stringliteral}{"y-direction in the physical domain. With STATIC\_MEMORY\_ "}//\&}
\DoxyCodeLine{1353                  \textcolor{stringliteral}{"this is set in "}//trim(inc\_nm)//\textcolor{stringliteral}{" at compile time."}, \&}
\DoxyCodeLine{1354                  static\_value=njglobal)}
\DoxyCodeLine{1355     \textcolor{keywordflow}{if} (mom\_dom\%niglobal /= niglobal) \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"MOM\_domains\_init: "} // \&}
\DoxyCodeLine{1356      \textcolor{stringliteral}{"static mismatch for NIGLOBAL\_ domain size. Header file does not match input namelist"})}
\DoxyCodeLine{1357     \textcolor{keywordflow}{if} (mom\_dom\%njglobal /= njglobal) \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"MOM\_domains\_init: "} // \&}
\DoxyCodeLine{1358      \textcolor{stringliteral}{"static mismatch for NJGLOBAL\_ domain size. Header file does not match input namelist"})}
\DoxyCodeLine{1359 }
\DoxyCodeLine{1360   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1361     \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"NIGLOBAL"}, mom\_dom\%niglobal, \&}
\DoxyCodeLine{1362                  \textcolor{stringliteral}{"The total number of thickness grid points in the "}//\&}
\DoxyCodeLine{1363                  \textcolor{stringliteral}{"x-direction in the physical domain. With STATIC\_MEMORY\_ "}//\&}
\DoxyCodeLine{1364                  \textcolor{stringliteral}{"this is set in "}//trim(inc\_nm)//\textcolor{stringliteral}{" at compile time."}, \&}
\DoxyCodeLine{1365                  fail\_if\_missing=.true.)}
\DoxyCodeLine{1366     \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"NJGLOBAL"}, mom\_dom\%njglobal, \&}
\DoxyCodeLine{1367                  \textcolor{stringliteral}{"The total number of thickness grid points in the "}//\&}
\DoxyCodeLine{1368                  \textcolor{stringliteral}{"y-direction in the physical domain. With STATIC\_MEMORY\_ "}//\&}
\DoxyCodeLine{1369                  \textcolor{stringliteral}{"this is set in "}//trim(inc\_nm)//\textcolor{stringliteral}{" at compile time."}, \&}
\DoxyCodeLine{1370                  fail\_if\_missing=.true.)}
\DoxyCodeLine{1371 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1372 }
\DoxyCodeLine{1373   \textcolor{keyword}{call }get\_param(param\_file, mdl, trim(nihalo\_nm), mom\_dom\%nihalo, \&}
\DoxyCodeLine{1374                  \textcolor{stringliteral}{"The number of halo points on each side in the x-direction.  How this is set "}//\&}
\DoxyCodeLine{1375                  \textcolor{stringliteral}{"varies with the calling component and static or dynamic memory configuration."}, \&}
\DoxyCodeLine{1376                  default=nihalo\_dflt, static\_value=nihalo\_dflt)}
\DoxyCodeLine{1377   \textcolor{keyword}{call }get\_param(param\_file, mdl, trim(njhalo\_nm), mom\_dom\%njhalo, \&}
\DoxyCodeLine{1378                  \textcolor{stringliteral}{"The number of halo points on each side in the y-direction.  How this is set "}//\&}
\DoxyCodeLine{1379                  \textcolor{stringliteral}{"varies with the calling component and static or dynamic memory configuration."}, \&}
\DoxyCodeLine{1380                  default=njhalo\_dflt, static\_value=njhalo\_dflt)}
\DoxyCodeLine{1381   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(min\_halo)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1382     mom\_dom\%nihalo = max(mom\_dom\%nihalo, min\_halo(1))}
\DoxyCodeLine{1383     min\_halo(1) = mom\_dom\%nihalo}
\DoxyCodeLine{1384     mom\_dom\%njhalo = max(mom\_dom\%njhalo, min\_halo(2))}
\DoxyCodeLine{1385     min\_halo(2) = mom\_dom\%njhalo}
\DoxyCodeLine{1386     \textcolor{comment}{! These are generally used only with static memory, so they are considerd layout params.}}
\DoxyCodeLine{1387     \textcolor{keyword}{call }log\_param(param\_file, mdl, \textcolor{stringliteral}{"!NIHALO min\_halo"}, mom\_dom\%nihalo, layoutparam=.true.)}
\DoxyCodeLine{1388     \textcolor{keyword}{call }log\_param(param\_file, mdl, \textcolor{stringliteral}{"!NJHALO min\_halo"}, mom\_dom\%nihalo, layoutparam=.true.)}
\DoxyCodeLine{1389 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1390   \textcolor{keywordflow}{if} (is\_static .and. .not.\textcolor{keyword}{present}(min\_halo)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1391     \textcolor{keywordflow}{if} (mom\_dom\%nihalo /= nihalo) \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"MOM\_domains\_init: "} // \&}
\DoxyCodeLine{1392            \textcolor{stringliteral}{"static mismatch for "}//trim(nihalo\_nm)//\textcolor{stringliteral}{" domain size"})}
\DoxyCodeLine{1393     \textcolor{keywordflow}{if} (mom\_dom\%njhalo /= njhalo) \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"MOM\_domains\_init: "} // \&}
\DoxyCodeLine{1394            \textcolor{stringliteral}{"static mismatch for "}//trim(njhalo\_nm)//\textcolor{stringliteral}{" domain size"})}
\DoxyCodeLine{1395 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1396 }
\DoxyCodeLine{1397   global\_indices(1) = 1 ; global\_indices(2) = mom\_dom\%niglobal}
\DoxyCodeLine{1398   global\_indices(3) = 1 ; global\_indices(4) = mom\_dom\%njglobal}
\DoxyCodeLine{1399 }
\DoxyCodeLine{1400   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"INPUTDIR"}, inputdir, do\_not\_log=.true., default=\textcolor{stringliteral}{"."})}
\DoxyCodeLine{1401   inputdir = slasher(inputdir)}
\DoxyCodeLine{1402 }
\DoxyCodeLine{1403   \textcolor{keyword}{call }get\_param(param\_file, mdl, trim(masktable\_nm), mask\_table, \&}
\DoxyCodeLine{1404                  \textcolor{stringliteral}{"A text file to specify n\_mask, layout and mask\_list. "}//\&}
\DoxyCodeLine{1405                  \textcolor{stringliteral}{"This feature masks out processors that contain only land points. "}//\&}
\DoxyCodeLine{1406                  \textcolor{stringliteral}{"The first line of mask\_table is the number of regions to be masked out. "}//\&}
\DoxyCodeLine{1407                  \textcolor{stringliteral}{"The second line is the layout of the model and must be "}//\&}
\DoxyCodeLine{1408                  \textcolor{stringliteral}{"consistent with the actual model layout. "}//\&}
\DoxyCodeLine{1409                  \textcolor{stringliteral}{"The following (n\_mask) lines give the logical positions "}//\&}
\DoxyCodeLine{1410                  \textcolor{stringliteral}{"of the processors that are masked out. The mask\_table "}//\&}
\DoxyCodeLine{1411                  \textcolor{stringliteral}{"can be created by tools like check\_mask. The "}//\&}
\DoxyCodeLine{1412                  \textcolor{stringliteral}{"following example of mask\_table masks out 2 processors, "}//\&}
\DoxyCodeLine{1413                  \textcolor{stringliteral}{"(1,2) and (3,6), out of the 24 in a 4x6 layout: \(\backslash\)n"}//\&}
\DoxyCodeLine{1414                  \textcolor{stringliteral}{" 2\(\backslash\)n 4,6\(\backslash\)n 1,2\(\backslash\)n 3,6\(\backslash\)n"}, default=\textcolor{stringliteral}{"MOM\_mask\_table"}, \&}
\DoxyCodeLine{1415                  layoutparam=.true.)}
\DoxyCodeLine{1416   mask\_table = trim(inputdir)//trim(mask\_table)}
\DoxyCodeLine{1417   mask\_table\_exists = file\_exist(mask\_table)}
\DoxyCodeLine{1418 }
\DoxyCodeLine{1419   \textcolor{keywordflow}{if} (is\_static) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1420     layout(1) = niproc ; layout(2) = njproc}
\DoxyCodeLine{1421   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1422     \textcolor{keyword}{call }get\_param(param\_file, mdl, trim(layout\_nm), layout, \&}
\DoxyCodeLine{1423                  \textcolor{stringliteral}{"The processor layout to be used, or 0, 0 to automatically "}//\&}
\DoxyCodeLine{1424                  \textcolor{stringliteral}{"set the layout based on the number of processors."}, default=0, \&}
\DoxyCodeLine{1425                  do\_not\_log=.true.)}
\DoxyCodeLine{1426     \textcolor{keyword}{call }get\_param(param\_file, mdl, trim(niproc\_nm), nip\_parsed, \&}
\DoxyCodeLine{1427                  \textcolor{stringliteral}{"The number of processors in the x-direction."}, default=-1, \&}
\DoxyCodeLine{1428                  do\_not\_log=.true.)}
\DoxyCodeLine{1429     \textcolor{keyword}{call }get\_param(param\_file, mdl, trim(njproc\_nm), njp\_parsed, \&}
\DoxyCodeLine{1430                  \textcolor{stringliteral}{"The number of processors in the y-direction."}, default=-1, \&}
\DoxyCodeLine{1431                  do\_not\_log=.true.)}
\DoxyCodeLine{1432     \textcolor{keywordflow}{if} (nip\_parsed > -1) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1433       \textcolor{keywordflow}{if} ((layout(1) > 0) .and. (layout(1) /= nip\_parsed)) \&}
\DoxyCodeLine{1434         \textcolor{keyword}{call }mom\_error(fatal, trim(layout\_nm)//\textcolor{stringliteral}{" and "}//trim(niproc\_nm)//\textcolor{stringliteral}{" set inconsistently. "}//\&}
\DoxyCodeLine{1435                               \textcolor{stringliteral}{"Only LAYOUT should be used."})}
\DoxyCodeLine{1436       layout(1) = nip\_parsed}
\DoxyCodeLine{1437       \textcolor{keyword}{call }mom\_mesg(trim(niproc\_nm)//\textcolor{stringliteral}{" used to set "}//trim(layout\_nm)//\textcolor{stringliteral}{" in dynamic mode.  "}//\&}
\DoxyCodeLine{1438                     \textcolor{stringliteral}{"Shift to using "}//trim(layout\_nm)//\textcolor{stringliteral}{" instead."})}
\DoxyCodeLine{1439 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1440     \textcolor{keywordflow}{if} (njp\_parsed > -1) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1441       \textcolor{keywordflow}{if} ((layout(2) > 0) .and. (layout(2) /= njp\_parsed)) \&}
\DoxyCodeLine{1442         \textcolor{keyword}{call }mom\_error(fatal, trim(layout\_nm)//\textcolor{stringliteral}{" and "}//trim(njproc\_nm)//\textcolor{stringliteral}{" set inconsistently. "}//\&}
\DoxyCodeLine{1443                               \textcolor{stringliteral}{"Only "}//trim(layout\_nm)//\textcolor{stringliteral}{" should be used."})}
\DoxyCodeLine{1444       layout(2) = njp\_parsed}
\DoxyCodeLine{1445       \textcolor{keyword}{call }mom\_mesg(trim(njproc\_nm)//\textcolor{stringliteral}{" used to set "}//trim(layout\_nm)//\textcolor{stringliteral}{" in dynamic mode.  "}//\&}
\DoxyCodeLine{1446                     \textcolor{stringliteral}{"Shift to using "}//trim(layout\_nm)//\textcolor{stringliteral}{" instead."})}
\DoxyCodeLine{1447 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1448 }
\DoxyCodeLine{1449     \textcolor{keywordflow}{if} ( layout(1)==0 .and. layout(2)==0 ) \&}
\DoxyCodeLine{1450       \textcolor{keyword}{call }mpp\_define\_layout(global\_indices, proc\_used, layout)}
\DoxyCodeLine{1451     \textcolor{keywordflow}{if} ( layout(1)/=0 .and. layout(2)==0 ) layout(2) = proc\_used/layout(1)}
\DoxyCodeLine{1452     \textcolor{keywordflow}{if} ( layout(1)==0 .and. layout(2)/=0 ) layout(1) = proc\_used/layout(2)}
\DoxyCodeLine{1453 }
\DoxyCodeLine{1454     \textcolor{keywordflow}{if} (layout(1)*layout(2) /= proc\_used .and. (.not. mask\_table\_exists) ) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1455       \textcolor{keyword}{write}(mesg,\textcolor{stringliteral}{'("MOM\_domains\_init: The product of the two components of layout, ", \&}}
\DoxyCodeLine{1456 \textcolor{stringliteral}{}\textcolor{stringliteral}{            \&      2i4,", is not the number of PEs used, ",i5,".")'}) \&}
\DoxyCodeLine{1457             layout(1),layout(2),proc\_used}
\DoxyCodeLine{1458       \textcolor{keyword}{call }mom\_error(fatal, mesg)}
\DoxyCodeLine{1459 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1460 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1461   \textcolor{keyword}{call }log\_param(param\_file, mdl, trim(niproc\_nm), layout(1), \&}
\DoxyCodeLine{1462                  \textcolor{stringliteral}{"The number of processors in the x-direction. With "}//\&}
\DoxyCodeLine{1463                  \textcolor{stringliteral}{"STATIC\_MEMORY\_ this is set in "}//trim(inc\_nm)//\textcolor{stringliteral}{" at compile time."},\&}
\DoxyCodeLine{1464                  layoutparam=.true.)}
\DoxyCodeLine{1465   \textcolor{keyword}{call }log\_param(param\_file, mdl, trim(njproc\_nm), layout(2), \&}
\DoxyCodeLine{1466                  \textcolor{stringliteral}{"The number of processors in the y-direction. With "}//\&}
\DoxyCodeLine{1467                  \textcolor{stringliteral}{"STATIC\_MEMORY\_ this is set in "}//trim(inc\_nm)//\textcolor{stringliteral}{" at compile time."},\&}
\DoxyCodeLine{1468                  layoutparam=.true.)}
\DoxyCodeLine{1469   \textcolor{keyword}{call }log\_param(param\_file, mdl, trim(layout\_nm), layout, \&}
\DoxyCodeLine{1470                  \textcolor{stringliteral}{"The processor layout that was actually used."},\&}
\DoxyCodeLine{1471                  layoutparam=.true.)}
\DoxyCodeLine{1472 }
\DoxyCodeLine{1473   \textcolor{comment}{! Idiot check that fewer PEs than columns have been requested}}
\DoxyCodeLine{1474   \textcolor{keywordflow}{if} (layout(1)*layout(2)>mom\_dom\%niglobal*mom\_dom\%njglobal)  \textcolor{keywordflow}{then}}
\DoxyCodeLine{1475     \textcolor{keyword}{write}(mesg,\textcolor{stringliteral}{'(a,2(i5,x,a))'}) \textcolor{stringliteral}{'You requested to use'},layout(1)*layout(2), \&}
\DoxyCodeLine{1476       \textcolor{stringliteral}{'PEs but there are only'},mom\_dom\%niglobal*mom\_dom\%njglobal,\textcolor{stringliteral}{'columns in the model'}}
\DoxyCodeLine{1477     \textcolor{keyword}{call }mom\_error(fatal, mesg)}
\DoxyCodeLine{1478 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1479 }
\DoxyCodeLine{1480   \textcolor{keywordflow}{if} (mask\_table\_exists) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1481     \textcolor{keyword}{call }mom\_error(note, \textcolor{stringliteral}{'MOM\_domains\_init: reading maskmap information from '}//\&}
\DoxyCodeLine{1482                          trim(mask\_table))}
\DoxyCodeLine{1483     \textcolor{keyword}{allocate}(mom\_dom\%maskmap(layout(1), layout(2)))}
\DoxyCodeLine{1484     \textcolor{keyword}{call }parse\_mask\_table(mask\_table, mom\_dom\%maskmap, dom\_name)}
\DoxyCodeLine{1485 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1486 }
\DoxyCodeLine{1487   \textcolor{comment}{!   Set up the I/O layout, and check that it uses an even multiple of the}}
\DoxyCodeLine{1488   \textcolor{comment}{! number of PEs in each direction.}}
\DoxyCodeLine{1489   io\_layout(:) = (/ 1, 1 /)}
\DoxyCodeLine{1490   \textcolor{keyword}{call }get\_param(param\_file, mdl, trim(io\_layout\_nm), io\_layout, \&}
\DoxyCodeLine{1491                  \textcolor{stringliteral}{"The processor layout to be used, or 0,0 to automatically "}//\&}
\DoxyCodeLine{1492                  \textcolor{stringliteral}{"set the io\_layout to be the same as the layout."}, default=1, \&}
\DoxyCodeLine{1493                  layoutparam=.true.)}
\DoxyCodeLine{1494 }
\DoxyCodeLine{1495   \textcolor{keywordflow}{if} (io\_layout(1) < 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1496     \textcolor{keyword}{write}(mesg,\textcolor{stringliteral}{'("MOM\_domains\_init: IO\_LAYOUT(1) = ",i4,".  Negative values "//\&}}
\DoxyCodeLine{1497 \textcolor{stringliteral}{}\textcolor{stringliteral}{         \&"are not allowed in ")'}) io\_layout(1)}
\DoxyCodeLine{1498     \textcolor{keyword}{call }mom\_error(fatal, mesg//trim(io\_layout\_nm))}
\DoxyCodeLine{1499   \textcolor{keywordflow}{elseif} (io\_layout(1) > 0) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (modulo(layout(1), io\_layout(1)) /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1500     \textcolor{keyword}{write}(mesg,\textcolor{stringliteral}{'("MOM\_domains\_init: The i-direction I/O-layout, IO\_LAYOUT(1)=",i4, \&}}
\DoxyCodeLine{1501 \textcolor{stringliteral}{}\textcolor{stringliteral}{         \&", does not evenly divide the i-direction layout, NIPROC=,",i4,".")'}) \&}
\DoxyCodeLine{1502           io\_layout(1),layout(1)}
\DoxyCodeLine{1503     \textcolor{keyword}{call }mom\_error(fatal, mesg)}
\DoxyCodeLine{1504 \textcolor{keywordflow}{  endif} ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1505 }
\DoxyCodeLine{1506   \textcolor{keywordflow}{if} (io\_layout(2) < 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1507     \textcolor{keyword}{write}(mesg,\textcolor{stringliteral}{'("MOM\_domains\_init: IO\_LAYOUT(2) = ",i4,".  Negative values "//\&}}
\DoxyCodeLine{1508 \textcolor{stringliteral}{}\textcolor{stringliteral}{         \&"are not allowed in ")'}) io\_layout(2)}
\DoxyCodeLine{1509     \textcolor{keyword}{call }mom\_error(fatal, mesg//trim(io\_layout\_nm))}
\DoxyCodeLine{1510   \textcolor{keywordflow}{elseif} (io\_layout(2) /= 0) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (modulo(layout(2), io\_layout(2)) /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1511     \textcolor{keyword}{write}(mesg,\textcolor{stringliteral}{'("MOM\_domains\_init: The j-direction I/O-layout, IO\_LAYOUT(2)=",i4, \&}}
\DoxyCodeLine{1512 \textcolor{stringliteral}{}\textcolor{stringliteral}{         \&", does not evenly divide the j-direction layout, NJPROC=,",i4,".")'}) \&}
\DoxyCodeLine{1513           io\_layout(2),layout(2)}
\DoxyCodeLine{1514     \textcolor{keyword}{call }mom\_error(fatal, mesg)}
\DoxyCodeLine{1515 \textcolor{keywordflow}{  endif} ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1516 }
\DoxyCodeLine{1517   \textcolor{keywordflow}{if} (io\_layout(2) == 0) io\_layout(2) = layout(2)}
\DoxyCodeLine{1518   \textcolor{keywordflow}{if} (io\_layout(1) == 0) io\_layout(1) = layout(1)}
\DoxyCodeLine{1519 }
\DoxyCodeLine{1520   x\_flags = 0 ; y\_flags = 0}
\DoxyCodeLine{1521   \textcolor{keywordflow}{if} (reentrant\_x) x\_flags = cyclic\_global\_domain}
\DoxyCodeLine{1522   \textcolor{keywordflow}{if} (reentrant\_y) y\_flags = cyclic\_global\_domain}
\DoxyCodeLine{1523   \textcolor{keywordflow}{if} (tripolar\_n) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1524     y\_flags = fold\_north\_edge}
\DoxyCodeLine{1525     \textcolor{keywordflow}{if} (reentrant\_y) \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"MOM\_domains: "}// \&}
\DoxyCodeLine{1526       \textcolor{stringliteral}{"TRIPOLAR\_N and REENTRANT\_Y may not be defined together."})}
\DoxyCodeLine{1527 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1528 }
\DoxyCodeLine{1529   global\_indices(1) = 1 ; global\_indices(2) = mom\_dom\%niglobal}
\DoxyCodeLine{1530   global\_indices(3) = 1 ; global\_indices(4) = mom\_dom\%njglobal}
\DoxyCodeLine{1531 }
\DoxyCodeLine{1532   \textcolor{keywordflow}{if} (mask\_table\_exists) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1533     \textcolor{keyword}{call }mom\_define\_domain( global\_indices, layout, mom\_dom\%mpp\_domain, \&}
\DoxyCodeLine{1534                 xflags=x\_flags, yflags=y\_flags, \&}
\DoxyCodeLine{1535                 xhalo=mom\_dom\%nihalo, yhalo=mom\_dom\%njhalo, \&}
\DoxyCodeLine{1536                 symmetry = mom\_dom\%symmetric, name=dom\_name, \&}
\DoxyCodeLine{1537                 maskmap=mom\_dom\%maskmap )}
\DoxyCodeLine{1538   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1539     \textcolor{keyword}{call }mom\_define\_domain( global\_indices, layout, mom\_dom\%mpp\_domain, \&}
\DoxyCodeLine{1540                 xflags=x\_flags, yflags=y\_flags, \&}
\DoxyCodeLine{1541                 xhalo=mom\_dom\%nihalo, yhalo=mom\_dom\%njhalo, \&}
\DoxyCodeLine{1542                 symmetry = mom\_dom\%symmetric, name=dom\_name)}
\DoxyCodeLine{1543 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1544 }
\DoxyCodeLine{1545   \textcolor{keywordflow}{if} ((io\_layout(1) > 0) .and. (io\_layout(2) > 0) .and. \&}
\DoxyCodeLine{1546       (layout(1)*layout(2) > 1)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1547     \textcolor{keyword}{call }mom\_define\_io\_domain(mom\_dom\%mpp\_domain, io\_layout)}
\DoxyCodeLine{1548 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1549 }
\DoxyCodeLine{1550 \textcolor{comment}{! Save the extra data for creating other domains of different resolution that overlay this domain}}
\DoxyCodeLine{1551   mom\_dom\%X\_FLAGS = x\_flags}
\DoxyCodeLine{1552   mom\_dom\%Y\_FLAGS = y\_flags}
\DoxyCodeLine{1553   mom\_dom\%layout = layout}
\DoxyCodeLine{1554   mom\_dom\%io\_layout = io\_layout}
\DoxyCodeLine{1555 }
\DoxyCodeLine{1556   \textcolor{keywordflow}{if} (is\_static) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1557   \textcolor{comment}{!   A requirement of equal sized compute domains is necessary when STATIC\_MEMORY\_}}
\DoxyCodeLine{1558   \textcolor{comment}{! is used.}}
\DoxyCodeLine{1559     \textcolor{keyword}{call }mpp\_get\_compute\_domain(mom\_dom\%mpp\_domain,isc,iec,jsc,jec)}
\DoxyCodeLine{1560     xsiz = iec - isc + 1}
\DoxyCodeLine{1561     ysiz = jec - jsc + 1}
\DoxyCodeLine{1562     \textcolor{keywordflow}{if} (xsiz*niproc /= mom\_dom\%niglobal .OR. ysiz*njproc /= mom\_dom\%njglobal) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1563        \textcolor{keyword}{write}( char\_xsiz,\textcolor{stringliteral}{'(i4)'} ) niproc}
\DoxyCodeLine{1564        \textcolor{keyword}{write}( char\_ysiz,\textcolor{stringliteral}{'(i4)'} ) njproc}
\DoxyCodeLine{1565        \textcolor{keyword}{write}( char\_niglobal,\textcolor{stringliteral}{'(i4)'} ) mom\_dom\%niglobal}
\DoxyCodeLine{1566        \textcolor{keyword}{write}( char\_njglobal,\textcolor{stringliteral}{'(i4)'} ) mom\_dom\%njglobal}
\DoxyCodeLine{1567        \textcolor{keyword}{call }mom\_error(warning,\textcolor{stringliteral}{'MOM\_domains: Processor decomposition (NIPROC\_,NJPROC\_) = ('} \&}
\DoxyCodeLine{1568            //trim(char\_xsiz)//\textcolor{stringliteral}{','}//trim(char\_ysiz)// \&}
\DoxyCodeLine{1569            \textcolor{stringliteral}{') does not evenly divide size set by preprocessor macro ('}\&}
\DoxyCodeLine{1570            //trim(char\_niglobal)//\textcolor{stringliteral}{','}//trim(char\_njglobal)// \textcolor{stringliteral}{'). '})}
\DoxyCodeLine{1571        \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'MOM\_domains:  \#undef STATIC\_MEMORY\_ in "//trim(inc\_nm)//" to use \&}}
\DoxyCodeLine{1572 \textcolor{stringliteral}{}\textcolor{stringliteral}{           \&dynamic allocation, or change processor decomposition to evenly divide the domain.'})}
\DoxyCodeLine{1573 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1574 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1575 }
\DoxyCodeLine{1576   global\_indices(1) = 1 ; global\_indices(2) = int(mom\_dom\%niglobal/2)}
\DoxyCodeLine{1577   global\_indices(3) = 1 ; global\_indices(4) = int(mom\_dom\%njglobal/2)}
\DoxyCodeLine{1578   \textcolor{comment}{!For downsampled domain, recommend a halo of 1 (or 0?) since we're not doing wide-stencil computations.}}
\DoxyCodeLine{1579   \textcolor{comment}{!But that does not work because the downsampled field would not have the correct size to pass the checks, e.g., we get}}
\DoxyCodeLine{1580   \textcolor{comment}{!error: downsample\_diag\_indices\_get: peculiar size 28 in i-direction\(\backslash\)ndoes not match one of 24 25 26 27}}
\DoxyCodeLine{1581   xhalo\_d2 = int(mom\_dom\%nihalo/2)}
\DoxyCodeLine{1582   yhalo\_d2 = int(mom\_dom\%njhalo/2)}
\DoxyCodeLine{1583   \textcolor{keywordflow}{if} (mask\_table\_exists) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1584     \textcolor{keyword}{call }mom\_define\_domain( global\_indices, layout, mom\_dom\%mpp\_domain\_d2, \&}
\DoxyCodeLine{1585                 xflags=x\_flags, yflags=y\_flags, \&}
\DoxyCodeLine{1586                 xhalo=xhalo\_d2, yhalo=yhalo\_d2, \&}
\DoxyCodeLine{1587                 symmetry = mom\_dom\%symmetric, name=trim(\textcolor{stringliteral}{"MOMc"}), \&}
\DoxyCodeLine{1588                 maskmap=mom\_dom\%maskmap )}
\DoxyCodeLine{1589   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1590     \textcolor{keyword}{call }mom\_define\_domain( global\_indices, layout, mom\_dom\%mpp\_domain\_d2, \&}
\DoxyCodeLine{1591                 xflags=x\_flags, yflags=y\_flags, \&}
\DoxyCodeLine{1592                 xhalo=xhalo\_d2, yhalo=yhalo\_d2, \&}
\DoxyCodeLine{1593                 symmetry = mom\_dom\%symmetric, name=trim(\textcolor{stringliteral}{"MOMc"}))}
\DoxyCodeLine{1594 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1595 }
\DoxyCodeLine{1596   \textcolor{keywordflow}{if} ((io\_layout(1) > 0) .and. (io\_layout(2) > 0) .and. \&}
\DoxyCodeLine{1597       (layout(1)*layout(2) > 1)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1598     \textcolor{keyword}{call }mom\_define\_io\_domain(mom\_dom\%mpp\_domain\_d2, io\_layout)}
\DoxyCodeLine{1599 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1600 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_a98ff318d433bfde36936967df2f5187a}\label{namespacemom__domains_a98ff318d433bfde36936967df2f5187a}} 
\index{mom\_domains@{mom\_domains}!pass\_var\_2d@{pass\_var\_2d}}
\index{pass\_var\_2d@{pass\_var\_2d}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{pass\_var\_2d()}{pass\_var\_2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+domains\+::pass\+\_\+var\+\_\+2d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:), intent(inout)}]{array,  }\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(inout)}]{M\+O\+M\+\_\+dom,  }\item[{integer, intent(in), optional}]{sideflag,  }\item[{logical, intent(in), optional}]{complete,  }\item[{integer, intent(in), optional}]{position,  }\item[{integer, intent(in), optional}]{halo,  }\item[{integer, intent(in), optional}]{inner\+\_\+halo,  }\item[{integer, intent(in), optional}]{clock }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



pass\+\_\+var\+\_\+2d does a halo update for a two-\/dimensional array. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em array} & The array which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em mom\+\_\+dom} & The M\+O\+M\+\_\+domain\+\_\+type containing the mpp\+\_\+domain needed to determine where data should be sent. \\
\hline
\mbox{\texttt{ in}}  & {\em sideflag} & An optional integer indicating which directions the data should be sent. It is T\+O\+\_\+\+A\+LL or the sum of any of T\+O\+\_\+\+E\+A\+ST, T\+O\+\_\+\+W\+E\+ST, T\+O\+\_\+\+N\+O\+R\+TH, and T\+O\+\_\+\+S\+O\+U\+TH. For example, T\+O\+\_\+\+E\+A\+ST sends the data to the processor to the east, so the halos on the western side are filled. T\+O\+\_\+\+A\+LL is the default if sideflag is omitted. \\
\hline
\mbox{\texttt{ in}}  & {\em complete} & An optional argument indicating whether the halo updates should be completed before progress resumes. Omitting complete is the same as setting complete to .true. \\
\hline
\mbox{\texttt{ in}}  & {\em position} & An optional argument indicating the position. This is C\+E\+N\+T\+ER by default and is often C\+O\+R\+N\+ER, but could also be E\+A\+S\+T\+\_\+\+F\+A\+CE or N\+O\+R\+T\+H\+\_\+\+F\+A\+CE. \\
\hline
\mbox{\texttt{ in}}  & {\em halo} & The size of the halo to update -\/ the full halo by default. \\
\hline
\mbox{\texttt{ in}}  & {\em inner\+\_\+halo} & The size of an inner halo to avoid updating, or 0 to avoid updating symmetric memory computational domain points. Setting this $>$=0 also enforces that complete=.true. \\
\hline
\mbox{\texttt{ in}}  & {\em clock} & The handle for a cpu time clock that should be started then stopped to time this routine. \\
\hline
\end{DoxyParams}


Definition at line 190 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{190 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:)},  \textcolor{keywordtype}{intent(inout)} :: array\textcolor{comment}{    !< The array which is having its halos points}}
\DoxyCodeLine{191 \textcolor{comment}{                                                   !! exchanged.}}
\DoxyCodeLine{192   \textcolor{keywordtype}{type}(MOM\_domain\_type), \textcolor{keywordtype}{intent(inout)} :: MOM\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}}
\DoxyCodeLine{193 \textcolor{comment}{                                                   !! needed to determine where data should be sent.}}
\DoxyCodeLine{194   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: sideflag\textcolor{comment}{ !< An optional integer indicating which}}
\DoxyCodeLine{195 \textcolor{comment}{      !! directions the data should be sent. It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}}
\DoxyCodeLine{196 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH.  For example, TO\_EAST sends the data to the processor to the east,}}
\DoxyCodeLine{197 \textcolor{comment}{      !! so the halos on the western side are filled.  TO\_ALL is the default if sideflag is omitted.}}
\DoxyCodeLine{198   \textcolor{keywordtype}{logical},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: complete\textcolor{comment}{ !< An optional argument indicating whether the}}
\DoxyCodeLine{199 \textcolor{comment}{                                                   !! halo updates should be completed before}}
\DoxyCodeLine{200 \textcolor{comment}{                                                   !! progress resumes.  Omitting complete is the}}
\DoxyCodeLine{201 \textcolor{comment}{                                                   !! same as setting complete to .true.}}
\DoxyCodeLine{202   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: position\textcolor{comment}{ !< An optional argument indicating the position.}}
\DoxyCodeLine{203 \textcolor{comment}{                                                   !! This is CENTER by default and is often CORNER,}}
\DoxyCodeLine{204 \textcolor{comment}{                                                   !! but could also be EAST\_FACE or NORTH\_FACE.}}
\DoxyCodeLine{205   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full halo}}
\DoxyCodeLine{206 \textcolor{comment}{                                                   !! by default.}}
\DoxyCodeLine{207   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: inner\_halo\textcolor{comment}{ !< The size of an inner halo to avoid updating,}}
\DoxyCodeLine{208 \textcolor{comment}{                                                   !! or 0 to avoid updating symmetric memory}}
\DoxyCodeLine{209 \textcolor{comment}{                                                   !! computational domain points.  Setting this >=0}}
\DoxyCodeLine{210 \textcolor{comment}{                                                   !! also enforces that complete=.true.}}
\DoxyCodeLine{211   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}}
\DoxyCodeLine{212 \textcolor{comment}{                                                   !! started then stopped to time this routine.}}
\DoxyCodeLine{213 }
\DoxyCodeLine{214   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{215 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{dimension(:,:)} :: tmp}
\DoxyCodeLine{216   \textcolor{keywordtype}{integer} :: pos, i\_halo, j\_halo}
\DoxyCodeLine{217   \textcolor{keywordtype}{integer} :: isc, iec, jsc, jec, isd, ied, jsd, jed, IscB, IecB, JscB, JecB}
\DoxyCodeLine{218   \textcolor{keywordtype}{integer} :: inner, i, j, isfw, iefw, isfe, iefe, jsfs, jefs, jsfn, jefn}
\DoxyCodeLine{219   \textcolor{keywordtype}{integer} :: dirflag}
\DoxyCodeLine{220   \textcolor{keywordtype}{logical} :: block\_til\_complete}
\DoxyCodeLine{221 }
\DoxyCodeLine{222   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_begin(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{223 }
\DoxyCodeLine{224   dirflag = to\_all \textcolor{comment}{! 60}}
\DoxyCodeLine{225   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(sideflag)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (sideflag > 0) dirflag = sideflag ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{226   block\_til\_complete = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(complete)) block\_til\_complete = complete}
\DoxyCodeLine{227   pos = center ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(position)) pos = position}
\DoxyCodeLine{228 }
\DoxyCodeLine{229   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(inner\_halo)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (inner\_halo >= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{230     \textcolor{comment}{! Store the original values.}}
\DoxyCodeLine{231     \textcolor{keyword}{allocate}(tmp(\textcolor{keyword}{size}(array,1), \textcolor{keyword}{size}(array,2)))}
\DoxyCodeLine{232     tmp(:,:) = array(:,:)}
\DoxyCodeLine{233     block\_til\_complete = .true.}
\DoxyCodeLine{234 \textcolor{keywordflow}{  endif} ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{235 }
\DoxyCodeLine{236   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo) .and. mom\_dom\%thin\_halo\_updates) \textcolor{keywordflow}{then}}
\DoxyCodeLine{237     \textcolor{keyword}{call }mpp\_update\_domains(array, mom\_dom\%mpp\_domain, flags=dirflag, \&}
\DoxyCodeLine{238                         complete=block\_til\_complete, position=position, \&}
\DoxyCodeLine{239                         whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)}
\DoxyCodeLine{240   \textcolor{keywordflow}{else}}
\DoxyCodeLine{241     \textcolor{keyword}{call }mpp\_update\_domains(array, mom\_dom\%mpp\_domain, flags=dirflag, \&}
\DoxyCodeLine{242                         complete=block\_til\_complete, position=position)}
\DoxyCodeLine{243 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{244 }
\DoxyCodeLine{245   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(inner\_halo)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (inner\_halo >= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{246     \textcolor{keyword}{call }mpp\_get\_compute\_domain(mom\_dom\%mpp\_domain, isc, iec, jsc, jec)}
\DoxyCodeLine{247     \textcolor{keyword}{call }mpp\_get\_data\_domain(mom\_dom\%mpp\_domain, isd, ied, jsd, jed)}
\DoxyCodeLine{248     \textcolor{comment}{! Convert to local indices for arrays starting at 1.}}
\DoxyCodeLine{249     isc = isc - (isd-1) ; iec = iec - (isd-1) ; ied = ied - (isd-1) ; isd = 1}
\DoxyCodeLine{250     jsc = jsc - (jsd-1) ; jec = jec - (jsd-1) ; jed = jed - (jsd-1) ; jsd = 1}
\DoxyCodeLine{251     i\_halo = min(inner\_halo, isc-1) ; j\_halo = min(inner\_halo, jsc-1)}
\DoxyCodeLine{252 }
\DoxyCodeLine{253     \textcolor{comment}{! Figure out the array index extents of the eastern, western, northern and southern regions to copy.}}
\DoxyCodeLine{254     \textcolor{keywordflow}{if} (pos == center) \textcolor{keywordflow}{then}}
\DoxyCodeLine{255       \textcolor{keywordflow}{if} (\textcolor{keyword}{size}(array,1) == ied) \textcolor{keywordflow}{then}}
\DoxyCodeLine{256         isfw = isc - i\_halo ; iefw = isc ; isfe = iec ; iefe = iec + i\_halo}
\DoxyCodeLine{257       \textcolor{keywordflow}{else} ; \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"pass\_var\_2d: wrong i-size for CENTER array."}) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{258       \textcolor{keywordflow}{if} (\textcolor{keyword}{size}(array,2) == jed) \textcolor{keywordflow}{then}}
\DoxyCodeLine{259         isfw = isc - i\_halo ; iefw = isc ; isfe = iec ; iefe = iec + i\_halo}
\DoxyCodeLine{260       \textcolor{keywordflow}{else} ; \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"pass\_var\_2d: wrong j-size for CENTER array."}) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{261     \textcolor{keywordflow}{elseif} (pos == corner) \textcolor{keywordflow}{then}}
\DoxyCodeLine{262       \textcolor{keywordflow}{if} (\textcolor{keyword}{size}(array,1) == ied) \textcolor{keywordflow}{then}}
\DoxyCodeLine{263         isfw = max(isc - (i\_halo+1), 1) ; iefw = isc ; isfe = iec ; iefe = iec + i\_halo}
\DoxyCodeLine{264       \textcolor{keywordflow}{elseif} (\textcolor{keyword}{size}(array,1) == ied+1) \textcolor{keywordflow}{then}}
\DoxyCodeLine{265         isfw = isc - i\_halo ; iefw = isc+1 ; isfe = iec+1 ; iefe = min(iec + 1 + i\_halo, ied+1)}
\DoxyCodeLine{266       \textcolor{keywordflow}{else} ; \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"pass\_var\_2d: wrong i-size for CORNER array."}) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{267       \textcolor{keywordflow}{if} (\textcolor{keyword}{size}(array,2) == jed) \textcolor{keywordflow}{then}}
\DoxyCodeLine{268         jsfs = max(jsc - (j\_halo+1), 1) ; jefs = jsc ; jsfn = jec ; jefn = jec + j\_halo}
\DoxyCodeLine{269       \textcolor{keywordflow}{elseif} (\textcolor{keyword}{size}(array,2) == jed+1) \textcolor{keywordflow}{then}}
\DoxyCodeLine{270         jsfs = jsc - j\_halo ; jefs = jsc+1 ; jsfn = jec+1 ; jefn = min(jec + 1 + j\_halo, jed+1)}
\DoxyCodeLine{271       \textcolor{keywordflow}{else} ; \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"pass\_var\_2d: wrong j-size for CORNER array."}) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{272     \textcolor{keywordflow}{elseif} (pos == north\_face) \textcolor{keywordflow}{then}}
\DoxyCodeLine{273       \textcolor{keywordflow}{if} (\textcolor{keyword}{size}(array,1) == ied) \textcolor{keywordflow}{then}}
\DoxyCodeLine{274         isfw = isc - i\_halo ; iefw = isc ; isfe = iec ; iefe = iec + i\_halo}
\DoxyCodeLine{275       \textcolor{keywordflow}{else} ; \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"pass\_var\_2d: wrong i-size for NORTH\_FACE array."}) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{276       \textcolor{keywordflow}{if} (\textcolor{keyword}{size}(array,2) == jed) \textcolor{keywordflow}{then}}
\DoxyCodeLine{277         jsfs = max(jsc - (j\_halo+1), 1) ; jefs = jsc ; jsfn = jec ; jefn = jec + j\_halo}
\DoxyCodeLine{278       \textcolor{keywordflow}{elseif} (\textcolor{keyword}{size}(array,2) == jed+1) \textcolor{keywordflow}{then}}
\DoxyCodeLine{279         jsfs = jsc - j\_halo ; jefs = jsc+1 ; jsfn = jec+1 ; jefn = min(jec + 1 + j\_halo, jed+1)}
\DoxyCodeLine{280       \textcolor{keywordflow}{else} ; \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"pass\_var\_2d: wrong j-size for NORTH\_FACE array."}) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{281     \textcolor{keywordflow}{elseif} (pos == east\_face) \textcolor{keywordflow}{then}}
\DoxyCodeLine{282       \textcolor{keywordflow}{if} (\textcolor{keyword}{size}(array,1) == ied) \textcolor{keywordflow}{then}}
\DoxyCodeLine{283         isfw = max(isc - (i\_halo+1), 1) ; iefw = isc ; isfe = iec ; iefe = iec + i\_halo}
\DoxyCodeLine{284       \textcolor{keywordflow}{elseif} (\textcolor{keyword}{size}(array,1) == ied+1) \textcolor{keywordflow}{then}}
\DoxyCodeLine{285         isfw = isc - i\_halo ; iefw = isc+1 ; isfe = iec+1 ; iefe = min(iec + 1 + i\_halo, ied+1)}
\DoxyCodeLine{286       \textcolor{keywordflow}{else} ; \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"pass\_var\_2d: wrong i-size for EAST\_FACE array."}) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{287       \textcolor{keywordflow}{if} (\textcolor{keyword}{size}(array,2) == jed) \textcolor{keywordflow}{then}}
\DoxyCodeLine{288         isfw = isc - i\_halo ; iefw = isc ; isfe = iec ; iefe = iec + i\_halo}
\DoxyCodeLine{289       \textcolor{keywordflow}{else} ; \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"pass\_var\_2d: wrong j-size for EAST\_FACE array."}) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{290     \textcolor{keywordflow}{else}}
\DoxyCodeLine{291       \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"pass\_var\_2d: Unrecognized position"})}
\DoxyCodeLine{292 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{293 }
\DoxyCodeLine{294     \textcolor{comment}{! Copy back the stored inner halo points}}
\DoxyCodeLine{295     \textcolor{keywordflow}{do} j=jsfs,jefn ; \textcolor{keywordflow}{do} i=isfw,iefw ; array(i,j) = tmp(i,j) ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{296     \textcolor{keywordflow}{do} j=jsfs,jefn ; \textcolor{keywordflow}{do} i=isfe,iefe ; array(i,j) = tmp(i,j) ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{297     \textcolor{keywordflow}{do} j=jsfs,jefs ; \textcolor{keywordflow}{do} i=isfw,iefe ; array(i,j) = tmp(i,j) ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{298     \textcolor{keywordflow}{do} j=jsfn,jefn ; \textcolor{keywordflow}{do} i=isfw,iefe ; array(i,j) = tmp(i,j) ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{299 }
\DoxyCodeLine{300     \textcolor{keyword}{deallocate}(tmp)}
\DoxyCodeLine{301 \textcolor{keywordflow}{  endif} ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{302 }
\DoxyCodeLine{303   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_end(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{304 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_a999a002240cf83d613c2c792c1a55a3e}\label{namespacemom__domains_a999a002240cf83d613c2c792c1a55a3e}} 
\index{mom\_domains@{mom\_domains}!pass\_var\_3d@{pass\_var\_3d}}
\index{pass\_var\_3d@{pass\_var\_3d}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{pass\_var\_3d()}{pass\_var\_3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+domains\+::pass\+\_\+var\+\_\+3d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:,\+:), intent(inout)}]{array,  }\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(inout)}]{M\+O\+M\+\_\+dom,  }\item[{integer, intent(in), optional}]{sideflag,  }\item[{logical, intent(in), optional}]{complete,  }\item[{integer, intent(in), optional}]{position,  }\item[{integer, intent(in), optional}]{halo,  }\item[{integer, intent(in), optional}]{clock }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



pass\+\_\+var\+\_\+3d does a halo update for a three-\/dimensional array. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em array} & The array which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em mom\+\_\+dom} & The M\+O\+M\+\_\+domain\+\_\+type containing the mpp\+\_\+domain needed to determine where data should be sent. \\
\hline
\mbox{\texttt{ in}}  & {\em sideflag} & An optional integer indicating which directions the data should be sent. It is T\+O\+\_\+\+A\+LL or the sum of any of T\+O\+\_\+\+E\+A\+ST, T\+O\+\_\+\+W\+E\+ST, T\+O\+\_\+\+N\+O\+R\+TH, and T\+O\+\_\+\+S\+O\+U\+TH. For example, T\+O\+\_\+\+E\+A\+ST sends the data to the processor to the east, sothe halos on the western side are filled. T\+O\+\_\+\+A\+LL is the default if sideflag is omitted. \\
\hline
\mbox{\texttt{ in}}  & {\em complete} & An optional argument indicating whether the halo updates should be completed before progress resumes. Omitting complete is the same as setting complete to .true. \\
\hline
\mbox{\texttt{ in}}  & {\em position} & An optional argument indicating the position. This is C\+E\+N\+T\+ER by default and is often C\+O\+R\+N\+ER, but could also be E\+A\+S\+T\+\_\+\+F\+A\+CE or N\+O\+R\+T\+H\+\_\+\+F\+A\+CE. \\
\hline
\mbox{\texttt{ in}}  & {\em halo} & The size of the halo to update -\/ the full halo by default. \\
\hline
\mbox{\texttt{ in}}  & {\em clock} & The handle for a cpu time clock that should be started then stopped to time this routine. \\
\hline
\end{DoxyParams}


Definition at line 144 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{144 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: array\textcolor{comment}{    !< The array which is having its halos points}}
\DoxyCodeLine{145 \textcolor{comment}{                                                    !! exchanged.}}
\DoxyCodeLine{146   \textcolor{keywordtype}{type}(MOM\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: MOM\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}}
\DoxyCodeLine{147 \textcolor{comment}{                                                    !! needed to determine where data should be}}
\DoxyCodeLine{148 \textcolor{comment}{                                                    !! sent.}}
\DoxyCodeLine{149   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: sideflag\textcolor{comment}{ !< An optional integer indicating which}}
\DoxyCodeLine{150 \textcolor{comment}{      !! directions the data should be sent.  It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}}
\DoxyCodeLine{151 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH.  For example, TO\_EAST sends the data to the processor to the east,}}
\DoxyCodeLine{152 \textcolor{comment}{      !! sothe halos on the western side are filled.  TO\_ALL is the default if sideflag is omitted.}}
\DoxyCodeLine{153   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: complete\textcolor{comment}{ !< An optional argument indicating whether the}}
\DoxyCodeLine{154 \textcolor{comment}{                                                    !! halo updates should be completed before}}
\DoxyCodeLine{155 \textcolor{comment}{                                                    !! progress resumes. Omitting complete is the}}
\DoxyCodeLine{156 \textcolor{comment}{                                                    !! same as setting complete to .true.}}
\DoxyCodeLine{157   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: position\textcolor{comment}{ !< An optional argument indicating the position.}}
\DoxyCodeLine{158 \textcolor{comment}{                                                    !! This is CENTER by default and is often CORNER,}}
\DoxyCodeLine{159 \textcolor{comment}{                                                    !! but could also be EAST\_FACE or NORTH\_FACE.}}
\DoxyCodeLine{160   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}}
\DoxyCodeLine{161 \textcolor{comment}{                                                    !! halo by default.}}
\DoxyCodeLine{162   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}}
\DoxyCodeLine{163 \textcolor{comment}{                                                    !! started then stopped to time this routine.}}
\DoxyCodeLine{164 }
\DoxyCodeLine{165   \textcolor{keywordtype}{integer} :: dirflag}
\DoxyCodeLine{166   \textcolor{keywordtype}{logical} :: block\_til\_complete}
\DoxyCodeLine{167 }
\DoxyCodeLine{168   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_begin(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{169 }
\DoxyCodeLine{170   dirflag = to\_all \textcolor{comment}{! 60}}
\DoxyCodeLine{171   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(sideflag)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (sideflag > 0) dirflag = sideflag ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{172   block\_til\_complete = .true.}
\DoxyCodeLine{173   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(complete)) block\_til\_complete = complete}
\DoxyCodeLine{174 }
\DoxyCodeLine{175   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo) .and. mom\_dom\%thin\_halo\_updates) \textcolor{keywordflow}{then}}
\DoxyCodeLine{176     \textcolor{keyword}{call }mpp\_update\_domains(array, mom\_dom\%mpp\_domain, flags=dirflag, \&}
\DoxyCodeLine{177                         complete=block\_til\_complete, position=position, \&}
\DoxyCodeLine{178                         whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)}
\DoxyCodeLine{179   \textcolor{keywordflow}{else}}
\DoxyCodeLine{180     \textcolor{keyword}{call }mpp\_update\_domains(array, mom\_dom\%mpp\_domain, flags=dirflag, \&}
\DoxyCodeLine{181                           complete=block\_til\_complete, position=position)}
\DoxyCodeLine{182 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{183 }
\DoxyCodeLine{184   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_end(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{185 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_ab7f3448204f6b2b959174c7458299efd}\label{namespacemom__domains_ab7f3448204f6b2b959174c7458299efd}} 
\index{mom\_domains@{mom\_domains}!pass\_var\_complete\_2d@{pass\_var\_complete\_2d}}
\index{pass\_var\_complete\_2d@{pass\_var\_complete\_2d}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{pass\_var\_complete\_2d()}{pass\_var\_complete\_2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+domains\+::pass\+\_\+var\+\_\+complete\+\_\+2d (\begin{DoxyParamCaption}\item[{integer, intent(in)}]{id\+\_\+update,  }\item[{real, dimension(\+:,\+:), intent(inout)}]{array,  }\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(inout)}]{M\+O\+M\+\_\+dom,  }\item[{integer, intent(in), optional}]{sideflag,  }\item[{integer, intent(in), optional}]{position,  }\item[{integer, intent(in), optional}]{halo,  }\item[{integer, intent(in), optional}]{clock }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



pass\+\_\+var\+\_\+complete\+\_\+2d completes a halo update for a two-\/dimensional array. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em id\+\_\+update} & The integer id of this update which has been returned from a previous call to \mbox{\hyperlink{interfacemom__domains_1_1pass__var__start}{pass\+\_\+var\+\_\+start}}. \\
\hline
\mbox{\texttt{ in,out}}  & {\em array} & The array which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em mom\+\_\+dom} & The M\+O\+M\+\_\+domain\+\_\+type containing the mpp\+\_\+domain needed to determine where data should be sent. \\
\hline
\mbox{\texttt{ in}}  & {\em sideflag} & An optional integer indicating which directions the data should be sent. It is T\+O\+\_\+\+A\+LL or the sum of any of T\+O\+\_\+\+E\+A\+ST, T\+O\+\_\+\+W\+E\+ST, T\+O\+\_\+\+N\+O\+R\+TH, and T\+O\+\_\+\+S\+O\+U\+TH. For example, T\+O\+\_\+\+E\+A\+ST sends the data to the processor to the east, so the halos on the western side are filled. T\+O\+\_\+\+A\+LL is the default if sideflag is omitted. \\
\hline
\mbox{\texttt{ in}}  & {\em position} & An optional argument indicating the position. This is C\+E\+N\+T\+ER by default and is often C\+O\+R\+N\+ER, but could also be E\+A\+S\+T\+\_\+\+F\+A\+CE or N\+O\+R\+T\+H\+\_\+\+F\+A\+CE. \\
\hline
\mbox{\texttt{ in}}  & {\em halo} & The size of the halo to update -\/ the full halo by default. \\
\hline
\mbox{\texttt{ in}}  & {\em clock} & The handle for a cpu time clock that should be started then stopped to time this routine. \\
\hline
\end{DoxyParams}


Definition at line 400 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{400   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{intent(in)}    :: id\_update\textcolor{comment}{ !< The integer id of this update which has}}
\DoxyCodeLine{401 \textcolor{comment}{                                                    !! been returned from a previous call to}}
\DoxyCodeLine{402 \textcolor{comment}{                                                    !! pass\_var\_start.}}
\DoxyCodeLine{403 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:)},   \textcolor{keywordtype}{intent(inout)} :: array\textcolor{comment}{    !< The array which is having its halos points}}
\DoxyCodeLine{404 \textcolor{comment}{                                                    !! exchanged.}}
\DoxyCodeLine{405   \textcolor{keywordtype}{type}(MOM\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: MOM\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}}
\DoxyCodeLine{406 \textcolor{comment}{                                                    !! needed to determine where data should be}}
\DoxyCodeLine{407 \textcolor{comment}{                                                    !! sent.}}
\DoxyCodeLine{408   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: sideflag\textcolor{comment}{ !< An optional integer indicating which}}
\DoxyCodeLine{409 \textcolor{comment}{      !! directions the data should be sent. It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}}
\DoxyCodeLine{410 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH.  For example, TO\_EAST sends the data to the processor to the east,}}
\DoxyCodeLine{411 \textcolor{comment}{      !! so the halos on the western side are filled.  TO\_ALL is the default if sideflag is omitted.}}
\DoxyCodeLine{412   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: position\textcolor{comment}{ !< An optional argument indicating the position.}}
\DoxyCodeLine{413 \textcolor{comment}{                                                    !! This is CENTER by default and is often CORNER,}}
\DoxyCodeLine{414 \textcolor{comment}{                                                    !! but could also be EAST\_FACE or NORTH\_FACE.}}
\DoxyCodeLine{415   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}}
\DoxyCodeLine{416 \textcolor{comment}{                                                    !! halo by default.}}
\DoxyCodeLine{417   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}}
\DoxyCodeLine{418 \textcolor{comment}{                                                    !! started then stopped to time this routine.}}
\DoxyCodeLine{419 }
\DoxyCodeLine{420   \textcolor{keywordtype}{integer} :: dirflag}
\DoxyCodeLine{421 }
\DoxyCodeLine{422   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_begin(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{423 }
\DoxyCodeLine{424   dirflag = to\_all \textcolor{comment}{! 60}}
\DoxyCodeLine{425   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(sideflag)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (sideflag > 0) dirflag = sideflag ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{426 }
\DoxyCodeLine{427   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo) .and. mom\_dom\%thin\_halo\_updates) \textcolor{keywordflow}{then}}
\DoxyCodeLine{428     \textcolor{keyword}{call }mpp\_complete\_update\_domains(id\_update, array, mom\_dom\%mpp\_domain, \&}
\DoxyCodeLine{429                             flags=dirflag, position=position, \&}
\DoxyCodeLine{430                             whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)}
\DoxyCodeLine{431   \textcolor{keywordflow}{else}}
\DoxyCodeLine{432     \textcolor{keyword}{call }mpp\_complete\_update\_domains(id\_update, array, mom\_dom\%mpp\_domain, \&}
\DoxyCodeLine{433                                      flags=dirflag, position=position)}
\DoxyCodeLine{434 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{435 }
\DoxyCodeLine{436   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_end(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{437 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_aaf84cb739a4915a17a12898a0bd33ace}\label{namespacemom__domains_aaf84cb739a4915a17a12898a0bd33ace}} 
\index{mom\_domains@{mom\_domains}!pass\_var\_complete\_3d@{pass\_var\_complete\_3d}}
\index{pass\_var\_complete\_3d@{pass\_var\_complete\_3d}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{pass\_var\_complete\_3d()}{pass\_var\_complete\_3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+domains\+::pass\+\_\+var\+\_\+complete\+\_\+3d (\begin{DoxyParamCaption}\item[{integer, intent(in)}]{id\+\_\+update,  }\item[{real, dimension(\+:,\+:,\+:), intent(inout)}]{array,  }\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(inout)}]{M\+O\+M\+\_\+dom,  }\item[{integer, intent(in), optional}]{sideflag,  }\item[{integer, intent(in), optional}]{position,  }\item[{integer, intent(in), optional}]{halo,  }\item[{integer, intent(in), optional}]{clock }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



pass\+\_\+var\+\_\+complete\+\_\+3d completes a halo update for a three-\/dimensional array. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em id\+\_\+update} & The integer id of this update which has been returned from a previous call to \mbox{\hyperlink{interfacemom__domains_1_1pass__var__start}{pass\+\_\+var\+\_\+start}}. \\
\hline
\mbox{\texttt{ in,out}}  & {\em array} & The array which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em mom\+\_\+dom} & The M\+O\+M\+\_\+domain\+\_\+type containing the mpp\+\_\+domain needed to determine where data should be sent. \\
\hline
\mbox{\texttt{ in}}  & {\em sideflag} & An optional integer indicating which directions the data should be sent. It is T\+O\+\_\+\+A\+LL or the sum of any of T\+O\+\_\+\+E\+A\+ST, T\+O\+\_\+\+W\+E\+ST, T\+O\+\_\+\+N\+O\+R\+TH, and T\+O\+\_\+\+S\+O\+U\+TH. For example, T\+O\+\_\+\+E\+A\+ST sends the data to the processor to the east, so the halos on the western side are filled. T\+O\+\_\+\+A\+LL is the default if sideflag is omitted. \\
\hline
\mbox{\texttt{ in}}  & {\em position} & An optional argument indicating the position. This is C\+E\+N\+T\+ER by default and is often C\+O\+R\+N\+ER, but could also be E\+A\+S\+T\+\_\+\+F\+A\+CE or N\+O\+R\+T\+H\+\_\+\+F\+A\+CE. \\
\hline
\mbox{\texttt{ in}}  & {\em halo} & The size of the halo to update -\/ the full halo by default. \\
\hline
\mbox{\texttt{ in}}  & {\em clock} & The handle for a cpu time clock that should be started then stopped to time this routine. \\
\hline
\end{DoxyParams}


Definition at line 443 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{443   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{intent(in)}    :: id\_update\textcolor{comment}{ !< The integer id of this update which has}}
\DoxyCodeLine{444 \textcolor{comment}{                                                    !! been returned from a previous call to}}
\DoxyCodeLine{445 \textcolor{comment}{                                                    !! pass\_var\_start.}}
\DoxyCodeLine{446 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: array\textcolor{comment}{    !< The array which is having its halos points}}
\DoxyCodeLine{447 \textcolor{comment}{                                                    !! exchanged.}}
\DoxyCodeLine{448   \textcolor{keywordtype}{type}(MOM\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: MOM\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}}
\DoxyCodeLine{449 \textcolor{comment}{                                                    !! needed to determine where data should be}}
\DoxyCodeLine{450 \textcolor{comment}{                                                    !! sent.}}
\DoxyCodeLine{451   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: sideflag\textcolor{comment}{ !< An optional integer indicating which}}
\DoxyCodeLine{452 \textcolor{comment}{      !! directions the data should be sent. It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}}
\DoxyCodeLine{453 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH.  For example, TO\_EAST sends the data to the processor to the east,}}
\DoxyCodeLine{454 \textcolor{comment}{      !! so the halos on the western side are filled.  TO\_ALL is the default if sideflag is omitted.}}
\DoxyCodeLine{455   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: position\textcolor{comment}{ !< An optional argument indicating the position.}}
\DoxyCodeLine{456 \textcolor{comment}{                                                    !! This is CENTER by default and is often CORNER,}}
\DoxyCodeLine{457 \textcolor{comment}{                                                    !! but could also be EAST\_FACE or NORTH\_FACE.}}
\DoxyCodeLine{458   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}}
\DoxyCodeLine{459 \textcolor{comment}{                                                    !! halo by default.}}
\DoxyCodeLine{460   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}}
\DoxyCodeLine{461 \textcolor{comment}{                                                    !! started then stopped to time this routine.}}
\DoxyCodeLine{462 }
\DoxyCodeLine{463   \textcolor{keywordtype}{integer} :: dirflag}
\DoxyCodeLine{464 }
\DoxyCodeLine{465   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_begin(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{466 }
\DoxyCodeLine{467   dirflag = to\_all \textcolor{comment}{! 60}}
\DoxyCodeLine{468   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(sideflag)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (sideflag > 0) dirflag = sideflag ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{469 }
\DoxyCodeLine{470   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo) .and. mom\_dom\%thin\_halo\_updates) \textcolor{keywordflow}{then}}
\DoxyCodeLine{471     \textcolor{keyword}{call }mpp\_complete\_update\_domains(id\_update, array, mom\_dom\%mpp\_domain, \&}
\DoxyCodeLine{472                             flags=dirflag, position=position, \&}
\DoxyCodeLine{473                             whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)}
\DoxyCodeLine{474   \textcolor{keywordflow}{else}}
\DoxyCodeLine{475     \textcolor{keyword}{call }mpp\_complete\_update\_domains(id\_update, array, mom\_dom\%mpp\_domain, \&}
\DoxyCodeLine{476                                      flags=dirflag, position=position)}
\DoxyCodeLine{477 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{478 }
\DoxyCodeLine{479   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_end(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{480 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_a12e2e78eaf5b2d63da34a190052881e2}\label{namespacemom__domains_a12e2e78eaf5b2d63da34a190052881e2}} 
\index{mom\_domains@{mom\_domains}!pass\_var\_start\_2d@{pass\_var\_start\_2d}}
\index{pass\_var\_start\_2d@{pass\_var\_start\_2d}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{pass\_var\_start\_2d()}{pass\_var\_start\_2d()}}
{\footnotesize\ttfamily integer function mom\+\_\+domains\+::pass\+\_\+var\+\_\+start\+\_\+2d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:), intent(inout)}]{array,  }\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(inout)}]{M\+O\+M\+\_\+dom,  }\item[{integer, intent(in), optional}]{sideflag,  }\item[{integer, intent(in), optional}]{position,  }\item[{logical, intent(in), optional}]{complete,  }\item[{integer, intent(in), optional}]{halo,  }\item[{integer, intent(in), optional}]{clock }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



pass\+\_\+var\+\_\+start\+\_\+2d starts a halo update for a two-\/dimensional array. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em array} & The array which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em mom\+\_\+dom} & The M\+O\+M\+\_\+domain\+\_\+type containing the mpp\+\_\+domain needed to determine where data should be sent. \\
\hline
\mbox{\texttt{ in}}  & {\em sideflag} & An optional integer indicating which directions the data should be sent. It is T\+O\+\_\+\+A\+LL or the sum of any of T\+O\+\_\+\+E\+A\+ST, T\+O\+\_\+\+W\+E\+ST, T\+O\+\_\+\+N\+O\+R\+TH, and T\+O\+\_\+\+S\+O\+U\+TH. For example, T\+O\+\_\+\+E\+A\+ST sends the data to the processor to the east, so the halos on the western side are filled. T\+O\+\_\+\+A\+LL is the default if sideflag is omitted. \\
\hline
\mbox{\texttt{ in}}  & {\em position} & An optional argument indicating the position. This is C\+E\+N\+T\+ER by default and is often C\+O\+R\+N\+ER, but could also be E\+A\+S\+T\+\_\+\+F\+A\+CE or N\+O\+R\+T\+H\+\_\+\+F\+A\+CE. \\
\hline
\mbox{\texttt{ in}}  & {\em complete} & An optional argument indicating whether the halo updates should be completed before progress resumes. Omitting complete is the same as setting complete to .true. \\
\hline
\mbox{\texttt{ in}}  & {\em halo} & The size of the halo to update -\/ the full halo by default. \\
\hline
\mbox{\texttt{ in}}  & {\em clock} & The handle for a cpu time clock that should be started then stopped to time this routine. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The integer index for this update. 
\end{DoxyReturn}


Definition at line 310 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{310 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:)},   \textcolor{keywordtype}{intent(inout)} :: array\textcolor{comment}{    !< The array which is having its halos points}}
\DoxyCodeLine{311 \textcolor{comment}{                                                    !! exchanged.}}
\DoxyCodeLine{312   \textcolor{keywordtype}{type}(MOM\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: MOM\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}}
\DoxyCodeLine{313 \textcolor{comment}{                                                    !! needed to determine where data should be}}
\DoxyCodeLine{314 \textcolor{comment}{                                                    !! sent.}}
\DoxyCodeLine{315   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: sideflag\textcolor{comment}{ !< An optional integer indicating which}}
\DoxyCodeLine{316 \textcolor{comment}{      !! directions the data should be sent. It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}}
\DoxyCodeLine{317 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH.  For example, TO\_EAST sends the data to the processor to the east,}}
\DoxyCodeLine{318 \textcolor{comment}{      !! so the halos on the western side are filled.  TO\_ALL is the default if sideflag is omitted.}}
\DoxyCodeLine{319   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: position\textcolor{comment}{ !< An optional argument indicating the position.}}
\DoxyCodeLine{320 \textcolor{comment}{                                                    !! This is CENTER by default and is often CORNER,}}
\DoxyCodeLine{321 \textcolor{comment}{                                                    !! but could also be EAST\_FACE or NORTH\_FACE.}}
\DoxyCodeLine{322   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: complete\textcolor{comment}{ !< An optional argument indicating whether the}}
\DoxyCodeLine{323 \textcolor{comment}{                                                    !! halo updates should be completed before}}
\DoxyCodeLine{324 \textcolor{comment}{                                                    !! progress resumes.  Omitting complete is the}}
\DoxyCodeLine{325 \textcolor{comment}{                                                    !! same as setting complete to .true.}}
\DoxyCodeLine{326   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}}
\DoxyCodeLine{327 \textcolor{comment}{                                                    !! halo by default.}}
\DoxyCodeLine{328   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}}
\DoxyCodeLine{329 \textcolor{comment}{                                                    !! started then stopped to time this routine.}}
\DoxyCodeLine{330   \textcolor{keywordtype}{integer}                               :: pass\_var\_start\_2d\textcolor{comment}{  !<The integer index for this update.}}
\DoxyCodeLine{331 }
\DoxyCodeLine{332   \textcolor{keywordtype}{integer} :: dirflag}
\DoxyCodeLine{333 }
\DoxyCodeLine{334   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_begin(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{335 }
\DoxyCodeLine{336   dirflag = to\_all \textcolor{comment}{! 60}}
\DoxyCodeLine{337   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(sideflag)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (sideflag > 0) dirflag = sideflag ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{338 }
\DoxyCodeLine{339   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo) .and. mom\_dom\%thin\_halo\_updates) \textcolor{keywordflow}{then}}
\DoxyCodeLine{340     pass\_var\_start\_2d = mpp\_start\_update\_domains(array, mom\_dom\%mpp\_domain, \&}
\DoxyCodeLine{341                             flags=dirflag, position=position, \&}
\DoxyCodeLine{342                             whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)}
\DoxyCodeLine{343   \textcolor{keywordflow}{else}}
\DoxyCodeLine{344     pass\_var\_start\_2d = mpp\_start\_update\_domains(array, mom\_dom\%mpp\_domain, \&}
\DoxyCodeLine{345                             flags=dirflag, position=position)}
\DoxyCodeLine{346 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{347 }
\DoxyCodeLine{348   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_end(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{349 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_ae69b74b11620d559736ee87e644fcd7f}\label{namespacemom__domains_ae69b74b11620d559736ee87e644fcd7f}} 
\index{mom\_domains@{mom\_domains}!pass\_var\_start\_3d@{pass\_var\_start\_3d}}
\index{pass\_var\_start\_3d@{pass\_var\_start\_3d}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{pass\_var\_start\_3d()}{pass\_var\_start\_3d()}}
{\footnotesize\ttfamily integer function mom\+\_\+domains\+::pass\+\_\+var\+\_\+start\+\_\+3d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:,\+:), intent(inout)}]{array,  }\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(inout)}]{M\+O\+M\+\_\+dom,  }\item[{integer, intent(in), optional}]{sideflag,  }\item[{integer, intent(in), optional}]{position,  }\item[{logical, intent(in), optional}]{complete,  }\item[{integer, intent(in), optional}]{halo,  }\item[{integer, intent(in), optional}]{clock }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



pass\+\_\+var\+\_\+start\+\_\+3d starts a halo update for a three-\/dimensional array. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em array} & The array which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em mom\+\_\+dom} & The M\+O\+M\+\_\+domain\+\_\+type containing the mpp\+\_\+domain needed to determine where data should be sent. \\
\hline
\mbox{\texttt{ in}}  & {\em sideflag} & An optional integer indicating which directions the data should be sent. It is T\+O\+\_\+\+A\+LL or the sum of any of T\+O\+\_\+\+E\+A\+ST, T\+O\+\_\+\+W\+E\+ST, T\+O\+\_\+\+N\+O\+R\+TH, and T\+O\+\_\+\+S\+O\+U\+TH. For example, T\+O\+\_\+\+E\+A\+ST sends the data to the processor to the east, so the halos on the western side are filled. T\+O\+\_\+\+A\+LL is the default if sideflag is omitted. \\
\hline
\mbox{\texttt{ in}}  & {\em position} & An optional argument indicating the position. This is C\+E\+N\+T\+ER by default and is often C\+O\+R\+N\+ER, but could also be E\+A\+S\+T\+\_\+\+F\+A\+CE or N\+O\+R\+T\+H\+\_\+\+F\+A\+CE. \\
\hline
\mbox{\texttt{ in}}  & {\em complete} & An optional argument indicating whether the halo updates should be completed before progress resumes. Omitting complete is the same as setting complete to .true. \\
\hline
\mbox{\texttt{ in}}  & {\em halo} & The size of the halo to update -\/ the full halo by default. \\
\hline
\mbox{\texttt{ in}}  & {\em clock} & The handle for a cpu time clock that should be started then stopped to time this routine. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The integer index for this update. 
\end{DoxyReturn}


Definition at line 355 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{355 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: array\textcolor{comment}{    !< The array which is having its halos points}}
\DoxyCodeLine{356 \textcolor{comment}{                                                    !! exchanged.}}
\DoxyCodeLine{357   \textcolor{keywordtype}{type}(MOM\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: MOM\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}}
\DoxyCodeLine{358 \textcolor{comment}{                                                    !! needed to determine where data should be}}
\DoxyCodeLine{359 \textcolor{comment}{                                                    !! sent.}}
\DoxyCodeLine{360   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: sideflag\textcolor{comment}{ !< An optional integer indicating which}}
\DoxyCodeLine{361 \textcolor{comment}{      !! directions the data should be sent. It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}}
\DoxyCodeLine{362 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH.  For example, TO\_EAST sends the data to the processor to the east,}}
\DoxyCodeLine{363 \textcolor{comment}{      !! so the halos on the western side are filled.  TO\_ALL is the default if sideflag is omitted.}}
\DoxyCodeLine{364   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: position\textcolor{comment}{ !< An optional argument indicating the position.}}
\DoxyCodeLine{365 \textcolor{comment}{                                                    !! This is CENTER by default and is often CORNER,}}
\DoxyCodeLine{366 \textcolor{comment}{                                                    !! but could also be EAST\_FACE or NORTH\_FACE.}}
\DoxyCodeLine{367   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: complete\textcolor{comment}{ !< An optional argument indicating whether the}}
\DoxyCodeLine{368 \textcolor{comment}{                                                    !! halo updates should be completed before}}
\DoxyCodeLine{369 \textcolor{comment}{                                                    !! progress resumes.  Omitting complete is the}}
\DoxyCodeLine{370 \textcolor{comment}{                                                    !! same as setting complete to .true.}}
\DoxyCodeLine{371   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}}
\DoxyCodeLine{372 \textcolor{comment}{                                                    !! halo by default.}}
\DoxyCodeLine{373   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}}
\DoxyCodeLine{374 \textcolor{comment}{                                                    !! started then stopped to time this routine.}}
\DoxyCodeLine{375   \textcolor{keywordtype}{integer}                               :: pass\_var\_start\_3d\textcolor{comment}{  !< The integer index for this update.}}
\DoxyCodeLine{376 }
\DoxyCodeLine{377   \textcolor{keywordtype}{integer} :: dirflag}
\DoxyCodeLine{378 }
\DoxyCodeLine{379   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_begin(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{380 }
\DoxyCodeLine{381   dirflag = to\_all \textcolor{comment}{! 60}}
\DoxyCodeLine{382   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(sideflag)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (sideflag > 0) dirflag = sideflag ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{383 }
\DoxyCodeLine{384   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo) .and. mom\_dom\%thin\_halo\_updates) \textcolor{keywordflow}{then}}
\DoxyCodeLine{385     pass\_var\_start\_3d = mpp\_start\_update\_domains(array, mom\_dom\%mpp\_domain, \&}
\DoxyCodeLine{386                             flags=dirflag, position=position, \&}
\DoxyCodeLine{387                             whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)}
\DoxyCodeLine{388   \textcolor{keywordflow}{else}}
\DoxyCodeLine{389     pass\_var\_start\_3d = mpp\_start\_update\_domains(array, mom\_dom\%mpp\_domain, \&}
\DoxyCodeLine{390                             flags=dirflag, position=position)}
\DoxyCodeLine{391 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{392 }
\DoxyCodeLine{393   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_end(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{394 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_af0e7230b07b8bdce96b89475a87c0622}\label{namespacemom__domains_af0e7230b07b8bdce96b89475a87c0622}} 
\index{mom\_domains@{mom\_domains}!pass\_vector\_2d@{pass\_vector\_2d}}
\index{pass\_vector\_2d@{pass\_vector\_2d}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{pass\_vector\_2d()}{pass\_vector\_2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+domains\+::pass\+\_\+vector\+\_\+2d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:), intent(inout)}]{u\+\_\+cmpt,  }\item[{real, dimension(\+:,\+:), intent(inout)}]{v\+\_\+cmpt,  }\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(inout)}]{M\+O\+M\+\_\+dom,  }\item[{integer, intent(in), optional}]{direction,  }\item[{integer, intent(in), optional}]{stagger,  }\item[{logical, intent(in), optional}]{complete,  }\item[{integer, intent(in), optional}]{halo,  }\item[{integer, intent(in), optional}]{clock }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



pass\+\_\+vector\+\_\+2d does a halo update for a pair of two-\/dimensional arrays representing the compontents of a two-\/dimensional horizontal vector. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em u\+\_\+cmpt} & The nominal zonal (u) component of the vector pair which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em v\+\_\+cmpt} & The nominal meridional (v) component of the vector pair which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em mom\+\_\+dom} & The M\+O\+M\+\_\+domain\+\_\+type containing the mpp\+\_\+domain needed to determine where data should be sent. \\
\hline
\mbox{\texttt{ in}}  & {\em direction} & An optional integer indicating which directions the data should be sent. It is T\+O\+\_\+\+A\+LL or the sum of any of T\+O\+\_\+\+E\+A\+ST, T\+O\+\_\+\+W\+E\+ST, T\+O\+\_\+\+N\+O\+R\+TH, and T\+O\+\_\+\+S\+O\+U\+TH, possibly plus S\+C\+A\+L\+A\+R\+\_\+\+P\+A\+IR if these are paired non-\/directional scalars discretized at the typical vector component locations. For example, T\+O\+\_\+\+E\+A\+ST sends the data to the processor to the east, so the halos on the western side are filled. T\+O\+\_\+\+A\+LL is the default if omitted. \\
\hline
\mbox{\texttt{ in}}  & {\em stagger} & An optional flag, which may be one of A\+\_\+\+G\+R\+ID, B\+G\+R\+I\+D\+\_\+\+NE, or C\+G\+R\+I\+D\+\_\+\+NE, indicating where the two components of the vector are discretized. Omitting stagger is the same as setting it to C\+G\+R\+I\+D\+\_\+\+NE. \\
\hline
\mbox{\texttt{ in}}  & {\em complete} & An optional argument indicating whether the halo updates should be completed before progress resumes. Omitting complete is the same as setting complete to .true. \\
\hline
\mbox{\texttt{ in}}  & {\em halo} & The size of the halo to update -\/ the full halo by default. \\
\hline
\mbox{\texttt{ in}}  & {\em clock} & The handle for a cpu time clock that should be started then stopped to time this routine. \\
\hline
\end{DoxyParams}


Definition at line 487 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{487 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:)},  \textcolor{keywordtype}{intent(inout)} :: u\_cmpt\textcolor{comment}{    !< The nominal zonal (u) component of the vector}}
\DoxyCodeLine{488 \textcolor{comment}{                                                    !! pair which is having its halos points}}
\DoxyCodeLine{489 \textcolor{comment}{                                                    !! exchanged.}}
\DoxyCodeLine{490 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:)},  \textcolor{keywordtype}{intent(inout)} :: v\_cmpt\textcolor{comment}{    !< The nominal meridional (v) component of the}}
\DoxyCodeLine{491 \textcolor{comment}{                                                    !! vector pair which is having its halos points}}
\DoxyCodeLine{492 \textcolor{comment}{                                                    !! exchanged.}}
\DoxyCodeLine{493   \textcolor{keywordtype}{type}(MOM\_domain\_type), \textcolor{keywordtype}{intent(inout)} :: MOM\_dom\textcolor{comment}{   !< The MOM\_domain\_type containing the mpp\_domain}}
\DoxyCodeLine{494 \textcolor{comment}{                                                    !! needed to determine where data should be}}
\DoxyCodeLine{495 \textcolor{comment}{                                                    !! sent.}}
\DoxyCodeLine{496   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< An optional integer indicating which}}
\DoxyCodeLine{497 \textcolor{comment}{      !! directions the data should be sent.  It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}}
\DoxyCodeLine{498 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH, possibly plus SCALAR\_PAIR if these are paired non-directional}}
\DoxyCodeLine{499 \textcolor{comment}{      !! scalars discretized at the typical vector component locations.  For example, TO\_EAST sends}}
\DoxyCodeLine{500 \textcolor{comment}{      !! the data to the processor to the east, so the halos on the western side are filled. TO\_ALL}}
\DoxyCodeLine{501 \textcolor{comment}{      !! is the default if omitted.}}
\DoxyCodeLine{502   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: stagger\textcolor{comment}{   !< An optional flag, which may be one of A\_GRID,}}
\DoxyCodeLine{503 \textcolor{comment}{                     !! BGRID\_NE, or CGRID\_NE, indicating where the two components of the vector are}}
\DoxyCodeLine{504 \textcolor{comment}{                     !! discretized. Omitting stagger is the same as setting it to CGRID\_NE.}}
\DoxyCodeLine{505   \textcolor{keywordtype}{logical},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: complete\textcolor{comment}{  !< An optional argument indicating whether the}}
\DoxyCodeLine{506 \textcolor{comment}{                                     !! halo updates should be completed before progress resumes.}}
\DoxyCodeLine{507 \textcolor{comment}{                                     !! Omitting complete is the same as setting complete to .true.}}
\DoxyCodeLine{508   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{      !< The size of the halo to update - the full}}
\DoxyCodeLine{509 \textcolor{comment}{                                                    !! halo by default.}}
\DoxyCodeLine{510   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{     !< The handle for a cpu time clock that should be}}
\DoxyCodeLine{511 \textcolor{comment}{                                                    !! started then stopped to time this routine.}}
\DoxyCodeLine{512 }
\DoxyCodeLine{513   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{514   \textcolor{keywordtype}{integer} :: stagger\_local}
\DoxyCodeLine{515   \textcolor{keywordtype}{integer} :: dirflag}
\DoxyCodeLine{516   \textcolor{keywordtype}{logical} :: block\_til\_complete}
\DoxyCodeLine{517 }
\DoxyCodeLine{518   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_begin(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{519 }
\DoxyCodeLine{520   stagger\_local = cgrid\_ne \textcolor{comment}{! Default value for type of grid}}
\DoxyCodeLine{521   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stagger)) stagger\_local = stagger}
\DoxyCodeLine{522 }
\DoxyCodeLine{523   dirflag = to\_all \textcolor{comment}{! 60}}
\DoxyCodeLine{524   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(direction)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (direction > 0) dirflag = direction ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{525   block\_til\_complete = .true.}
\DoxyCodeLine{526   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(complete)) block\_til\_complete = complete}
\DoxyCodeLine{527 }
\DoxyCodeLine{528   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo) .and. mom\_dom\%thin\_halo\_updates) \textcolor{keywordflow}{then}}
\DoxyCodeLine{529     \textcolor{keyword}{call }mpp\_update\_domains(u\_cmpt, v\_cmpt, mom\_dom\%mpp\_domain, flags=dirflag, \&}
\DoxyCodeLine{530                    gridtype=stagger\_local, complete = block\_til\_complete, \&}
\DoxyCodeLine{531                    whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)}
\DoxyCodeLine{532   \textcolor{keywordflow}{else}}
\DoxyCodeLine{533     \textcolor{keyword}{call }mpp\_update\_domains(u\_cmpt, v\_cmpt, mom\_dom\%mpp\_domain, flags=dirflag, \&}
\DoxyCodeLine{534                    gridtype=stagger\_local, complete = block\_til\_complete)}
\DoxyCodeLine{535 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{536 }
\DoxyCodeLine{537   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_end(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{538 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_ad6af3f884cc89a6239f0fe240bfd3580}\label{namespacemom__domains_ad6af3f884cc89a6239f0fe240bfd3580}} 
\index{mom\_domains@{mom\_domains}!pass\_vector\_3d@{pass\_vector\_3d}}
\index{pass\_vector\_3d@{pass\_vector\_3d}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{pass\_vector\_3d()}{pass\_vector\_3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+domains\+::pass\+\_\+vector\+\_\+3d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:,\+:), intent(inout)}]{u\+\_\+cmpt,  }\item[{real, dimension(\+:,\+:,\+:), intent(inout)}]{v\+\_\+cmpt,  }\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(inout)}]{M\+O\+M\+\_\+dom,  }\item[{integer, intent(in), optional}]{direction,  }\item[{integer, intent(in), optional}]{stagger,  }\item[{logical, intent(in), optional}]{complete,  }\item[{integer, intent(in), optional}]{halo,  }\item[{integer, intent(in), optional}]{clock }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



pass\+\_\+vector\+\_\+3d does a halo update for a pair of three-\/dimensional arrays representing the compontents of a three-\/dimensional horizontal vector. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em u\+\_\+cmpt} & The nominal zonal (u) component of the vector pair which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em v\+\_\+cmpt} & The nominal meridional (v) component of the vector pair which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em mom\+\_\+dom} & The M\+O\+M\+\_\+domain\+\_\+type containing the mpp\+\_\+domain needed to determine where data should be sent. \\
\hline
\mbox{\texttt{ in}}  & {\em direction} & An optional integer indicating which directions the data should be sent. It is T\+O\+\_\+\+A\+LL or the sum of any of T\+O\+\_\+\+E\+A\+ST, T\+O\+\_\+\+W\+E\+ST, T\+O\+\_\+\+N\+O\+R\+TH, and T\+O\+\_\+\+S\+O\+U\+TH, possibly plus S\+C\+A\+L\+A\+R\+\_\+\+P\+A\+IR if these are paired non-\/directional scalars discretized at the typical vector component locations. For example, T\+O\+\_\+\+E\+A\+ST sends the data to the processor to the east, so the halos on the western side are filled. T\+O\+\_\+\+A\+LL is the default if omitted. \\
\hline
\mbox{\texttt{ in}}  & {\em stagger} & An optional flag, which may be one of A\+\_\+\+G\+R\+ID, B\+G\+R\+I\+D\+\_\+\+NE, or C\+G\+R\+I\+D\+\_\+\+NE, indicating where the two components of the vector are discretized. Omitting stagger is the same as setting it to C\+G\+R\+I\+D\+\_\+\+NE. \\
\hline
\mbox{\texttt{ in}}  & {\em complete} & An optional argument indicating whether the halo updates should be completed before progress resumes. Omitting complete is the same as setting complete to .true. \\
\hline
\mbox{\texttt{ in}}  & {\em halo} & The size of the halo to update -\/ the full halo by default. \\
\hline
\mbox{\texttt{ in}}  & {\em clock} & The handle for a cpu time clock that should be started then stopped to time this routine. \\
\hline
\end{DoxyParams}


Definition at line 633 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{633 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: u\_cmpt\textcolor{comment}{   !< The nominal zonal (u) component of the vector}}
\DoxyCodeLine{634 \textcolor{comment}{                                                    !! pair which is having its halos points}}
\DoxyCodeLine{635 \textcolor{comment}{                                                    !! exchanged.}}
\DoxyCodeLine{636 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: v\_cmpt\textcolor{comment}{   !< The nominal meridional (v) component of the}}
\DoxyCodeLine{637 \textcolor{comment}{                                                    !! vector pair which is having its halos points}}
\DoxyCodeLine{638 \textcolor{comment}{                                                    !! exchanged.}}
\DoxyCodeLine{639   \textcolor{keywordtype}{type}(MOM\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: MOM\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}}
\DoxyCodeLine{640 \textcolor{comment}{                                                    !! needed to determine where data should be}}
\DoxyCodeLine{641 \textcolor{comment}{                                                    !! sent.}}
\DoxyCodeLine{642   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< An optional integer indicating which}}
\DoxyCodeLine{643 \textcolor{comment}{      !! directions the data should be sent.  It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}}
\DoxyCodeLine{644 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH, possibly plus SCALAR\_PAIR if these are paired non-directional}}
\DoxyCodeLine{645 \textcolor{comment}{      !! scalars discretized at the typical vector component locations.  For example, TO\_EAST sends}}
\DoxyCodeLine{646 \textcolor{comment}{      !! the data to the processor to the east, so the halos on the western side are filled. TO\_ALL}}
\DoxyCodeLine{647 \textcolor{comment}{      !! is the default if omitted.}}
\DoxyCodeLine{648   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: stagger\textcolor{comment}{  !< An optional flag, which may be one of A\_GRID,}}
\DoxyCodeLine{649 \textcolor{comment}{                     !! BGRID\_NE, or CGRID\_NE, indicating where the two components of the vector are}}
\DoxyCodeLine{650 \textcolor{comment}{                     !! discretized. Omitting stagger is the same as setting it to CGRID\_NE.}}
\DoxyCodeLine{651   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: complete\textcolor{comment}{ !< An optional argument indicating whether the}}
\DoxyCodeLine{652 \textcolor{comment}{                                     !! halo updates should be completed before progress resumes.}}
\DoxyCodeLine{653 \textcolor{comment}{                                     !! Omitting complete is the same as setting complete to .true.}}
\DoxyCodeLine{654   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}}
\DoxyCodeLine{655 \textcolor{comment}{                                                    !! halo by default.}}
\DoxyCodeLine{656   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}}
\DoxyCodeLine{657 \textcolor{comment}{                                                    !! started then stopped to time this routine.}}
\DoxyCodeLine{658 }
\DoxyCodeLine{659   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{660   \textcolor{keywordtype}{integer} :: stagger\_local}
\DoxyCodeLine{661   \textcolor{keywordtype}{integer} :: dirflag}
\DoxyCodeLine{662   \textcolor{keywordtype}{logical} :: block\_til\_complete}
\DoxyCodeLine{663 }
\DoxyCodeLine{664   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_begin(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{665 }
\DoxyCodeLine{666   stagger\_local = cgrid\_ne \textcolor{comment}{! Default value for type of grid}}
\DoxyCodeLine{667   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stagger)) stagger\_local = stagger}
\DoxyCodeLine{668 }
\DoxyCodeLine{669   dirflag = to\_all \textcolor{comment}{! 60}}
\DoxyCodeLine{670   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(direction)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (direction > 0) dirflag = direction ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{671   block\_til\_complete = .true.}
\DoxyCodeLine{672   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(complete)) block\_til\_complete = complete}
\DoxyCodeLine{673 }
\DoxyCodeLine{674   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo) .and. mom\_dom\%thin\_halo\_updates) \textcolor{keywordflow}{then}}
\DoxyCodeLine{675     \textcolor{keyword}{call }mpp\_update\_domains(u\_cmpt, v\_cmpt, mom\_dom\%mpp\_domain, flags=dirflag, \&}
\DoxyCodeLine{676                    gridtype=stagger\_local, complete = block\_til\_complete, \&}
\DoxyCodeLine{677                    whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)}
\DoxyCodeLine{678   \textcolor{keywordflow}{else}}
\DoxyCodeLine{679     \textcolor{keyword}{call }mpp\_update\_domains(u\_cmpt, v\_cmpt, mom\_dom\%mpp\_domain, flags=dirflag, \&}
\DoxyCodeLine{680                    gridtype=stagger\_local, complete = block\_til\_complete)}
\DoxyCodeLine{681 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{682 }
\DoxyCodeLine{683   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_end(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{684 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_a1fe9c30fcc37098454d5bb11c6925116}\label{namespacemom__domains_a1fe9c30fcc37098454d5bb11c6925116}} 
\index{mom\_domains@{mom\_domains}!pass\_vector\_complete\_2d@{pass\_vector\_complete\_2d}}
\index{pass\_vector\_complete\_2d@{pass\_vector\_complete\_2d}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{pass\_vector\_complete\_2d()}{pass\_vector\_complete\_2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+domains\+::pass\+\_\+vector\+\_\+complete\+\_\+2d (\begin{DoxyParamCaption}\item[{integer, intent(in)}]{id\+\_\+update,  }\item[{real, dimension(\+:,\+:), intent(inout)}]{u\+\_\+cmpt,  }\item[{real, dimension(\+:,\+:), intent(inout)}]{v\+\_\+cmpt,  }\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(inout)}]{M\+O\+M\+\_\+dom,  }\item[{integer, intent(in), optional}]{direction,  }\item[{integer, intent(in), optional}]{stagger,  }\item[{integer, intent(in), optional}]{halo,  }\item[{integer, intent(in), optional}]{clock }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



pass\+\_\+vector\+\_\+complete\+\_\+2d completes a halo update for a pair of two-\/dimensional arrays representing the compontents of a two-\/dimensional horizontal vector. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em id\+\_\+update} & The integer id of this update which has been returned from a previous call to \mbox{\hyperlink{interfacemom__domains_1_1pass__var__start}{pass\+\_\+var\+\_\+start}}. \\
\hline
\mbox{\texttt{ in,out}}  & {\em u\+\_\+cmpt} & The nominal zonal (u) component of the vector pair which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em v\+\_\+cmpt} & The nominal meridional (v) component of the vector pair which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em mom\+\_\+dom} & The M\+O\+M\+\_\+domain\+\_\+type containing the mpp\+\_\+domain needed to determine where data should be sent. \\
\hline
\mbox{\texttt{ in}}  & {\em direction} & An optional integer indicating which directions the data should be sent. It is T\+O\+\_\+\+A\+LL or the sum of any of T\+O\+\_\+\+E\+A\+ST, T\+O\+\_\+\+W\+E\+ST, T\+O\+\_\+\+N\+O\+R\+TH, and T\+O\+\_\+\+S\+O\+U\+TH, possibly plus S\+C\+A\+L\+A\+R\+\_\+\+P\+A\+IR if these are paired non-\/directional scalars discretized at the typical vector component locations. For example, T\+O\+\_\+\+E\+A\+ST sends the data to the processor to the east, so the halos on the western side are filled. T\+O\+\_\+\+A\+LL is the default if omitted. \\
\hline
\mbox{\texttt{ in}}  & {\em stagger} & An optional flag, which may be one of A\+\_\+\+G\+R\+ID, B\+G\+R\+I\+D\+\_\+\+NE, or C\+G\+R\+I\+D\+\_\+\+NE, indicating where the two components of the vector are discretized. Omitting stagger is the same as setting it to C\+G\+R\+I\+D\+\_\+\+NE. \\
\hline
\mbox{\texttt{ in}}  & {\em halo} & The size of the halo to update -\/ the full halo by default. \\
\hline
\mbox{\texttt{ in}}  & {\em clock} & The handle for a cpu time clock that should be started then stopped to time this routine. \\
\hline
\end{DoxyParams}


Definition at line 804 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{804   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{intent(in)}    :: id\_update\textcolor{comment}{ !< The integer id of this update which has been}}
\DoxyCodeLine{805 \textcolor{comment}{                                                    !! returned from a previous call to}}
\DoxyCodeLine{806 \textcolor{comment}{                                                    !! pass\_var\_start.}}
\DoxyCodeLine{807 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:)},   \textcolor{keywordtype}{intent(inout)} :: u\_cmpt\textcolor{comment}{   !< The nominal zonal (u) component of the vector}}
\DoxyCodeLine{808 \textcolor{comment}{                                                    !! pair which is having its halos points}}
\DoxyCodeLine{809 \textcolor{comment}{                                                    !! exchanged.}}
\DoxyCodeLine{810 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:)},   \textcolor{keywordtype}{intent(inout)} :: v\_cmpt\textcolor{comment}{   !< The nominal meridional (v) component of the}}
\DoxyCodeLine{811 \textcolor{comment}{                                                    !! vector pair which is having its halos points}}
\DoxyCodeLine{812 \textcolor{comment}{                                                    !! exchanged.}}
\DoxyCodeLine{813   \textcolor{keywordtype}{type}(MOM\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: MOM\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}}
\DoxyCodeLine{814 \textcolor{comment}{                                                    !! needed to determine where data should be}}
\DoxyCodeLine{815 \textcolor{comment}{                                                    !! sent.}}
\DoxyCodeLine{816   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< An optional integer indicating which}}
\DoxyCodeLine{817 \textcolor{comment}{      !! directions the data should be sent.  It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}}
\DoxyCodeLine{818 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH, possibly plus SCALAR\_PAIR if these are paired non-directional}}
\DoxyCodeLine{819 \textcolor{comment}{      !! scalars discretized at the typical vector component locations.  For example, TO\_EAST sends}}
\DoxyCodeLine{820 \textcolor{comment}{      !! the data to the processor to the east, so the halos on the western side are filled. TO\_ALL}}
\DoxyCodeLine{821 \textcolor{comment}{      !! is the default if omitted.}}
\DoxyCodeLine{822   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: stagger\textcolor{comment}{  !< An optional flag, which may be one of A\_GRID,}}
\DoxyCodeLine{823 \textcolor{comment}{                     !! BGRID\_NE, or CGRID\_NE, indicating where the two components of the vector are}}
\DoxyCodeLine{824 \textcolor{comment}{                     !! discretized. Omitting stagger is the same as setting it to CGRID\_NE.}}
\DoxyCodeLine{825   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}}
\DoxyCodeLine{826 \textcolor{comment}{                                                    !! halo by default.}}
\DoxyCodeLine{827   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}}
\DoxyCodeLine{828 \textcolor{comment}{                                                    !! started then stopped to time this routine.}}
\DoxyCodeLine{829   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{830   \textcolor{keywordtype}{integer} :: stagger\_local}
\DoxyCodeLine{831   \textcolor{keywordtype}{integer} :: dirflag}
\DoxyCodeLine{832 }
\DoxyCodeLine{833   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_begin(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{834 }
\DoxyCodeLine{835   stagger\_local = cgrid\_ne \textcolor{comment}{! Default value for type of grid}}
\DoxyCodeLine{836   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stagger)) stagger\_local = stagger}
\DoxyCodeLine{837 }
\DoxyCodeLine{838   dirflag = to\_all \textcolor{comment}{! 60}}
\DoxyCodeLine{839   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(direction)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (direction > 0) dirflag = direction ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{840 }
\DoxyCodeLine{841   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo) .and. mom\_dom\%thin\_halo\_updates) \textcolor{keywordflow}{then}}
\DoxyCodeLine{842     \textcolor{keyword}{call }mpp\_complete\_update\_domains(id\_update, u\_cmpt, v\_cmpt, \&}
\DoxyCodeLine{843              mom\_dom\%mpp\_domain, flags=dirflag, gridtype=stagger\_local, \&}
\DoxyCodeLine{844              whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)}
\DoxyCodeLine{845   \textcolor{keywordflow}{else}}
\DoxyCodeLine{846     \textcolor{keyword}{call }mpp\_complete\_update\_domains(id\_update, u\_cmpt, v\_cmpt, \&}
\DoxyCodeLine{847              mom\_dom\%mpp\_domain, flags=dirflag, gridtype=stagger\_local)}
\DoxyCodeLine{848 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{849 }
\DoxyCodeLine{850   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_end(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{851 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_ae5cd6e7c49fc4f9a631753f25c30683b}\label{namespacemom__domains_ae5cd6e7c49fc4f9a631753f25c30683b}} 
\index{mom\_domains@{mom\_domains}!pass\_vector\_complete\_3d@{pass\_vector\_complete\_3d}}
\index{pass\_vector\_complete\_3d@{pass\_vector\_complete\_3d}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{pass\_vector\_complete\_3d()}{pass\_vector\_complete\_3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+domains\+::pass\+\_\+vector\+\_\+complete\+\_\+3d (\begin{DoxyParamCaption}\item[{integer, intent(in)}]{id\+\_\+update,  }\item[{real, dimension(\+:,\+:,\+:), intent(inout)}]{u\+\_\+cmpt,  }\item[{real, dimension(\+:,\+:,\+:), intent(inout)}]{v\+\_\+cmpt,  }\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(inout)}]{M\+O\+M\+\_\+dom,  }\item[{integer, intent(in), optional}]{direction,  }\item[{integer, intent(in), optional}]{stagger,  }\item[{integer, intent(in), optional}]{halo,  }\item[{integer, intent(in), optional}]{clock }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



pass\+\_\+vector\+\_\+complete\+\_\+3d completes a halo update for a pair of three-\/dimensional arrays representing the compontents of a three-\/dimensional horizontal vector. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em id\+\_\+update} & The integer id of this update which has been returned from a previous call to \mbox{\hyperlink{interfacemom__domains_1_1pass__var__start}{pass\+\_\+var\+\_\+start}}. \\
\hline
\mbox{\texttt{ in,out}}  & {\em u\+\_\+cmpt} & The nominal zonal (u) component of the vector pair which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em v\+\_\+cmpt} & The nominal meridional (v) component of the vector pair which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em mom\+\_\+dom} & The M\+O\+M\+\_\+domain\+\_\+type containing the mpp\+\_\+domain needed to determine where data should be sent. \\
\hline
\mbox{\texttt{ in}}  & {\em direction} & An optional integer indicating which directions the data should be sent. It is T\+O\+\_\+\+A\+LL or the sum of any of T\+O\+\_\+\+E\+A\+ST, T\+O\+\_\+\+W\+E\+ST, T\+O\+\_\+\+N\+O\+R\+TH, and T\+O\+\_\+\+S\+O\+U\+TH, possibly plus S\+C\+A\+L\+A\+R\+\_\+\+P\+A\+IR if these are paired non-\/directional scalars discretized at the typical vector component locations. For example, T\+O\+\_\+\+E\+A\+ST sends the data to the processor to the east, so the halos on the western side are filled. T\+O\+\_\+\+A\+LL is the default if omitted. \\
\hline
\mbox{\texttt{ in}}  & {\em stagger} & An optional flag, which may be one of A\+\_\+\+G\+R\+ID, B\+G\+R\+I\+D\+\_\+\+NE, or C\+G\+R\+I\+D\+\_\+\+NE, indicating where the two components of the vector are discretized. Omitting stagger is the same as setting it to C\+G\+R\+I\+D\+\_\+\+NE. \\
\hline
\mbox{\texttt{ in}}  & {\em halo} & The size of the halo to update -\/ the full halo by default. \\
\hline
\mbox{\texttt{ in}}  & {\em clock} & The handle for a cpu time clock that should be started then stopped to time this routine. \\
\hline
\end{DoxyParams}


Definition at line 858 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{858   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{intent(in)}    :: id\_update\textcolor{comment}{ !< The integer id of this update which has been}}
\DoxyCodeLine{859 \textcolor{comment}{                                                    !! returned from a previous call to}}
\DoxyCodeLine{860 \textcolor{comment}{                                                    !! pass\_var\_start.}}
\DoxyCodeLine{861 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: u\_cmpt\textcolor{comment}{   !< The nominal zonal (u) component of the vector}}
\DoxyCodeLine{862 \textcolor{comment}{                                                    !! pair which is having its halos points}}
\DoxyCodeLine{863 \textcolor{comment}{                                                    !! exchanged.}}
\DoxyCodeLine{864 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: v\_cmpt\textcolor{comment}{   !< The nominal meridional (v) component of the}}
\DoxyCodeLine{865 \textcolor{comment}{                                                    !! vector pair which is having its halos points}}
\DoxyCodeLine{866 \textcolor{comment}{                                                    !! exchanged.}}
\DoxyCodeLine{867   \textcolor{keywordtype}{type}(MOM\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: MOM\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}}
\DoxyCodeLine{868 \textcolor{comment}{                                                    !! needed to determine where data should be}}
\DoxyCodeLine{869 \textcolor{comment}{                                                    !! sent.}}
\DoxyCodeLine{870   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< An optional integer indicating which}}
\DoxyCodeLine{871 \textcolor{comment}{      !! directions the data should be sent.  It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}}
\DoxyCodeLine{872 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH, possibly plus SCALAR\_PAIR if these are paired non-directional}}
\DoxyCodeLine{873 \textcolor{comment}{      !! scalars discretized at the typical vector component locations.  For example, TO\_EAST sends}}
\DoxyCodeLine{874 \textcolor{comment}{      !! the data to the processor to the east, so the halos on the western side are filled. TO\_ALL}}
\DoxyCodeLine{875 \textcolor{comment}{      !! is the default if omitted.}}
\DoxyCodeLine{876   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: stagger\textcolor{comment}{  !< An optional flag, which may be one of A\_GRID,}}
\DoxyCodeLine{877 \textcolor{comment}{                     !! BGRID\_NE, or CGRID\_NE, indicating where the two components of the vector are}}
\DoxyCodeLine{878 \textcolor{comment}{                     !! discretized. Omitting stagger is the same as setting it to CGRID\_NE.}}
\DoxyCodeLine{879   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}}
\DoxyCodeLine{880 \textcolor{comment}{                                                    !! halo by default.}}
\DoxyCodeLine{881   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}}
\DoxyCodeLine{882 \textcolor{comment}{                                                    !! started then stopped to time this routine.}}
\DoxyCodeLine{883   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{884   \textcolor{keywordtype}{integer} :: stagger\_local}
\DoxyCodeLine{885   \textcolor{keywordtype}{integer} :: dirflag}
\DoxyCodeLine{886 }
\DoxyCodeLine{887   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_begin(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{888 }
\DoxyCodeLine{889   stagger\_local = cgrid\_ne \textcolor{comment}{! Default value for type of grid}}
\DoxyCodeLine{890   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stagger)) stagger\_local = stagger}
\DoxyCodeLine{891 }
\DoxyCodeLine{892   dirflag = to\_all \textcolor{comment}{! 60}}
\DoxyCodeLine{893   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(direction)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (direction > 0) dirflag = direction ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{894 }
\DoxyCodeLine{895   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo) .and. mom\_dom\%thin\_halo\_updates) \textcolor{keywordflow}{then}}
\DoxyCodeLine{896     \textcolor{keyword}{call }mpp\_complete\_update\_domains(id\_update, u\_cmpt, v\_cmpt, \&}
\DoxyCodeLine{897              mom\_dom\%mpp\_domain, flags=dirflag, gridtype=stagger\_local, \&}
\DoxyCodeLine{898                    whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)}
\DoxyCodeLine{899   \textcolor{keywordflow}{else}}
\DoxyCodeLine{900     \textcolor{keyword}{call }mpp\_complete\_update\_domains(id\_update, u\_cmpt, v\_cmpt, \&}
\DoxyCodeLine{901              mom\_dom\%mpp\_domain, flags=dirflag, gridtype=stagger\_local)}
\DoxyCodeLine{902 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{903 }
\DoxyCodeLine{904   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_end(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{905 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_a30e9d0831d2c44339c2891e9250ca683}\label{namespacemom__domains_a30e9d0831d2c44339c2891e9250ca683}} 
\index{mom\_domains@{mom\_domains}!pass\_vector\_start\_2d@{pass\_vector\_start\_2d}}
\index{pass\_vector\_start\_2d@{pass\_vector\_start\_2d}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{pass\_vector\_start\_2d()}{pass\_vector\_start\_2d()}}
{\footnotesize\ttfamily integer function mom\+\_\+domains\+::pass\+\_\+vector\+\_\+start\+\_\+2d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:), intent(inout)}]{u\+\_\+cmpt,  }\item[{real, dimension(\+:,\+:), intent(inout)}]{v\+\_\+cmpt,  }\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(inout)}]{M\+O\+M\+\_\+dom,  }\item[{integer, intent(in), optional}]{direction,  }\item[{integer, intent(in), optional}]{stagger,  }\item[{logical, intent(in), optional}]{complete,  }\item[{integer, intent(in), optional}]{halo,  }\item[{integer, intent(in), optional}]{clock }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



pass\+\_\+vector\+\_\+start\+\_\+2d starts a halo update for a pair of two-\/dimensional arrays representing the compontents of a two-\/dimensional horizontal vector. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em u\+\_\+cmpt} & The nominal zonal (u) component of the vector pair which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em v\+\_\+cmpt} & The nominal meridional (v) component of the vector pair which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em mom\+\_\+dom} & The M\+O\+M\+\_\+domain\+\_\+type containing the mpp\+\_\+domain needed to determine where data should be sent. \\
\hline
\mbox{\texttt{ in}}  & {\em direction} & An optional integer indicating which directions the data should be sent. It is T\+O\+\_\+\+A\+LL or the sum of any of T\+O\+\_\+\+E\+A\+ST, T\+O\+\_\+\+W\+E\+ST, T\+O\+\_\+\+N\+O\+R\+TH, and T\+O\+\_\+\+S\+O\+U\+TH, possibly plus S\+C\+A\+L\+A\+R\+\_\+\+P\+A\+IR if these are paired non-\/directional scalars discretized at the typical vector component locations. For example, T\+O\+\_\+\+E\+A\+ST sends the data to the processor to the east, so the halos on the western side are filled. T\+O\+\_\+\+A\+LL is the default if omitted. \\
\hline
\mbox{\texttt{ in}}  & {\em stagger} & An optional flag, which may be one of A\+\_\+\+G\+R\+ID, B\+G\+R\+I\+D\+\_\+\+NE, or C\+G\+R\+I\+D\+\_\+\+NE, indicating where the two components of the vector are discretized. Omitting stagger is the same as setting it to C\+G\+R\+I\+D\+\_\+\+NE. \\
\hline
\mbox{\texttt{ in}}  & {\em complete} & An optional argument indicating whether the halo updates should be completed before progress resumes. Omitting complete is the same as setting complete to .true. \\
\hline
\mbox{\texttt{ in}}  & {\em halo} & The size of the halo to update -\/ the full halo by default. \\
\hline
\mbox{\texttt{ in}}  & {\em clock} & The handle for a cpu time clock that should be started then stopped to time this routine. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The integer index for this update. 
\end{DoxyReturn}


Definition at line 691 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{691 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:)},   \textcolor{keywordtype}{intent(inout)} :: u\_cmpt\textcolor{comment}{   !< The nominal zonal (u) component of the vector}}
\DoxyCodeLine{692 \textcolor{comment}{                                                    !! pair which is having its halos points}}
\DoxyCodeLine{693 \textcolor{comment}{                                                    !! exchanged.}}
\DoxyCodeLine{694 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:)},   \textcolor{keywordtype}{intent(inout)} :: v\_cmpt\textcolor{comment}{   !< The nominal meridional (v) component of the}}
\DoxyCodeLine{695 \textcolor{comment}{                                                    !! vector pair which is having its halos points}}
\DoxyCodeLine{696 \textcolor{comment}{                                                    !! exchanged.}}
\DoxyCodeLine{697   \textcolor{keywordtype}{type}(MOM\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: MOM\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}}
\DoxyCodeLine{698 \textcolor{comment}{                                                    !! needed to determine where data should be}}
\DoxyCodeLine{699 \textcolor{comment}{                                                    !! sent.}}
\DoxyCodeLine{700   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< An optional integer indicating which}}
\DoxyCodeLine{701 \textcolor{comment}{      !! directions the data should be sent.  It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}}
\DoxyCodeLine{702 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH, possibly plus SCALAR\_PAIR if these are paired non-directional}}
\DoxyCodeLine{703 \textcolor{comment}{      !! scalars discretized at the typical vector component locations.  For example, TO\_EAST sends}}
\DoxyCodeLine{704 \textcolor{comment}{      !! the data to the processor to the east, so the halos on the western side are filled. TO\_ALL}}
\DoxyCodeLine{705 \textcolor{comment}{      !! is the default if omitted.}}
\DoxyCodeLine{706   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: stagger\textcolor{comment}{  !< An optional flag, which may be one of A\_GRID,}}
\DoxyCodeLine{707 \textcolor{comment}{                     !! BGRID\_NE, or CGRID\_NE, indicating where the two components of the vector are}}
\DoxyCodeLine{708 \textcolor{comment}{                     !! discretized. Omitting stagger is the same as setting it to CGRID\_NE.}}
\DoxyCodeLine{709   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: complete\textcolor{comment}{ !< An optional argument indicating whether the}}
\DoxyCodeLine{710 \textcolor{comment}{                                     !! halo updates should be completed before progress resumes.}}
\DoxyCodeLine{711 \textcolor{comment}{                                     !! Omitting complete is the same as setting complete to .true.}}
\DoxyCodeLine{712   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}}
\DoxyCodeLine{713 \textcolor{comment}{                                                    !! halo by default.}}
\DoxyCodeLine{714   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}}
\DoxyCodeLine{715 \textcolor{comment}{                                                    !! started then stopped to time this routine.}}
\DoxyCodeLine{716   \textcolor{keywordtype}{integer}                               :: pass\_vector\_start\_2d\textcolor{comment}{ !< The integer index for this}}
\DoxyCodeLine{717 \textcolor{comment}{                                                                !! update.}}
\DoxyCodeLine{718 }
\DoxyCodeLine{719   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{720   \textcolor{keywordtype}{integer} :: stagger\_local}
\DoxyCodeLine{721   \textcolor{keywordtype}{integer} :: dirflag}
\DoxyCodeLine{722 }
\DoxyCodeLine{723   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_begin(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{724 }
\DoxyCodeLine{725   stagger\_local = cgrid\_ne \textcolor{comment}{! Default value for type of grid}}
\DoxyCodeLine{726   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stagger)) stagger\_local = stagger}
\DoxyCodeLine{727 }
\DoxyCodeLine{728   dirflag = to\_all \textcolor{comment}{! 60}}
\DoxyCodeLine{729   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(direction)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (direction > 0) dirflag = direction ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{730 }
\DoxyCodeLine{731   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo) .and. mom\_dom\%thin\_halo\_updates) \textcolor{keywordflow}{then}}
\DoxyCodeLine{732     pass\_vector\_start\_2d = mpp\_start\_update\_domains(u\_cmpt, v\_cmpt, \&}
\DoxyCodeLine{733         mom\_dom\%mpp\_domain, flags=dirflag, gridtype=stagger\_local, \&}
\DoxyCodeLine{734         whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)}
\DoxyCodeLine{735   \textcolor{keywordflow}{else}}
\DoxyCodeLine{736     pass\_vector\_start\_2d = mpp\_start\_update\_domains(u\_cmpt, v\_cmpt, \&}
\DoxyCodeLine{737         mom\_dom\%mpp\_domain, flags=dirflag, gridtype=stagger\_local)}
\DoxyCodeLine{738 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{739 }
\DoxyCodeLine{740   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_end(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{741 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_a873cbcdb86ae700c1d1aaf340b28d8f8}\label{namespacemom__domains_a873cbcdb86ae700c1d1aaf340b28d8f8}} 
\index{mom\_domains@{mom\_domains}!pass\_vector\_start\_3d@{pass\_vector\_start\_3d}}
\index{pass\_vector\_start\_3d@{pass\_vector\_start\_3d}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{pass\_vector\_start\_3d()}{pass\_vector\_start\_3d()}}
{\footnotesize\ttfamily integer function mom\+\_\+domains\+::pass\+\_\+vector\+\_\+start\+\_\+3d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:,\+:), intent(inout)}]{u\+\_\+cmpt,  }\item[{real, dimension(\+:,\+:,\+:), intent(inout)}]{v\+\_\+cmpt,  }\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(inout)}]{M\+O\+M\+\_\+dom,  }\item[{integer, intent(in), optional}]{direction,  }\item[{integer, intent(in), optional}]{stagger,  }\item[{logical, intent(in), optional}]{complete,  }\item[{integer, intent(in), optional}]{halo,  }\item[{integer, intent(in), optional}]{clock }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



pass\+\_\+vector\+\_\+start\+\_\+3d starts a halo update for a pair of three-\/dimensional arrays representing the compontents of a three-\/dimensional horizontal vector. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em u\+\_\+cmpt} & The nominal zonal (u) component of the vector pair which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em v\+\_\+cmpt} & The nominal meridional (v) component of the vector pair which is having its halos points exchanged. \\
\hline
\mbox{\texttt{ in,out}}  & {\em mom\+\_\+dom} & The M\+O\+M\+\_\+domain\+\_\+type containing the mpp\+\_\+domain needed to determine where data should be sent. \\
\hline
\mbox{\texttt{ in}}  & {\em direction} & An optional integer indicating which directions the data should be sent. It is T\+O\+\_\+\+A\+LL or the sum of any of T\+O\+\_\+\+E\+A\+ST, T\+O\+\_\+\+W\+E\+ST, T\+O\+\_\+\+N\+O\+R\+TH, and T\+O\+\_\+\+S\+O\+U\+TH, possibly plus S\+C\+A\+L\+A\+R\+\_\+\+P\+A\+IR if these are paired non-\/directional scalars discretized at the typical vector component locations. For example, T\+O\+\_\+\+E\+A\+ST sends the data to the processor to the east, so the halos on the western side are filled. T\+O\+\_\+\+A\+LL is the default if omitted. \\
\hline
\mbox{\texttt{ in}}  & {\em stagger} & An optional flag, which may be one of A\+\_\+\+G\+R\+ID, B\+G\+R\+I\+D\+\_\+\+NE, or C\+G\+R\+I\+D\+\_\+\+NE, indicating where the two components of the vector are discretized. Omitting stagger is the same as setting it to C\+G\+R\+I\+D\+\_\+\+NE. \\
\hline
\mbox{\texttt{ in}}  & {\em complete} & An optional argument indicating whether the halo updates should be completed before progress resumes. Omitting complete is the same as setting complete to .true. \\
\hline
\mbox{\texttt{ in}}  & {\em halo} & The size of the halo to update -\/ the full halo by default. \\
\hline
\mbox{\texttt{ in}}  & {\em clock} & The handle for a cpu time clock that should be started then stopped to time this routine. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The integer index for this update. 
\end{DoxyReturn}


Definition at line 748 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{748 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: u\_cmpt\textcolor{comment}{   !< The nominal zonal (u) component of the vector}}
\DoxyCodeLine{749 \textcolor{comment}{                                                    !! pair which is having its halos points}}
\DoxyCodeLine{750 \textcolor{comment}{                                                    !! exchanged.}}
\DoxyCodeLine{751 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: v\_cmpt\textcolor{comment}{   !< The nominal meridional (v) component of the}}
\DoxyCodeLine{752 \textcolor{comment}{                                                    !! vector pair which is having its halos points}}
\DoxyCodeLine{753 \textcolor{comment}{                                                    !! exchanged.}}
\DoxyCodeLine{754   \textcolor{keywordtype}{type}(MOM\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: MOM\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}}
\DoxyCodeLine{755 \textcolor{comment}{                                                    !! needed to determine where data should be}}
\DoxyCodeLine{756 \textcolor{comment}{                                                    !! sent.}}
\DoxyCodeLine{757   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< An optional integer indicating which}}
\DoxyCodeLine{758 \textcolor{comment}{      !! directions the data should be sent.  It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}}
\DoxyCodeLine{759 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH, possibly plus SCALAR\_PAIR if these are paired non-directional}}
\DoxyCodeLine{760 \textcolor{comment}{      !! scalars discretized at the typical vector component locations.  For example, TO\_EAST sends}}
\DoxyCodeLine{761 \textcolor{comment}{      !! the data to the processor to the east, so the halos on the western side are filled. TO\_ALL}}
\DoxyCodeLine{762 \textcolor{comment}{      !! is the default if omitted.}}
\DoxyCodeLine{763   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: stagger\textcolor{comment}{  !< An optional flag, which may be one of A\_GRID,}}
\DoxyCodeLine{764 \textcolor{comment}{                     !! BGRID\_NE, or CGRID\_NE, indicating where the two components of the vector are}}
\DoxyCodeLine{765 \textcolor{comment}{                     !! discretized. Omitting stagger is the same as setting it to CGRID\_NE.}}
\DoxyCodeLine{766   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: complete\textcolor{comment}{ !< An optional argument indicating whether the}}
\DoxyCodeLine{767 \textcolor{comment}{                                     !! halo updates should be completed before progress resumes.}}
\DoxyCodeLine{768 \textcolor{comment}{                                     !! Omitting complete is the same as setting complete to .true.}}
\DoxyCodeLine{769   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}}
\DoxyCodeLine{770 \textcolor{comment}{                                                    !! halo by default.}}
\DoxyCodeLine{771   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}}
\DoxyCodeLine{772 \textcolor{comment}{                                                    !! started then stopped to time this routine.}}
\DoxyCodeLine{773   \textcolor{keywordtype}{integer}                               :: pass\_vector\_start\_3d\textcolor{comment}{ !< The integer index for this}}
\DoxyCodeLine{774 \textcolor{comment}{                                                                !! update.}}
\DoxyCodeLine{775   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{776   \textcolor{keywordtype}{integer} :: stagger\_local}
\DoxyCodeLine{777   \textcolor{keywordtype}{integer} :: dirflag}
\DoxyCodeLine{778 }
\DoxyCodeLine{779   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_begin(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{780 }
\DoxyCodeLine{781   stagger\_local = cgrid\_ne \textcolor{comment}{! Default value for type of grid}}
\DoxyCodeLine{782   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stagger)) stagger\_local = stagger}
\DoxyCodeLine{783 }
\DoxyCodeLine{784   dirflag = to\_all \textcolor{comment}{! 60}}
\DoxyCodeLine{785   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(direction)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (direction > 0) dirflag = direction ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{786 }
\DoxyCodeLine{787   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo) .and. mom\_dom\%thin\_halo\_updates) \textcolor{keywordflow}{then}}
\DoxyCodeLine{788     pass\_vector\_start\_3d = mpp\_start\_update\_domains(u\_cmpt, v\_cmpt, \&}
\DoxyCodeLine{789         mom\_dom\%mpp\_domain, flags=dirflag, gridtype=stagger\_local, \&}
\DoxyCodeLine{790         whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)}
\DoxyCodeLine{791   \textcolor{keywordflow}{else}}
\DoxyCodeLine{792     pass\_vector\_start\_3d = mpp\_start\_update\_domains(u\_cmpt, v\_cmpt, \&}
\DoxyCodeLine{793         mom\_dom\%mpp\_domain, flags=dirflag, gridtype=stagger\_local)}
\DoxyCodeLine{794 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{795 }
\DoxyCodeLine{796   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_end(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{797 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__domains_ab27e1cc5953c88e733e0f9f55e4fd446}\label{namespacemom__domains_ab27e1cc5953c88e733e0f9f55e4fd446}} 
\index{mom\_domains@{mom\_domains}!start\_group\_pass@{start\_group\_pass}}
\index{start\_group\_pass@{start\_group\_pass}!mom\_domains@{mom\_domains}}
\subsubsection{\texorpdfstring{start\_group\_pass()}{start\_group\_pass()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+domains\+::start\+\_\+group\+\_\+pass (\begin{DoxyParamCaption}\item[{type(group\+\_\+pass\+\_\+type), intent(inout)}]{group,  }\item[{type(\mbox{\hyperlink{structmom__domains_1_1mom__domain__type}{mom\+\_\+domain\+\_\+type}}), intent(inout)}]{M\+O\+M\+\_\+dom,  }\item[{integer, intent(in), optional}]{clock }\end{DoxyParamCaption})}



start\+\_\+group\+\_\+pass starts out a group halo update. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em group} & The data type that store information for group update. This data will be used in do\+\_\+group\+\_\+pass. \\
\hline
\mbox{\texttt{ in,out}}  & {\em mom\+\_\+dom} & The M\+O\+M\+\_\+domain\+\_\+type containing the mpp\+\_\+domain needed to determine where data should be sent. \\
\hline
\mbox{\texttt{ in}}  & {\em clock} & The handle for a cpu time clock that should be started then stopped to time this routine. \\
\hline
\end{DoxyParams}


Definition at line 1133 of file M\+O\+M\+\_\+domains.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1133   \textcolor{keywordtype}{type}(group\_pass\_type), \textcolor{keywordtype}{intent(inout)} :: group\textcolor{comment}{    !< The data type that store information for}}
\DoxyCodeLine{1134 \textcolor{comment}{                                                   !! group update. This data will be used in}}
\DoxyCodeLine{1135 \textcolor{comment}{                                                   !! do\_group\_pass.}}
\DoxyCodeLine{1136   \textcolor{keywordtype}{type}(MOM\_domain\_type), \textcolor{keywordtype}{intent(inout)} :: MOM\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}}
\DoxyCodeLine{1137 \textcolor{comment}{                                                   !! needed to determine where data should be}}
\DoxyCodeLine{1138 \textcolor{comment}{                                                   !! sent.}}
\DoxyCodeLine{1139   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}}
\DoxyCodeLine{1140 \textcolor{comment}{                                                   !! started then stopped to time this routine.}}
\DoxyCodeLine{1141 }
\DoxyCodeLine{1142 \textcolor{keywordtype}{  real}                                 :: d\_type}
\DoxyCodeLine{1143 }
\DoxyCodeLine{1144   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_begin(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1145 }
\DoxyCodeLine{1146   \textcolor{keyword}{call }mpp\_start\_group\_update(group, mom\_dom\%mpp\_domain, d\_type)}
\DoxyCodeLine{1147 }
\DoxyCodeLine{1148   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clock)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (clock>0) \textcolor{keyword}{call }cpu\_clock\_end(clock) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1149 }

\end{DoxyCode}
