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


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


\begin{DoxyCode}
1607   \textcolor{keywordtype}{type}(mom\_domain\_type), \textcolor{keywordtype}{intent(in)}    :: md\_in\textcolor{comment}{  !< An existing MOM\_domain}
1608   \textcolor{keywordtype}{type}(mom\_domain\_type), \textcolor{keywordtype}{pointer}       :: mom\_dom\textcolor{comment}{ !< A pointer to a MOM\_domain that will be}
1609 \textcolor{comment}{                                  !! allocated if it is unassociated, and will have data}
1610 \textcolor{comment}{                                  !! copied from MD\_in}
1611   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{dimension(2)}, &
1612                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(inout)} :: min\_halo\textcolor{comment}{ !< If present, this sets the}
1613 \textcolor{comment}{                                  !! minimum halo size for this domain in the i- and j-}
1614 \textcolor{comment}{                                  !! directions, and returns the actual halo size used.}
1615   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\_size\textcolor{comment}{ !< If present, this sets the halo}
1616 \textcolor{comment}{                                  !! size for the domain in the i- and j-directions.}
1617 \textcolor{comment}{                                  !! min\_halo and halo\_size can not both be present.}
1618   \textcolor{keywordtype}{logical},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: symmetric\textcolor{comment}{ !< If present, this specifies}
1619 \textcolor{comment}{                                  !! whether the new domain is symmetric, regardless of}
1620 \textcolor{comment}{                                  !! whether the macro SYMMETRIC\_MEMORY\_ is defined.}
1621   \textcolor{keywordtype}{character(len=*)}, &
1622                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: domain\_name\textcolor{comment}{ !< A name for the new domain, "MOM"}
1623 \textcolor{comment}{                                  !! if missing.}
1624   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{   !< Number of quarter turns}
1625 
1626   \textcolor{keywordtype}{integer} :: global\_indices(4)
1627   \textcolor{keywordtype}{logical} :: mask\_table\_exists
1628   \textcolor{keywordtype}{character(len=64)} :: dom\_name
1629   \textcolor{keywordtype}{integer} :: qturns
1630 
1631   qturns = 0
1632   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(turns)) qturns = turns
1633 
1634   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(mom\_dom)) \textcolor{keywordflow}{then}
1635     \textcolor{keyword}{allocate}(mom\_dom)
1636     \textcolor{keyword}{allocate}(mom\_dom%mpp\_domain)
1637     \textcolor{keyword}{allocate}(mom\_dom%mpp\_domain\_d2)
1638 \textcolor{keywordflow}{  endif}
1639 
1640 \textcolor{comment}{! Save the extra data for creating other domains of different resolution that overlay this domain}
1641   mom\_dom%symmetric = md\_in%symmetric
1642   mom\_dom%nonblocking\_updates = md\_in%nonblocking\_updates
1643   mom\_dom%thin\_halo\_updates = md\_in%thin\_halo\_updates
1644 
1645   \textcolor{keywordflow}{if} (modulo(qturns, 2) /= 0) \textcolor{keywordflow}{then}
1646     mom\_dom%niglobal = md\_in%njglobal ; mom\_dom%njglobal = md\_in%niglobal
1647     mom\_dom%nihalo = md\_in%njhalo ; mom\_dom%njhalo = md\_in%nihalo
1648 
1649     mom\_dom%X\_FLAGS = md\_in%Y\_FLAGS ; mom\_dom%Y\_FLAGS = md\_in%X\_FLAGS
1650     mom\_dom%layout(:) = md\_in%layout(2:1:-1)
1651     mom\_dom%io\_layout(:) = md\_in%io\_layout(2:1:-1)
1652   \textcolor{keywordflow}{else}
1653     mom\_dom%niglobal = md\_in%niglobal ; mom\_dom%njglobal = md\_in%njglobal
1654     mom\_dom%nihalo = md\_in%nihalo ; mom\_dom%njhalo = md\_in%njhalo
1655 
1656     mom\_dom%X\_FLAGS = md\_in%X\_FLAGS ; mom\_dom%Y\_FLAGS = md\_in%Y\_FLAGS
1657     mom\_dom%layout(:) = md\_in%layout(:)
1658     mom\_dom%io\_layout(:) = md\_in%io\_layout(:)
1659 \textcolor{keywordflow}{  endif}
1660 
1661   global\_indices(1) = 1 ; global\_indices(2) = mom\_dom%niglobal
1662   global\_indices(3) = 1 ; global\_indices(4) = mom\_dom%njglobal
1663 
1664   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(md\_in%maskmap)) \textcolor{keywordflow}{then}
1665     mask\_table\_exists = .true.
1666     \textcolor{keyword}{allocate}(mom\_dom%maskmap(mom\_dom%layout(1), mom\_dom%layout(2)))
1667     \textcolor{keywordflow}{if} (qturns /= 0) \textcolor{keywordflow}{then}
1668       \textcolor{keyword}{call }rotate\_array(md\_in%maskmap(:,:), qturns, mom\_dom%maskmap(:,:))
1669     \textcolor{keywordflow}{else}
1670       mom\_dom%maskmap(:,:) = md\_in%maskmap(:,:)
1671 \textcolor{keywordflow}{    endif}
1672   \textcolor{keywordflow}{else}
1673     mask\_table\_exists = .false.
1674 \textcolor{keywordflow}{  endif}
1675 
1676   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo\_size) .and. \textcolor{keyword}{present}(min\_halo)) \textcolor{keyword}{call }mom\_error(fatal, &
1677       \textcolor{stringliteral}{"clone\_MOM\_domain can not have both halo\_size and min\_halo present."})
1678 
1679   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(min\_halo)) \textcolor{keywordflow}{then}
1680     mom\_dom%nihalo = max(mom\_dom%nihalo, min\_halo(1))
1681     min\_halo(1) = mom\_dom%nihalo
1682     mom\_dom%njhalo = max(mom\_dom%njhalo, min\_halo(2))
1683     min\_halo(2) = mom\_dom%njhalo
1684 \textcolor{keywordflow}{  endif}
1685 
1686   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo\_size)) \textcolor{keywordflow}{then}
1687     mom\_dom%nihalo = halo\_size ; mom\_dom%njhalo = halo\_size
1688 \textcolor{keywordflow}{  endif}
1689 
1690   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(symmetric)) \textcolor{keywordflow}{then} ; mom\_dom%symmetric = symmetric ;\textcolor{keywordflow}{ endif}
1691 
1692   dom\_name = \textcolor{stringliteral}{"MOM"}
1693   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(domain\_name)) dom\_name = trim(domain\_name)
1694 
1695   \textcolor{keywordflow}{if} (mask\_table\_exists) \textcolor{keywordflow}{then}
1696     \textcolor{keyword}{call }mom\_define\_domain(global\_indices, mom\_dom%layout, mom\_dom%mpp\_domain, &
1697                 xflags=mom\_dom%X\_FLAGS, yflags=mom\_dom%Y\_FLAGS, &
1698                 xhalo=mom\_dom%nihalo, yhalo=mom\_dom%njhalo, &
1699                 symmetry=mom\_dom%symmetric, name=dom\_name, &
1700                 maskmap=mom\_dom%maskmap)
1701 
1702     global\_indices(2) = global\_indices(2) / 2
1703     global\_indices(4) = global\_indices(4) / 2
1704     \textcolor{keyword}{call }mom\_define\_domain(global\_indices, mom\_dom%layout, &
1705                 mom\_dom%mpp\_domain\_d2, &
1706                 xflags=mom\_dom%X\_FLAGS, yflags=mom\_dom%Y\_FLAGS, &
1707                 xhalo=(mom\_dom%nihalo/2), yhalo=(mom\_dom%njhalo/2), &
1708                 symmetry=mom\_dom%symmetric, name=dom\_name, &
1709                 maskmap=mom\_dom%maskmap)
1710   \textcolor{keywordflow}{else}
1711     \textcolor{keyword}{call }mom\_define\_domain(global\_indices, mom\_dom%layout, mom\_dom%mpp\_domain, &
1712                 xflags=mom\_dom%X\_FLAGS, yflags=mom\_dom%Y\_FLAGS, &
1713                 xhalo=mom\_dom%nihalo, yhalo=mom\_dom%njhalo, &
1714                 symmetry=mom\_dom%symmetric, name=dom\_name)
1715 
1716     global\_indices(2) = global\_indices(2) / 2
1717     global\_indices(4) = global\_indices(4) / 2
1718     \textcolor{keyword}{call }mom\_define\_domain(global\_indices, mom\_dom%layout, &
1719                 mom\_dom%mpp\_domain\_d2, &
1720                 xflags=mom\_dom%X\_FLAGS, yflags=mom\_dom%Y\_FLAGS, &
1721                 xhalo=(mom\_dom%nihalo/2), yhalo=(mom\_dom%njhalo/2), &
1722                 symmetry=mom\_dom%symmetric, name=dom\_name)
1723 \textcolor{keywordflow}{  endif}
1724 
1725   \textcolor{keywordflow}{if} ((mom\_dom%io\_layout(1) + mom\_dom%io\_layout(2) > 0) .and. &
1726       (mom\_dom%layout(1)*mom\_dom%layout(2) > 1)) \textcolor{keywordflow}{then}
1727     \textcolor{keyword}{call }mom\_define\_io\_domain(mom\_dom%mpp\_domain, mom\_dom%io\_layout)
1728 \textcolor{keywordflow}{  endif}
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(\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{\tt in,out}  & {\em group} & The data type that store information for group update. This data will be used in do\+\_\+group\+\_\+pass.\\
\hline
\mbox{\tt 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{\tt 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}
1154   \textcolor{keywordtype}{type}(group\_pass\_type), \textcolor{keywordtype}{intent(inout)} :: group\textcolor{comment}{    !< The data type that store information for}
1155 \textcolor{comment}{                                                   !! group update. This data will be used in}
1156 \textcolor{comment}{                                                   !! do\_group\_pass.}
1157   \textcolor{keywordtype}{type}(mom\_domain\_type), \textcolor{keywordtype}{intent(inout)} :: mom\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}
1158 \textcolor{comment}{                                                   !! needed to determine where data should be}
1159 \textcolor{comment}{                                                   !! sent.}
1160   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}
1161 \textcolor{comment}{                                                   !! started then stopped to time this routine.}
1162   \textcolor{keywordtype}{real}                                 :: d\_type
1163 
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}
1165 
1166   \textcolor{keyword}{call }mpp\_complete\_group\_update(group, mom\_dom%mpp\_domain, d\_type)
1167 
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}
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(\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{\tt in,out}  & {\em group} & The data type that store information for group update. This data will be used in do\+\_\+group\+\_\+pass.\\
\hline
\mbox{\tt in,out}  & {\em array} & The array which is having its halos points exchanged.\\
\hline
\mbox{\tt 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{\tt 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{\tt 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{\tt in}  & {\em halo} & The size of the halo to update -\/ the full halo by default.\\
\hline
\mbox{\tt 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}
911   \textcolor{keywordtype}{type}(group\_pass\_type),  \textcolor{keywordtype}{intent(inout)} :: group\textcolor{comment}{    !< The data type that store information for}
912 \textcolor{comment}{                                                    !! group update. This data will be used in}
913 \textcolor{comment}{                                                    !! do\_group\_pass.}
914   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:)},   \textcolor{keywordtype}{intent(inout)} :: array\textcolor{comment}{    !< The array which is having its halos points}
915 \textcolor{comment}{                                                    !! exchanged.}
916   \textcolor{keywordtype}{type}(mom\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: mom\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}
917 \textcolor{comment}{                                                    !! needed to determine where data should be}
918 \textcolor{comment}{                                                    !! sent.}
919   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: sideflag\textcolor{comment}{ !< An optional integer indicating which}
920 \textcolor{comment}{      !! directions the data should be sent. It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}
921 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH.  For example, TO\_EAST sends the data to the processor to the east,}
922 \textcolor{comment}{      !! so the halos on the western side are filled.  TO\_ALL is the default if sideflag is omitted.}
923   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: position\textcolor{comment}{ !< An optional argument indicating the position.}
924 \textcolor{comment}{                                                    !! This is CENTER by default and is often CORNER,}
925 \textcolor{comment}{                                                    !! but could also be EAST\_FACE or NORTH\_FACE.}
926   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}
927 \textcolor{comment}{                                                    !! halo by default.}
928   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}
929 \textcolor{comment}{                                                    !! started then stopped to time this routine.}
930   \textcolor{comment}{! Local variables}
931   \textcolor{keywordtype}{integer} :: dirflag
932 
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}
934 
935   dirflag = to\_all \textcolor{comment}{! 60}
936   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(sideflag)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (sideflag > 0) dirflag = sideflag ;\textcolor{keywordflow}{ endif}
937 
938   \textcolor{keywordflow}{if} (mpp\_group\_update\_initialized(group)) \textcolor{keywordflow}{then}
939     \textcolor{keyword}{call }mpp\_reset\_group\_update\_field(group,array)
940   \textcolor{keywordflow}{elseif} (\textcolor{keyword}{present}(halo) .and. mom\_dom%thin\_halo\_updates) \textcolor{keywordflow}{then}
941     \textcolor{keyword}{call }mpp\_create\_group\_update(group, array, mom\_dom%mpp\_domain, flags=dirflag, &
942                                  position=position, whalo=halo, ehalo=halo, &
943                                  shalo=halo, nhalo=halo)
944   \textcolor{keywordflow}{else}
945     \textcolor{keyword}{call }mpp\_create\_group\_update(group, array, mom\_dom%mpp\_domain, flags=dirflag, &
946                                  position=position)
947 \textcolor{keywordflow}{  endif}
948 
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}
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(\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{\tt in,out}  & {\em group} & The data type that store information for group update. This data will be used in do\+\_\+group\+\_\+pass.\\
\hline
\mbox{\tt in,out}  & {\em array} & The array which is having its halos points exchanged.\\
\hline
\mbox{\tt 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{\tt 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{\tt 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{\tt in}  & {\em halo} & The size of the halo to update -\/ the full halo by default.\\
\hline
\mbox{\tt 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}
956   \textcolor{keywordtype}{type}(group\_pass\_type),  \textcolor{keywordtype}{intent(inout)} :: group\textcolor{comment}{    !< The data type that store information for}
957 \textcolor{comment}{                                                    !! group update. This data will be used in}
958 \textcolor{comment}{                                                    !! do\_group\_pass.}
959   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: array\textcolor{comment}{    !< The array which is having its halos points}
960 \textcolor{comment}{                                                    !! exchanged.}
961   \textcolor{keywordtype}{type}(mom\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: mom\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}
962 \textcolor{comment}{                                                    !! needed to determine where data should be}
963 \textcolor{comment}{                                                    !! sent.}
964   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: sideflag\textcolor{comment}{ !< An optional integer indicating which}
965 \textcolor{comment}{      !! directions the data should be sent. It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}
966 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH.  For example, TO\_EAST sends the data to the processor to the east,}
967 \textcolor{comment}{      !! so the halos on the western side are filled.  TO\_ALL is the default if sideflag is omitted.}
968   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: position\textcolor{comment}{ !< An optional argument indicating the position.}
969 \textcolor{comment}{                                                    !! This is CENTER by default and is often CORNER,}
970 \textcolor{comment}{                                                    !! but could also be EAST\_FACE or NORTH\_FACE.}
971   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}
972 \textcolor{comment}{                                                    !! halo by default.}
973   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}
974 \textcolor{comment}{                                                    !! started then stopped to time this routine.}
975   \textcolor{comment}{! Local variables}
976   \textcolor{keywordtype}{integer} :: dirflag
977 
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}
979 
980   dirflag = to\_all \textcolor{comment}{! 60}
981   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(sideflag)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (sideflag > 0) dirflag = sideflag ;\textcolor{keywordflow}{ endif}
982 
983   \textcolor{keywordflow}{if} (mpp\_group\_update\_initialized(group)) \textcolor{keywordflow}{then}
984     \textcolor{keyword}{call }mpp\_reset\_group\_update\_field(group,array)
985   \textcolor{keywordflow}{elseif} (\textcolor{keyword}{present}(halo) .and. mom\_dom%thin\_halo\_updates) \textcolor{keywordflow}{then}
986     \textcolor{keyword}{call }mpp\_create\_group\_update(group, array, mom\_dom%mpp\_domain, flags=dirflag, &
987                                  position=position, whalo=halo, ehalo=halo, &
988                                  shalo=halo, nhalo=halo)
989   \textcolor{keywordflow}{else}
990     \textcolor{keyword}{call }mpp\_create\_group\_update(group, array, mom\_dom%mpp\_domain, flags=dirflag, &
991                                  position=position)
992 \textcolor{keywordflow}{  endif}
993 
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}
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(\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{\tt in,out}  & {\em group} & The data type that store information for group update. This data will be used in do\+\_\+group\+\_\+pass.\\
\hline
\mbox{\tt in,out}  & {\em u\+\_\+cmpt} & The nominal zonal (u) component of the vector pair which is having its halos points exchanged.\\
\hline
\mbox{\tt in,out}  & {\em v\+\_\+cmpt} & The nominal meridional (v) component of the vector pair which is having its halos points exchanged.\\
\hline
\mbox{\tt 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{\tt 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{\tt 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{\tt in}  & {\em halo} & The size of the halo to update -\/ the full halo by default.\\
\hline
\mbox{\tt 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}
1001   \textcolor{keywordtype}{type}(group\_pass\_type),  \textcolor{keywordtype}{intent(inout)} :: group\textcolor{comment}{    !< The data type that store information for}
1002 \textcolor{comment}{                                                    !! group update. This data will be used in}
1003 \textcolor{comment}{                                                    !! do\_group\_pass.}
1004   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:)},   \textcolor{keywordtype}{intent(inout)} :: u\_cmpt\textcolor{comment}{   !< The nominal zonal (u) component of the vector}
1005 \textcolor{comment}{                                                    !! pair which is having its halos points}
1006 \textcolor{comment}{                                                    !! exchanged.}
1007   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:)},   \textcolor{keywordtype}{intent(inout)} :: v\_cmpt\textcolor{comment}{   !< The nominal meridional (v) component of the}
1008 \textcolor{comment}{                                                    !! vector pair which is having its halos points}
1009 \textcolor{comment}{                                                    !! exchanged.}
1010 
1011   \textcolor{keywordtype}{type}(mom\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: mom\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}
1012 \textcolor{comment}{                                                    !! needed to determine where data should be}
1013 \textcolor{comment}{                                                    !! sent}
1014   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< An optional integer indicating which}
1015 \textcolor{comment}{      !! directions the data should be sent.  It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}
1016 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH, possibly plus SCALAR\_PAIR if these are paired non-directional}
1017 \textcolor{comment}{      !! scalars discretized at the typical vector component locations.  For example, TO\_EAST sends}
1018 \textcolor{comment}{      !! the data to the processor to the east, so the halos on the western side are filled. TO\_ALL}
1019 \textcolor{comment}{      !! is the default if omitted.}
1020   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: stagger\textcolor{comment}{  !< An optional flag, which may be one of A\_GRID,}
1021 \textcolor{comment}{                     !! BGRID\_NE, or CGRID\_NE, indicating where the two components of the vector are}
1022 \textcolor{comment}{                     !! discretized. Omitting stagger is the same as setting it to CGRID\_NE.}
1023   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}
1024 \textcolor{comment}{                                                    !! halo by default.}
1025   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}
1026 \textcolor{comment}{                                                    !! started then stopped to time this routine.}
1027   \textcolor{comment}{! Local variables}
1028   \textcolor{keywordtype}{integer} :: stagger\_local
1029   \textcolor{keywordtype}{integer} :: dirflag
1030 
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}
1032 
1033   stagger\_local = cgrid\_ne \textcolor{comment}{! Default value for type of grid}
1034   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stagger)) stagger\_local = stagger
1035 
1036   dirflag = to\_all \textcolor{comment}{! 60}
1037   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(direction)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (direction > 0) dirflag = direction ;\textcolor{keywordflow}{ endif}
1038 
1039   \textcolor{keywordflow}{if} (mpp\_group\_update\_initialized(group)) \textcolor{keywordflow}{then}
1040     \textcolor{keyword}{call }mpp\_reset\_group\_update\_field(group,u\_cmpt, v\_cmpt)
1041   \textcolor{keywordflow}{elseif} (\textcolor{keyword}{present}(halo) .and. mom\_dom%thin\_halo\_updates) \textcolor{keywordflow}{then}
1042     \textcolor{keyword}{call }mpp\_create\_group\_update(group, u\_cmpt, v\_cmpt, mom\_dom%mpp\_domain, &
1043             flags=dirflag, gridtype=stagger\_local, whalo=halo, ehalo=halo, &
1044             shalo=halo, nhalo=halo)
1045   \textcolor{keywordflow}{else}
1046     \textcolor{keyword}{call }mpp\_create\_group\_update(group, u\_cmpt, v\_cmpt, mom\_dom%mpp\_domain, &
1047             flags=dirflag, gridtype=stagger\_local)
1048 \textcolor{keywordflow}{  endif}
1049 
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}
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(\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{\tt in,out}  & {\em group} & The data type that store information for group update. This data will be used in do\+\_\+group\+\_\+pass.\\
\hline
\mbox{\tt in,out}  & {\em u\+\_\+cmpt} & The nominal zonal (u) component of the vector pair which is having its halos points exchanged.\\
\hline
\mbox{\tt in,out}  & {\em v\+\_\+cmpt} & The nominal meridional (v) component of the vector pair which is having its halos points exchanged.\\
\hline
\mbox{\tt 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{\tt 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{\tt 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{\tt in}  & {\em halo} & The size of the halo to update -\/ the full halo by default.\\
\hline
\mbox{\tt 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}
1057   \textcolor{keywordtype}{type}(group\_pass\_type),  \textcolor{keywordtype}{intent(inout)} :: group\textcolor{comment}{    !< The data type that store information for}
1058 \textcolor{comment}{                                                    !! group update. This data will be used in}
1059 \textcolor{comment}{                                                    !! do\_group\_pass.}
1060   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: u\_cmpt\textcolor{comment}{   !< The nominal zonal (u) component of the vector}
1061 \textcolor{comment}{                                                    !! pair which is having its halos points}
1062 \textcolor{comment}{                                                    !! exchanged.}
1063   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: v\_cmpt\textcolor{comment}{   !< The nominal meridional (v) component of the}
1064 \textcolor{comment}{                                                    !! vector pair which is having its halos points}
1065 \textcolor{comment}{                                                    !! exchanged.}
1066 
1067   \textcolor{keywordtype}{type}(mom\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: mom\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}
1068 \textcolor{comment}{                                                    !! needed to determine where data should be}
1069 \textcolor{comment}{                                                    !! sent.}
1070   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< An optional integer indicating which}
1071 \textcolor{comment}{      !! directions the data should be sent.  It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}
1072 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH, possibly plus SCALAR\_PAIR if these are paired non-directional}
1073 \textcolor{comment}{      !! scalars discretized at the typical vector component locations.  For example, TO\_EAST sends}
1074 \textcolor{comment}{      !! the data to the processor to the east, so the halos on the western side are filled. TO\_ALL}
1075 \textcolor{comment}{      !! is the default if omitted.}
1076   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: stagger\textcolor{comment}{  !< An optional flag, which may be one of A\_GRID,}
1077 \textcolor{comment}{                     !! BGRID\_NE, or CGRID\_NE, indicating where the two components of the vector are}
1078 \textcolor{comment}{                     !! discretized. Omitting stagger is the same as setting it to CGRID\_NE.}
1079   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}
1080 \textcolor{comment}{                                                    !! halo by default.}
1081   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}
1082 \textcolor{comment}{                                                    !! started then stopped to time this routine.}
1083 
1084   \textcolor{comment}{! Local variables}
1085   \textcolor{keywordtype}{integer} :: stagger\_local
1086   \textcolor{keywordtype}{integer} :: dirflag
1087 
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}
1089 
1090   stagger\_local = cgrid\_ne \textcolor{comment}{! Default value for type of grid}
1091   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stagger)) stagger\_local = stagger
1092 
1093   dirflag = to\_all \textcolor{comment}{! 60}
1094   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(direction)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (direction > 0) dirflag = direction ;\textcolor{keywordflow}{ endif}
1095 
1096   \textcolor{keywordflow}{if} (mpp\_group\_update\_initialized(group)) \textcolor{keywordflow}{then}
1097     \textcolor{keyword}{call }mpp\_reset\_group\_update\_field(group,u\_cmpt, v\_cmpt)
1098   \textcolor{keywordflow}{elseif} (\textcolor{keyword}{present}(halo) .and. mom\_dom%thin\_halo\_updates) \textcolor{keywordflow}{then}
1099     \textcolor{keyword}{call }mpp\_create\_group\_update(group, u\_cmpt, v\_cmpt, mom\_dom%mpp\_domain, &
1100             flags=dirflag, gridtype=stagger\_local, whalo=halo, ehalo=halo, &
1101             shalo=halo, nhalo=halo)
1102   \textcolor{keywordflow}{else}
1103     \textcolor{keyword}{call }mpp\_create\_group\_update(group, u\_cmpt, v\_cmpt, mom\_dom%mpp\_domain, &
1104             flags=dirflag, gridtype=stagger\_local)
1105 \textcolor{keywordflow}{  endif}
1106 
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}
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(\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{\tt in,out}  & {\em group} & The data type that store information for group update. This data will be used in do\+\_\+group\+\_\+pass.\\
\hline
\mbox{\tt 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{\tt 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}
1113   \textcolor{keywordtype}{type}(group\_pass\_type), \textcolor{keywordtype}{intent(inout)} :: group\textcolor{comment}{     !< The data type that store information for}
1114 \textcolor{comment}{                                                    !! group update. This data will be used in}
1115 \textcolor{comment}{                                                    !! do\_group\_pass.}
1116   \textcolor{keywordtype}{type}(mom\_domain\_type), \textcolor{keywordtype}{intent(inout)} :: mom\_dom\textcolor{comment}{   !< The MOM\_domain\_type containing the mpp\_domain}
1117 \textcolor{comment}{                                                    !! needed to determine where data should be}
1118 \textcolor{comment}{                                                    !! sent.}
1119   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}
1120 \textcolor{comment}{                                                    !! started then stopped to time this routine.}
1121   \textcolor{keywordtype}{real} :: d\_type
1122 
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}
1124 
1125   \textcolor{keyword}{call }mpp\_do\_group\_update(group, mom\_dom%mpp\_domain, d\_type)
1126 
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}
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(\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{\tt in,out}  & {\em u\+\_\+cmpt} & The nominal zonal (u) component of the vector pair which is having its halos points exchanged.\\
\hline
\mbox{\tt in,out}  & {\em v\+\_\+cmpt} & The nominal meridional (v) component of the vector pair which is having its halos points exchanged.\\
\hline
\mbox{\tt 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{\tt 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{\tt in}  & {\em scalar} & An optional argument indicating whether.\\
\hline
\mbox{\tt 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}
548   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:)},  \textcolor{keywordtype}{intent(inout)} :: u\_cmpt\textcolor{comment}{  !< The nominal zonal (u) component of the vector}
549 \textcolor{comment}{                                                  !! pair which is having its halos points}
550 \textcolor{comment}{                                                  !! exchanged.}
551   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:)},  \textcolor{keywordtype}{intent(inout)} :: v\_cmpt\textcolor{comment}{  !< The nominal meridional (v) component of the}
552 \textcolor{comment}{                                                  !! vector pair which is having its halos points}
553 \textcolor{comment}{                                                  !! exchanged.}
554   \textcolor{keywordtype}{type}(mom\_domain\_type), \textcolor{keywordtype}{intent(inout)} :: mom\_dom\textcolor{comment}{ !< The MOM\_domain\_type containing the mpp\_domain}
555 \textcolor{comment}{                                                  !! needed to determine where data should be}
556 \textcolor{comment}{                                                  !! sent.}
557   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: stagger\textcolor{comment}{ !< An optional flag, which may be one of A\_GRID,}
558 \textcolor{comment}{                     !! BGRID\_NE, or CGRID\_NE, indicating where the two components of the vector are}
559 \textcolor{comment}{                     !! discretized. Omitting stagger is the same as setting it to CGRID\_NE.}
560   \textcolor{keywordtype}{logical},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scalar\textcolor{comment}{  !< An optional argument indicating whether.}
561   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}
562 \textcolor{comment}{                                                   !! started then stopped to time this routine.}
563 
564   \textcolor{comment}{! Local variables}
565   \textcolor{keywordtype}{integer} :: stagger\_local
566   \textcolor{keywordtype}{integer} :: dirflag
567   \textcolor{keywordtype}{integer} :: i, j, isc, iec, jsc, jec, isd, ied, jsd, jed, iscb, iecb, jscb, jecb
568   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{dimension(:)} :: sbuff\_x, sbuff\_y, wbuff\_x, wbuff\_y
569   \textcolor{keywordtype}{logical} :: block\_til\_complete
570 
571   \textcolor{keywordflow}{if} (.not. mom\_dom%symmetric) \textcolor{keywordflow}{then}
572       \textcolor{keywordflow}{return}
573 \textcolor{keywordflow}{  endif}
574 
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}
576 
577   stagger\_local = cgrid\_ne \textcolor{comment}{! Default value for type of grid}
578   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stagger)) stagger\_local = stagger
579 
580   \textcolor{keywordflow}{if} (.not.(stagger\_local == cgrid\_ne .or. stagger\_local == bgrid\_ne)) \textcolor{keywordflow}{return}
581 
582   \textcolor{keyword}{call }mpp\_get\_compute\_domain(mom\_dom%mpp\_domain, isc, iec, jsc, jec)
583   \textcolor{keyword}{call }mpp\_get\_data\_domain(mom\_dom%mpp\_domain, isd, ied, jsd, jed)
584 
585   \textcolor{comment}{! Adjust isc, etc., to account for the fact that the input arrays indices all}
586   \textcolor{comment}{! start at 1 (and are effectively on a SW grid!).}
587   isc = isc - (isd-1) ; iec = iec - (isd-1)
588   jsc = jsc - (jsd-1) ; jec = jec - (jsd-1)
589   iscb = isc ; iecb = iec+1 ; jscb = jsc ; jecb = jec+1
590 
591   dirflag = to\_all \textcolor{comment}{! 60}
592   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scalar)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (scalar) dirflag = to\_all+scalar\_pair ;\textcolor{keywordflow}{ endif}
593 
594   \textcolor{keywordflow}{if} (stagger\_local == cgrid\_ne) \textcolor{keywordflow}{then}
595     \textcolor{keyword}{allocate}(wbuff\_x(jsc:jec)) ; \textcolor{keyword}{allocate}(sbuff\_y(isc:iec))
596     wbuff\_x(:) = 0.0 ; sbuff\_y(:) = 0.0
597     \textcolor{keyword}{call }mpp\_get\_boundary(u\_cmpt, v\_cmpt, mom\_dom%mpp\_domain, flags=dirflag, &
598                           wbufferx=wbuff\_x, sbuffery=sbuff\_y, &
599                           gridtype=cgrid\_ne)
600     \textcolor{keywordflow}{do} i=isc,iec
601       v\_cmpt(i,jscb) = sbuff\_y(i)
602 \textcolor{keywordflow}{    enddo}
603     \textcolor{keywordflow}{do} j=jsc,jec
604       u\_cmpt(iscb,j) = wbuff\_x(j)
605 \textcolor{keywordflow}{    enddo}
606     \textcolor{keyword}{deallocate}(wbuff\_x) ; \textcolor{keyword}{deallocate}(sbuff\_y)
607   \textcolor{keywordflow}{elseif}  (stagger\_local == bgrid\_ne) \textcolor{keywordflow}{then}
608     \textcolor{keyword}{allocate}(wbuff\_x(jscb:jecb)) ; \textcolor{keyword}{allocate}(sbuff\_x(iscb:iecb))
609     \textcolor{keyword}{allocate}(wbuff\_y(jscb:jecb)) ; \textcolor{keyword}{allocate}(sbuff\_y(iscb:iecb))
610     wbuff\_x(:) = 0.0 ; wbuff\_y(:) = 0.0 ; sbuff\_x(:) = 0.0 ; sbuff\_y(:) = 0.0
611     \textcolor{keyword}{call }mpp\_get\_boundary(u\_cmpt, v\_cmpt, mom\_dom%mpp\_domain, flags=dirflag, &
612                           wbufferx=wbuff\_x, sbufferx=sbuff\_x, &
613                           wbuffery=wbuff\_y, sbuffery=sbuff\_y, &
614                           gridtype=bgrid\_ne)
615     \textcolor{keywordflow}{do} i=iscb,iecb
616       u\_cmpt(i,jscb) = sbuff\_x(i) ; v\_cmpt(i,jscb) = sbuff\_y(i)
617 \textcolor{keywordflow}{    enddo}
618     \textcolor{keywordflow}{do} j=jscb,jecb
619       u\_cmpt(iscb,j) = wbuff\_x(j) ; v\_cmpt(iscb,j) = wbuff\_y(j)
620 \textcolor{keywordflow}{    enddo}
621     \textcolor{keyword}{deallocate}(wbuff\_x) ; \textcolor{keyword}{deallocate}(sbuff\_x)
622     \textcolor{keyword}{deallocate}(wbuff\_y) ; \textcolor{keyword}{deallocate}(sbuff\_y)
623 \textcolor{keywordflow}{  endif}
624 
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}
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(\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{\tt in}  & {\em domain} & The M\+OM domain from which to extract information\\
\hline
\mbox{\tt out}  & {\em isc} & The start i-\/index of the computational domain\\
\hline
\mbox{\tt out}  & {\em iec} & The end i-\/index of the computational domain\\
\hline
\mbox{\tt out}  & {\em jsc} & The start j-\/index of the computational domain\\
\hline
\mbox{\tt out}  & {\em jec} & The end j-\/index of the computational domain\\
\hline
\mbox{\tt out}  & {\em isd} & The start i-\/index of the data domain\\
\hline
\mbox{\tt out}  & {\em ied} & The end i-\/index of the data domain\\
\hline
\mbox{\tt out}  & {\em jsd} & The start j-\/index of the data domain\\
\hline
\mbox{\tt out}  & {\em jed} & The end j-\/index of the data domain\\
\hline
\mbox{\tt out}  & {\em isg} & The start i-\/index of the global domain\\
\hline
\mbox{\tt out}  & {\em ieg} & The end i-\/index of the global domain\\
\hline
\mbox{\tt out}  & {\em jsg} & The start j-\/index of the global domain\\
\hline
\mbox{\tt out}  & {\em jeg} & The end j-\/index of the global domain\\
\hline
\mbox{\tt out}  & {\em idg\+\_\+offset} & The offset between the corresponding global and data i-\/index spaces.\\
\hline
\mbox{\tt out}  & {\em jdg\+\_\+offset} & The offset between the corresponding global and data j-\/index spaces.\\
\hline
\mbox{\tt out}  & {\em symmetric} & True if symmetric memory is used.\\
\hline
\mbox{\tt in}  & {\em local\+\_\+indexing} & If true, local tracer array indices start at 1, as in most M\+O\+M6 code.\\
\hline
\mbox{\tt 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}
1815   \textcolor{keywordtype}{type}(mom\_domain\_type), &
1816            \textcolor{keywordtype}{intent(in)}  :: domain\textcolor{comment}{ !< The MOM domain from which to extract information}
1817   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: isc\textcolor{comment}{    !< The start i-index of the computational domain}
1818   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: iec\textcolor{comment}{    !< The end i-index of the computational domain}
1819   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jsc\textcolor{comment}{    !< The start j-index of the computational domain}
1820   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jec\textcolor{comment}{    !< The end j-index of the computational domain}
1821   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: isd\textcolor{comment}{    !< The start i-index of the data domain}
1822   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: ied\textcolor{comment}{    !< The end i-index of the data domain}
1823   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jsd\textcolor{comment}{    !< The start j-index of the data domain}
1824   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jed\textcolor{comment}{    !< The end j-index of the data domain}
1825   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: isg\textcolor{comment}{    !< The start i-index of the global domain}
1826   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: ieg\textcolor{comment}{    !< The end i-index of the global domain}
1827   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jsg\textcolor{comment}{    !< The start j-index of the global domain}
1828   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jeg\textcolor{comment}{    !< The end j-index of the global domain}
1829   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: idg\_offset\textcolor{comment}{ !< The offset between the corresponding global and}
1830 \textcolor{comment}{                                 !! data i-index spaces.}
1831   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jdg\_offset\textcolor{comment}{ !< The offset between the corresponding global and}
1832 \textcolor{comment}{                                 !! data j-index spaces.}
1833   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)} :: symmetric\textcolor{comment}{  !< True if symmetric memory is used.}
1834   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: local\_indexing\textcolor{comment}{ !< If true, local tracer array indices start at 1,}
1835 \textcolor{comment}{                                           !! as in most MOM6 code.}
1836   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: index\_offset\textcolor{comment}{   !< A fixed additional offset to all indices. This}
1837 \textcolor{comment}{                                           !! can be useful for some types of debugging with}
1838 \textcolor{comment}{                                           !! dynamic memory allocation.}
1839   \textcolor{comment}{! Local variables}
1840   \textcolor{keywordtype}{integer} :: ind\_off
1841   \textcolor{keywordtype}{logical} :: local
1842 
1843   local = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(local\_indexing)) local = local\_indexing
1844   ind\_off = 0 ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(index\_offset)) ind\_off = index\_offset
1845 
1846   \textcolor{keyword}{call }mpp\_get\_compute\_domain(domain%mpp\_domain, isc, iec, jsc, jec)
1847   \textcolor{keyword}{call }mpp\_get\_data\_domain(domain%mpp\_domain, isd, ied, jsd, jed)
1848   \textcolor{keyword}{call }mpp\_get\_global\_domain(domain%mpp\_domain, isg, ieg, jsg, jeg)
1849 
1850   \textcolor{comment}{! This code institutes the MOM convention that local array indices start at 1.}
1851   \textcolor{keywordflow}{if} (local) \textcolor{keywordflow}{then}
1852     idg\_offset = isd-1 ; jdg\_offset = jsd-1
1853     isc = isc-isd+1 ; iec = iec-isd+1 ; jsc = jsc-jsd+1 ; jec = jec-jsd+1
1854     ied = ied-isd+1 ; jed = jed-jsd+1
1855     isd = 1 ; jsd = 1
1856   \textcolor{keywordflow}{else}
1857     idg\_offset = 0 ; jdg\_offset = 0
1858 \textcolor{keywordflow}{  endif}
1859   \textcolor{keywordflow}{if} (ind\_off /= 0) \textcolor{keywordflow}{then}
1860     idg\_offset = idg\_offset + ind\_off ; jdg\_offset = jdg\_offset + ind\_off
1861     isc = isc + ind\_off ; iec = iec + ind\_off
1862     jsc = jsc + ind\_off ; jec = jec + ind\_off
1863     isd = isd + ind\_off ; ied = ied + ind\_off
1864     jsd = jsd + ind\_off ; jed = jed + ind\_off
1865 \textcolor{keywordflow}{  endif}
1866   symmetric = domain%symmetric
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(\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{\tt in}  & {\em domain} & The M\+OM domain from which to extract information\\
\hline
\mbox{\tt out}  & {\em isc\+\_\+d2} & The start i-\/index of the computational domain\\
\hline
\mbox{\tt out}  & {\em iec\+\_\+d2} & The end i-\/index of the computational domain\\
\hline
\mbox{\tt out}  & {\em jsc\+\_\+d2} & The start j-\/index of the computational domain\\
\hline
\mbox{\tt out}  & {\em jec\+\_\+d2} & The end j-\/index of the computational domain\\
\hline
\mbox{\tt out}  & {\em isd\+\_\+d2} & The start i-\/index of the data domain\\
\hline
\mbox{\tt out}  & {\em ied\+\_\+d2} & The end i-\/index of the data domain\\
\hline
\mbox{\tt out}  & {\em jsd\+\_\+d2} & The start j-\/index of the data domain\\
\hline
\mbox{\tt out}  & {\em jed\+\_\+d2} & The end j-\/index of the data domain\\
\hline
\mbox{\tt out}  & {\em isg\+\_\+d2} & The start i-\/index of the global domain\\
\hline
\mbox{\tt out}  & {\em ieg\+\_\+d2} & The end i-\/index of the global domain\\
\hline
\mbox{\tt out}  & {\em jsg\+\_\+d2} & The start j-\/index of the global domain\\
\hline
\mbox{\tt 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}
1873   \textcolor{keywordtype}{type}(mom\_domain\_type), &
1874            \textcolor{keywordtype}{intent(in)}  :: domain\textcolor{comment}{ !< The MOM domain from which to extract information}
1875   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: isc\_d2\textcolor{comment}{ !< The start i-index of the computational domain}
1876   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: iec\_d2\textcolor{comment}{ !< The end i-index of the computational domain}
1877   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jsc\_d2\textcolor{comment}{ !< The start j-index of the computational domain}
1878   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jec\_d2\textcolor{comment}{ !< The end j-index of the computational domain}
1879   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: isd\_d2\textcolor{comment}{ !< The start i-index of the data domain}
1880   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: ied\_d2\textcolor{comment}{ !< The end i-index of the data domain}
1881   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jsd\_d2\textcolor{comment}{ !< The start j-index of the data domain}
1882   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jed\_d2\textcolor{comment}{ !< The end j-index of the data domain}
1883   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: isg\_d2\textcolor{comment}{ !< The start i-index of the global domain}
1884   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: ieg\_d2\textcolor{comment}{ !< The end i-index of the global domain}
1885   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jsg\_d2\textcolor{comment}{ !< The start j-index of the global domain}
1886   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)} :: jeg\_d2\textcolor{comment}{ !< The end j-index of the global domain}
1887 
1888   \textcolor{keyword}{call }mpp\_get\_compute\_domain(domain%mpp\_domain\_d2, isc\_d2, iec\_d2, jsc\_d2, jec\_d2)
1889   \textcolor{keyword}{call }mpp\_get\_data\_domain(domain%mpp\_domain\_d2, isd\_d2, ied\_d2, jsd\_d2, jed\_d2)
1890   \textcolor{keyword}{call }mpp\_get\_global\_domain (domain%mpp\_domain\_d2, isg\_d2, ieg\_d2, jsg\_d2, jeg\_d2)
1891   \textcolor{comment}{! This code institutes the MOM convention that local array indices start at 1.}
1892   isc\_d2 = isc\_d2-isd\_d2+1 ; iec\_d2 = iec\_d2-isd\_d2+1
1893   jsc\_d2 = jsc\_d2-jsd\_d2+1 ; jec\_d2 = jec\_d2-jsd\_d2+1
1894   ied\_d2 = ied\_d2-isd\_d2+1 ; jed\_d2 = jed\_d2-jsd\_d2+1
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(\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{\tt in}  & {\em domain} & M\+OM domain\\
\hline
\mbox{\tt out}  & {\em niglobal} & i-\/index global size of h-\/point arrays\\
\hline
\mbox{\tt 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}
1973   \textcolor{keywordtype}{type}(mom\_domain\_type), \textcolor{keywordtype}{intent(in)}  :: domain\textcolor{comment}{   !< MOM domain}
1974   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{intent(out)} :: niglobal\textcolor{comment}{ !< i-index global size of h-point arrays}
1975   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{intent(out)} :: njglobal\textcolor{comment}{ !< j-index global size of h-point arrays}
1976 
1977   niglobal = domain%niglobal
1978   njglobal = domain%njglobal
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(\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{\tt in}  & {\em domain} & M\+OM domain from which to extract information\\
\hline
\mbox{\tt in}  & {\em size} & The i-\/array size\\
\hline
\mbox{\tt out}  & {\em is} & The computational domain starting i-\/index.\\
\hline
\mbox{\tt out}  & {\em ie} & The computational domain ending i-\/index.\\
\hline
\mbox{\tt 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}
1901   \textcolor{keywordtype}{type}(mom\_domain\_type), \textcolor{keywordtype}{intent(in)}  :: domain\textcolor{comment}{ !< MOM domain from which to extract information}
1902   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{intent(in)}  :: size\textcolor{comment}{   !< The i-array size}
1903   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{intent(out)} :: is\textcolor{comment}{     !< The computational domain starting i-index.}
1904   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{intent(out)} :: ie\textcolor{comment}{     !< The computational domain ending i-index.}
1905   \textcolor{keywordtype}{logical},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: symmetric\textcolor{comment}{ !< If present, indicates whether symmetric sizes}
1906 \textcolor{comment}{                                               !! can be considered.}
1907   \textcolor{comment}{! Local variables}
1908   \textcolor{keywordtype}{logical} :: sym
1909   \textcolor{keywordtype}{character(len=120)} :: mesg, mesg2
1910   \textcolor{keywordtype}{integer} :: isc, iec, jsc, jec, isd, ied, jsd, jed
1911 
1912   \textcolor{keyword}{call }mpp\_get\_compute\_domain(domain%mpp\_domain, isc, iec, jsc, jec)
1913   \textcolor{keyword}{call }mpp\_get\_data\_domain(domain%mpp\_domain, isd, ied, jsd, jed)
1914 
1915   isc = isc-isd+1 ; iec = iec-isd+1 ; ied = ied-isd+1 ; isd = 1
1916   sym = domain%symmetric ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(symmetric)) sym = symmetric
1917 
1918   \textcolor{keywordflow}{if} (\textcolor{keyword}{size} == ied) \textcolor{keywordflow}{then} ; is = isc ; ie = iec
1919   \textcolor{keywordflow}{elseif} (\textcolor{keyword}{size} == 1+iec-isc) \textcolor{keywordflow}{then} ; is = 1 ; ie = \textcolor{keyword}{size}
1920   \textcolor{keywordflow}{elseif} (sym .and. (\textcolor{keyword}{size} == 1+ied)) \textcolor{keywordflow}{then} ; is = isc ; ie = iec+1
1921   \textcolor{keywordflow}{elseif} (sym .and. (\textcolor{keyword}{size} == 2+iec-isc)) \textcolor{keywordflow}{then} ; is = 1 ; ie = size+1
1922   \textcolor{keywordflow}{else}
1923     \textcolor{keyword}{write}(mesg,\textcolor{stringliteral}{'("Unrecognized size ", i6, "in call to get\_simple\_array\_i\_ind.  \(\backslash\)")'}) \textcolor{keyword}{size}
1924     \textcolor{keywordflow}{if} (sym) \textcolor{keywordflow}{then}
1925       \textcolor{keyword}{write}(mesg2,\textcolor{stringliteral}{'("Valid sizes are : ", 2i7)'}) ied, 1+iec-isc
1926     \textcolor{keywordflow}{else}
1927       \textcolor{keyword}{write}(mesg2,\textcolor{stringliteral}{'("Valid sizes are : ", 4i7)'}) ied, 1+iec-isc, 1+ied, 2+iec-isc
1928 \textcolor{keywordflow}{    endif}
1929     \textcolor{keyword}{call }mom\_error(fatal, trim(mesg)//trim(mesg2))
1930 \textcolor{keywordflow}{  endif}
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(\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{\tt in}  & {\em domain} & M\+OM domain from which to extract information\\
\hline
\mbox{\tt in}  & {\em size} & The j-\/array size\\
\hline
\mbox{\tt out}  & {\em js} & The computational domain starting j-\/index.\\
\hline
\mbox{\tt out}  & {\em je} & The computational domain ending j-\/index.\\
\hline
\mbox{\tt 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}
1938   \textcolor{keywordtype}{type}(mom\_domain\_type), \textcolor{keywordtype}{intent(in)}  :: domain\textcolor{comment}{ !< MOM domain from which to extract information}
1939   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{intent(in)}  :: size\textcolor{comment}{   !< The j-array size}
1940   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{intent(out)} :: js\textcolor{comment}{     !< The computational domain starting j-index.}
1941   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{intent(out)} :: je\textcolor{comment}{     !< The computational domain ending j-index.}
1942   \textcolor{keywordtype}{logical},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}  :: symmetric\textcolor{comment}{ !< If present, indicates whether symmetric sizes}
1943 \textcolor{comment}{                                               !! can be considered.}
1944   \textcolor{comment}{! Local variables}
1945   \textcolor{keywordtype}{logical} :: sym
1946   \textcolor{keywordtype}{character(len=120)} :: mesg, mesg2
1947   \textcolor{keywordtype}{integer} :: isc, iec, jsc, jec, isd, ied, jsd, jed
1948 
1949   \textcolor{keyword}{call }mpp\_get\_compute\_domain(domain%mpp\_domain, isc, iec, jsc, jec)
1950   \textcolor{keyword}{call }mpp\_get\_data\_domain(domain%mpp\_domain, isd, ied, jsd, jed)
1951 
1952   jsc = jsc-jsd+1 ; jec = jec-jsd+1 ; jed = jed-jsd+1 ; jsd = 1
1953   sym = domain%symmetric ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(symmetric)) sym = symmetric
1954 
1955   \textcolor{keywordflow}{if} (\textcolor{keyword}{size} == jed) \textcolor{keywordflow}{then} ; js = jsc ; je = jec
1956   \textcolor{keywordflow}{elseif} (\textcolor{keyword}{size} == 1+jec-jsc) \textcolor{keywordflow}{then} ; js = 1 ; je = \textcolor{keyword}{size}
1957   \textcolor{keywordflow}{elseif} (sym .and. (\textcolor{keyword}{size} == 1+jed)) \textcolor{keywordflow}{then} ; js = jsc ; je = jec+1
1958   \textcolor{keywordflow}{elseif} (sym .and. (\textcolor{keyword}{size} == 2+jec-jsc)) \textcolor{keywordflow}{then} ; js = 1 ; je = size+1
1959   \textcolor{keywordflow}{else}
1960     \textcolor{keyword}{write}(mesg,\textcolor{stringliteral}{'("Unrecognized size ", i6, "in call to get\_simple\_array\_j\_ind.  \(\backslash\)")'}) \textcolor{keyword}{size}
1961     \textcolor{keywordflow}{if} (sym) \textcolor{keywordflow}{then}
1962       \textcolor{keyword}{write}(mesg2,\textcolor{stringliteral}{'("Valid sizes are : ", 2i7)'}) jed, 1+jec-jsc
1963     \textcolor{keywordflow}{else}
1964       \textcolor{keyword}{write}(mesg2,\textcolor{stringliteral}{'("Valid sizes are : ", 4i7)'}) jed, 1+jec-jsc, 1+jed, 2+jec-jsc
1965 \textcolor{keywordflow}{    endif}
1966     \textcolor{keyword}{call }mom\_error(fatal, trim(mesg)//trim(mesg2))
1967 \textcolor{keywordflow}{  endif}
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(\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{\tt in}  & {\em param\+\_\+file} & A structure to parse for run-\/time parameters\\
\hline
\mbox{\tt 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{\tt 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{\tt in}  & {\em nihalo} & Default halo sizes, required with static memory.\\
\hline
\mbox{\tt in}  & {\em njhalo} & Default halo sizes, required with static memory.\\
\hline
\mbox{\tt in}  & {\em niglobal} & Total domain sizes, required with static memory.\\
\hline
\mbox{\tt in}  & {\em njglobal} & Total domain sizes, required with static memory.\\
\hline
\mbox{\tt in}  & {\em niproc} & Processor counts, required with static memory.\\
\hline
\mbox{\tt in}  & {\em njproc} & Processor counts, required with static memory.\\
\hline
\mbox{\tt 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{\tt in}  & {\em domain\+\_\+name} & A name for this domain, \char`\"{}\+M\+O\+M\char`\"{} if missing.\\
\hline
\mbox{\tt in}  & {\em include\+\_\+name} & A name for model\textquotesingle{}s include file, \char`\"{}\+M\+O\+M\+\_\+memory.\+h\char`\"{} if missing.\\
\hline
\mbox{\tt 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}
1178   \textcolor{keywordtype}{type}(mom\_domain\_type),           \textcolor{keywordtype}{pointer}       :: mom\_dom\textcolor{comment}{      !< A pointer to the MOM\_domain\_type}
1179 \textcolor{comment}{                                                                 !! being defined here.}
1180   \textcolor{keywordtype}{type}(param\_file\_type),           \textcolor{keywordtype}{intent(in)}    :: param\_file\textcolor{comment}{   !< A structure to parse for}
1181 \textcolor{comment}{                                                                 !! run-time parameters}
1182   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{optional},               \textcolor{keywordtype}{intent(in)}    :: symmetric\textcolor{comment}{    !< If present, this specifies}
1183 \textcolor{comment}{                                            !! whether this domain is symmetric, regardless of}
1184 \textcolor{comment}{                                            !! whether the macro SYMMETRIC\_MEMORY\_ is defined.}
1185   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{optional},               \textcolor{keywordtype}{intent(in)}    :: static\_memory\textcolor{comment}{ !< If present and true, this}
1186 \textcolor{comment}{                         !! domain type is set up for static memory and error checking of}
1187 \textcolor{comment}{                         !! various input values is performed against those in the input file.}
1188   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional},               \textcolor{keywordtype}{intent(in)}    :: nihalo\textcolor{comment}{       !< Default halo sizes, required}
1189 \textcolor{comment}{                                                                 !! with static memory.}
1190   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional},               \textcolor{keywordtype}{intent(in)}    :: njhalo\textcolor{comment}{       !< Default halo sizes, required}
1191 \textcolor{comment}{                                                                 !! with static memory.}
1192   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional},               \textcolor{keywordtype}{intent(in)}    :: niglobal\textcolor{comment}{     !< Total domain sizes, required}
1193 \textcolor{comment}{                                                                 !! with static memory.}
1194   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional},               \textcolor{keywordtype}{intent(in)}    :: njglobal\textcolor{comment}{     !< Total domain sizes, required}
1195 \textcolor{comment}{                                                                 !! with static memory.}
1196   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional},               \textcolor{keywordtype}{intent(in)}    :: niproc\textcolor{comment}{       !< Processor counts, required with}
1197 \textcolor{comment}{                                                                 !! static memory.}
1198   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional},               \textcolor{keywordtype}{intent(in)}    :: njproc\textcolor{comment}{       !< Processor counts, required with}
1199 \textcolor{comment}{                                                                 !! static memory.}
1200   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{dimension(2)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(inout)} :: min\_halo\textcolor{comment}{     !< If present, this sets the}
1201 \textcolor{comment}{                                        !! minimum halo size for this domain in the i- and j-}
1202 \textcolor{comment}{                                        !! directions, and returns the actual halo size used.}
1203   \textcolor{keywordtype}{character(len=*)},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: domain\_name\textcolor{comment}{  !< A name for this domain, "MOM"}
1204 \textcolor{comment}{                                                                 !! if missing.}
1205   \textcolor{keywordtype}{character(len=*)},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: include\_name\textcolor{comment}{ !< A name for model's include file,}
1206 \textcolor{comment}{                                                                 !! "MOM\_memory.h" if missing.}
1207   \textcolor{keywordtype}{character(len=*)},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: param\_suffix\textcolor{comment}{ !< A suffix to apply to}
1208 \textcolor{comment}{                                                                 !! layout-specific parameters.}
1209 
1210   \textcolor{comment}{! Local variables}
1211   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{dimension(2)} :: layout = (/ 1, 1 /)
1212   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{dimension(2)} :: io\_layout = (/ 0, 0 /)
1213   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{dimension(4)} :: global\_indices
1214 \textcolor{comment}{!$ integer :: ocean\_nthreads       ! Number of Openmp threads}
1215 \textcolor{comment}{!$ integer :: get\_cpu\_affinity, omp\_get\_thread\_num, omp\_get\_num\_threads}
1216 \textcolor{comment}{!$ logical :: ocean\_omp\_hyper\_thread}
1217   \textcolor{keywordtype}{integer} :: nihalo\_dflt, njhalo\_dflt
1218   \textcolor{keywordtype}{integer} :: pe, proc\_used
1219   \textcolor{keywordtype}{integer} :: x\_flags, y\_flags
1220   \textcolor{keywordtype}{logical} :: reentrant\_x, reentrant\_y, tripolar\_n, is\_static
1221   \textcolor{keywordtype}{logical}            :: mask\_table\_exists
1222   \textcolor{keywordtype}{character(len=128)} :: mask\_table, inputdir
1223   \textcolor{keywordtype}{character(len=64)}  :: dom\_name, inc\_nm
1224   \textcolor{keywordtype}{character(len=200)} :: mesg
1225 
1226   \textcolor{keywordtype}{integer} :: xsiz, ysiz, nip\_parsed, njp\_parsed
1227   \textcolor{keywordtype}{integer} :: isc,iec,jsc,jec \textcolor{comment}{! The bounding indices of the computational domain.}
1228   \textcolor{keywordtype}{character(len=8)} :: char\_xsiz, char\_ysiz, char\_niglobal, char\_njglobal
1229   \textcolor{keywordtype}{character(len=40)} :: nihalo\_nm, njhalo\_nm, layout\_nm, io\_layout\_nm, masktable\_nm
1230   \textcolor{keywordtype}{character(len=40)} :: niproc\_nm, njproc\_nm
1231   \textcolor{keywordtype}{integer} :: xhalo\_d2,yhalo\_d2
1232 \textcolor{comment}{! This include declares and sets the variable "version".}
1233 \textcolor{preprocessor}{#include "version\_variable.h"}
1234 \textcolor{preprocessor}{}  \textcolor{keywordtype}{character(len=40)}  :: mdl \textcolor{comment}{! This module's name.}
1235 
1236   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(mom\_dom)) \textcolor{keywordflow}{then}
1237     \textcolor{keyword}{allocate}(mom\_dom)
1238     \textcolor{keyword}{allocate}(mom\_dom%mpp\_domain)
1239     \textcolor{keyword}{allocate}(mom\_dom%mpp\_domain\_d2)
1240 \textcolor{keywordflow}{  endif}
1241 
1242   pe = pe\_here()
1243   proc\_used = num\_pes()
1244 
1245   mdl = \textcolor{stringliteral}{"MOM\_domains"}
1246 
1247   mom\_dom%symmetric = .true.
1248   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(symmetric)) \textcolor{keywordflow}{then} ; mom\_dom%symmetric = symmetric ;\textcolor{keywordflow}{ endif}
1249   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(min\_halo)) mdl = trim(mdl)//\textcolor{stringliteral}{" min\_halo"}
1250 
1251   dom\_name = \textcolor{stringliteral}{"MOM"} ; inc\_nm = \textcolor{stringliteral}{"MOM\_memory.h"}
1252   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(domain\_name)) dom\_name = trim(domain\_name)
1253   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(include\_name)) inc\_nm = trim(include\_name)
1254 
1255   nihalo\_nm = \textcolor{stringliteral}{"NIHALO"} ; njhalo\_nm = \textcolor{stringliteral}{"NJHALO"}
1256   layout\_nm = \textcolor{stringliteral}{"LAYOUT"} ; io\_layout\_nm = \textcolor{stringliteral}{"IO\_LAYOUT"} ; masktable\_nm = \textcolor{stringliteral}{"MASKTABLE"}
1257   niproc\_nm = \textcolor{stringliteral}{"NIPROC"} ; njproc\_nm = \textcolor{stringliteral}{"NJPROC"}
1258   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(param\_suffix)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (len(trim(adjustl(param\_suffix))) > 0) \textcolor{keywordflow}{then}
1259     nihalo\_nm = \textcolor{stringliteral}{"NIHALO"}//(trim(adjustl(param\_suffix)))
1260     njhalo\_nm = \textcolor{stringliteral}{"NJHALO"}//(trim(adjustl(param\_suffix)))
1261     layout\_nm = \textcolor{stringliteral}{"LAYOUT"}//(trim(adjustl(param\_suffix)))
1262     io\_layout\_nm = \textcolor{stringliteral}{"IO\_LAYOUT"}//(trim(adjustl(param\_suffix)))
1263     masktable\_nm = \textcolor{stringliteral}{"MASKTABLE"}//(trim(adjustl(param\_suffix)))
1264     niproc\_nm = \textcolor{stringliteral}{"NIPROC"}//(trim(adjustl(param\_suffix)))
1265     njproc\_nm = \textcolor{stringliteral}{"NJPROC"}//(trim(adjustl(param\_suffix)))
1266 \textcolor{keywordflow}{  endif} ;\textcolor{keywordflow}{ endif}
1267 
1268   is\_static = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(static\_memory)) is\_static = static\_memory
1269   \textcolor{keywordflow}{if} (is\_static) \textcolor{keywordflow}{then}
1270     \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{present}(nihalo)) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"NIHALO must be "}// &
1271       \textcolor{stringliteral}{"present in the call to MOM\_domains\_init with static memory."})
1272     \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{present}(njhalo)) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"NJHALO must be "}// &
1273       \textcolor{stringliteral}{"present in the call to MOM\_domains\_init with static memory."})
1274     \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{present}(niglobal)) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"NIGLOBAL must be "}// &
1275       \textcolor{stringliteral}{"present in the call to MOM\_domains\_init with static memory."})
1276     \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{present}(njglobal)) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"NJGLOBAL must be "}// &
1277       \textcolor{stringliteral}{"present in the call to MOM\_domains\_init with static memory."})
1278     \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{present}(niproc)) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"NIPROC must be "}// &
1279       \textcolor{stringliteral}{"present in the call to MOM\_domains\_init with static memory."})
1280     \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{present}(njproc)) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"NJPROC must be "}// &
1281       \textcolor{stringliteral}{"present in the call to MOM\_domains\_init with static memory."})
1282 \textcolor{keywordflow}{  endif}
1283 
1284   \textcolor{comment}{! Read all relevant parameters and write them to the model log.}
1285   \textcolor{keyword}{call }log\_version(param\_file, mdl, version, \textcolor{stringliteral}{""}, log\_to\_all=.true., layout=.true.)
1286   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"REENTRANT\_X"}, reentrant\_x, &
1287                  \textcolor{stringliteral}{"If true, the domain is zonally reentrant."}, default=.true.)
1288   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"REENTRANT\_Y"}, reentrant\_y, &
1289                  \textcolor{stringliteral}{"If true, the domain is meridionally reentrant."}, &
1290                  default=.false.)
1291   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"TRIPOLAR\_N"}, tripolar\_n, &
1292                  \textcolor{stringliteral}{"Use tripolar connectivity at the northern edge of the "}//&
1293                  \textcolor{stringliteral}{"domain.  With TRIPOLAR\_N, NIGLOBAL must be even."}, &
1294                  default=.false.)
1295 
1296 \textcolor{preprocessor}{#ifndef NOT\_SET\_AFFINITY}
1297 \textcolor{preprocessor}{}\textcolor{comment}{!$  call fms\_affinity\_init}
1298 \textcolor{comment}{!$OMP PARALLEL}
1299 \textcolor{comment}{!$OMP master}
1300 \textcolor{comment}{!$ ocean\_nthreads = omp\_get\_num\_threads()}
1301 \textcolor{comment}{!$OMP END MASTER}
1302 \textcolor{comment}{!$OMP END PARALLEL}
1303 \textcolor{comment}{!$ if(ocean\_nthreads < 2 ) then}
1304 \textcolor{comment}{!$   call get\_param(param\_file, mdl, "OCEAN\_OMP\_THREADS", ocean\_nthreads, &}
1305 \textcolor{comment}{!$              "The number of OpenMP threads that MOM6 will use.", &}
1306 \textcolor{comment}{!$              default = 1, layoutParam=.true.)}
1307 \textcolor{comment}{!$   call get\_param(param\_file, mdl, "OCEAN\_OMP\_HYPER\_THREAD", ocean\_omp\_hyper\_thread, &}
1308 \textcolor{comment}{!$              "If True, use hyper-threading.", default = .false., layoutParam=.true.)}
1309 \textcolor{comment}{!$   call fms\_affinity\_set('OCEAN', ocean\_omp\_hyper\_thread, ocean\_nthreads)}
1310 \textcolor{comment}{!$   call omp\_set\_num\_threads(ocean\_nthreads)}
1311 \textcolor{comment}{!$   write(6,*) "MOM\_domains\_mod OMPthreading ", fms\_affinity\_get(), omp\_get\_thread\_num(),
       omp\_get\_num\_threads()}
1312 \textcolor{comment}{!$   call flush(6)}
1313 \textcolor{comment}{!$ endif}
1314 \textcolor{preprocessor}{#endif}
1315 \textcolor{preprocessor}{}  \textcolor{keyword}{call }log\_param(param\_file, mdl, \textcolor{stringliteral}{"!SYMMETRIC\_MEMORY\_"}, mom\_dom%symmetric, &
1316                  \textcolor{stringliteral}{"If defined, the velocity point data domain includes "}//&
1317                  \textcolor{stringliteral}{"every face of the thickness points. In other words, "}//&
1318                  \textcolor{stringliteral}{"some arrays are larger than others, depending on where "}//&
1319                  \textcolor{stringliteral}{"they are on the staggered grid.  Also, the starting "}//&
1320                  \textcolor{stringliteral}{"index of the velocity-point arrays is usually 0, not 1. "}//&
1321                  \textcolor{stringliteral}{"This can only be set at compile time."},&
1322                  layoutparam=.true.)
1323   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"NONBLOCKING\_UPDATES"}, mom\_dom%nonblocking\_updates, &
1324                  \textcolor{stringliteral}{"If true, non-blocking halo updates may be used."}, &
1325                  default=.false., layoutparam=.true.)
1326   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"THIN\_HALO\_UPDATES"}, mom\_dom%thin\_halo\_updates, &
1327                  \textcolor{stringliteral}{"If true, optional arguments may be used to specify the "}//&
1328                  \textcolor{stringliteral}{"the width of the halos that are updated with each call."}, &
1329                  default=.true., layoutparam=.true.)
1330 
1331   nihalo\_dflt = 4 ; njhalo\_dflt = 4
1332   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(nihalo)) nihalo\_dflt = nihalo
1333   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(njhalo)) njhalo\_dflt = njhalo
1334 
1335   \textcolor{keyword}{call }log\_param(param\_file, mdl, \textcolor{stringliteral}{"!STATIC\_MEMORY\_"}, is\_static, &
1336                  \textcolor{stringliteral}{"If STATIC\_MEMORY\_ is defined, the principle variables "}//&
1337                  \textcolor{stringliteral}{"will have sizes that are statically determined at "}//&
1338                  \textcolor{stringliteral}{"compile time.  Otherwise the sizes are not determined "}//&
1339                  \textcolor{stringliteral}{"until run time. The STATIC option is substantially "}//&
1340                  \textcolor{stringliteral}{"faster, but does not allow the PE count to be changed "}//&
1341                  \textcolor{stringliteral}{"at run time.  This can only be set at compile time."},&
1342                  layoutparam=.true.)
1343 
1344   \textcolor{keywordflow}{if} (is\_static) \textcolor{keywordflow}{then}
1345     \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"NIGLOBAL"}, mom\_dom%niglobal, &
1346                  \textcolor{stringliteral}{"The total number of thickness grid points in the "}//&
1347                  \textcolor{stringliteral}{"x-direction in the physical domain. With STATIC\_MEMORY\_ "}//&
1348                  \textcolor{stringliteral}{"this is set in "}//trim(inc\_nm)//\textcolor{stringliteral}{" at compile time."}, &
1349                  static\_value=niglobal)
1350     \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"NJGLOBAL"}, mom\_dom%njglobal, &
1351                  \textcolor{stringliteral}{"The total number of thickness grid points in the "}//&
1352                  \textcolor{stringliteral}{"y-direction in the physical domain. With STATIC\_MEMORY\_ "}//&
1353                  \textcolor{stringliteral}{"this is set in "}//trim(inc\_nm)//\textcolor{stringliteral}{" at compile time."}, &
1354                  static\_value=njglobal)
1355     \textcolor{keywordflow}{if} (mom\_dom%niglobal /= niglobal) \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"MOM\_domains\_init: "} // &
1356      \textcolor{stringliteral}{"static mismatch for NIGLOBAL\_ domain size. Header file does not match input namelist"})
1357     \textcolor{keywordflow}{if} (mom\_dom%njglobal /= njglobal) \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"MOM\_domains\_init: "} // &
1358      \textcolor{stringliteral}{"static mismatch for NJGLOBAL\_ domain size. Header file does not match input namelist"})
1359 
1360   \textcolor{keywordflow}{else}
1361     \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"NIGLOBAL"}, mom\_dom%niglobal, &
1362                  \textcolor{stringliteral}{"The total number of thickness grid points in the "}//&
1363                  \textcolor{stringliteral}{"x-direction in the physical domain. With STATIC\_MEMORY\_ "}//&
1364                  \textcolor{stringliteral}{"this is set in "}//trim(inc\_nm)//\textcolor{stringliteral}{" at compile time."}, &
1365                  fail\_if\_missing=.true.)
1366     \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"NJGLOBAL"}, mom\_dom%njglobal, &
1367                  \textcolor{stringliteral}{"The total number of thickness grid points in the "}//&
1368                  \textcolor{stringliteral}{"y-direction in the physical domain. With STATIC\_MEMORY\_ "}//&
1369                  \textcolor{stringliteral}{"this is set in "}//trim(inc\_nm)//\textcolor{stringliteral}{" at compile time."}, &
1370                  fail\_if\_missing=.true.)
1371 \textcolor{keywordflow}{  endif}
1372 
1373   \textcolor{keyword}{call }get\_param(param\_file, mdl, trim(nihalo\_nm), mom\_dom%nihalo, &
1374                  \textcolor{stringliteral}{"The number of halo points on each side in the x-direction.  How this is set "}//&
1375                  \textcolor{stringliteral}{"varies with the calling component and static or dynamic memory configuration."}, &
1376                  default=nihalo\_dflt, static\_value=nihalo\_dflt)
1377   \textcolor{keyword}{call }get\_param(param\_file, mdl, trim(njhalo\_nm), mom\_dom%njhalo, &
1378                  \textcolor{stringliteral}{"The number of halo points on each side in the y-direction.  How this is set "}//&
1379                  \textcolor{stringliteral}{"varies with the calling component and static or dynamic memory configuration."}, &
1380                  default=njhalo\_dflt, static\_value=njhalo\_dflt)
1381   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(min\_halo)) \textcolor{keywordflow}{then}
1382     mom\_dom%nihalo = max(mom\_dom%nihalo, min\_halo(1))
1383     min\_halo(1) = mom\_dom%nihalo
1384     mom\_dom%njhalo = max(mom\_dom%njhalo, min\_halo(2))
1385     min\_halo(2) = mom\_dom%njhalo
1386     \textcolor{comment}{! These are generally used only with static memory, so they are considerd layout params.}
1387     \textcolor{keyword}{call }log\_param(param\_file, mdl, \textcolor{stringliteral}{"!NIHALO min\_halo"}, mom\_dom%nihalo, layoutparam=.true.)
1388     \textcolor{keyword}{call }log\_param(param\_file, mdl, \textcolor{stringliteral}{"!NJHALO min\_halo"}, mom\_dom%nihalo, layoutparam=.true.)
1389 \textcolor{keywordflow}{  endif}
1390   \textcolor{keywordflow}{if} (is\_static .and. .not.\textcolor{keyword}{present}(min\_halo)) \textcolor{keywordflow}{then}
1391     \textcolor{keywordflow}{if} (mom\_dom%nihalo /= nihalo) \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"MOM\_domains\_init: "} // &
1392            \textcolor{stringliteral}{"static mismatch for "}//trim(nihalo\_nm)//\textcolor{stringliteral}{" domain size"})
1393     \textcolor{keywordflow}{if} (mom\_dom%njhalo /= njhalo) \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"MOM\_domains\_init: "} // &
1394            \textcolor{stringliteral}{"static mismatch for "}//trim(njhalo\_nm)//\textcolor{stringliteral}{" domain size"})
1395 \textcolor{keywordflow}{  endif}
1396 
1397   global\_indices(1) = 1 ; global\_indices(2) = mom\_dom%niglobal
1398   global\_indices(3) = 1 ; global\_indices(4) = mom\_dom%njglobal
1399 
1400   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"INPUTDIR"}, inputdir, do\_not\_log=.true., default=\textcolor{stringliteral}{"."})
1401   inputdir = slasher(inputdir)
1402 
1403   \textcolor{keyword}{call }get\_param(param\_file, mdl, trim(masktable\_nm), mask\_table, &
1404                  \textcolor{stringliteral}{"A text file to specify n\_mask, layout and mask\_list. "}//&
1405                  \textcolor{stringliteral}{"This feature masks out processors that contain only land points. "}//&
1406                  \textcolor{stringliteral}{"The first line of mask\_table is the number of regions to be masked out. "}//&
1407                  \textcolor{stringliteral}{"The second line is the layout of the model and must be "}//&
1408                  \textcolor{stringliteral}{"consistent with the actual model layout. "}//&
1409                  \textcolor{stringliteral}{"The following (n\_mask) lines give the logical positions "}//&
1410                  \textcolor{stringliteral}{"of the processors that are masked out. The mask\_table "}//&
1411                  \textcolor{stringliteral}{"can be created by tools like check\_mask. The "}//&
1412                  \textcolor{stringliteral}{"following example of mask\_table masks out 2 processors, "}//&
1413                  \textcolor{stringliteral}{"(1,2) and (3,6), out of the 24 in a 4x6 layout: \(\backslash\)n"}//&
1414                  \textcolor{stringliteral}{" 2\(\backslash\)n 4,6\(\backslash\)n 1,2\(\backslash\)n 3,6\(\backslash\)n"}, default=\textcolor{stringliteral}{"MOM\_mask\_table"}, &
1415                  layoutparam=.true.)
1416   mask\_table = trim(inputdir)//trim(mask\_table)
1417   mask\_table\_exists = file\_exist(mask\_table)
1418 
1419   \textcolor{keywordflow}{if} (is\_static) \textcolor{keywordflow}{then}
1420     layout(1) = niproc ; layout(2) = njproc
1421   \textcolor{keywordflow}{else}
1422     \textcolor{keyword}{call }get\_param(param\_file, mdl, trim(layout\_nm), layout, &
1423                  \textcolor{stringliteral}{"The processor layout to be used, or 0, 0 to automatically "}//&
1424                  \textcolor{stringliteral}{"set the layout based on the number of processors."}, default=0, &
1425                  do\_not\_log=.true.)
1426     \textcolor{keyword}{call }get\_param(param\_file, mdl, trim(niproc\_nm), nip\_parsed, &
1427                  \textcolor{stringliteral}{"The number of processors in the x-direction."}, default=-1, &
1428                  do\_not\_log=.true.)
1429     \textcolor{keyword}{call }get\_param(param\_file, mdl, trim(njproc\_nm), njp\_parsed, &
1430                  \textcolor{stringliteral}{"The number of processors in the y-direction."}, default=-1, &
1431                  do\_not\_log=.true.)
1432     \textcolor{keywordflow}{if} (nip\_parsed > -1) \textcolor{keywordflow}{then}
1433       \textcolor{keywordflow}{if} ((layout(1) > 0) .and. (layout(1) /= nip\_parsed)) &
1434         \textcolor{keyword}{call }mom\_error(fatal, trim(layout\_nm)//\textcolor{stringliteral}{" and "}//trim(niproc\_nm)//\textcolor{stringliteral}{" set inconsistently. "}//&
1435                               \textcolor{stringliteral}{"Only LAYOUT should be used."})
1436       layout(1) = nip\_parsed
1437       \textcolor{keyword}{call }mom\_mesg(trim(niproc\_nm)//\textcolor{stringliteral}{" used to set "}//trim(layout\_nm)//\textcolor{stringliteral}{" in dynamic mode.  "}//&
1438                     \textcolor{stringliteral}{"Shift to using "}//trim(layout\_nm)//\textcolor{stringliteral}{" instead."})
1439 \textcolor{keywordflow}{    endif}
1440     \textcolor{keywordflow}{if} (njp\_parsed > -1) \textcolor{keywordflow}{then}
1441       \textcolor{keywordflow}{if} ((layout(2) > 0) .and. (layout(2) /= njp\_parsed)) &
1442         \textcolor{keyword}{call }mom\_error(fatal, trim(layout\_nm)//\textcolor{stringliteral}{" and "}//trim(njproc\_nm)//\textcolor{stringliteral}{" set inconsistently. "}//&
1443                               \textcolor{stringliteral}{"Only "}//trim(layout\_nm)//\textcolor{stringliteral}{" should be used."})
1444       layout(2) = njp\_parsed
1445       \textcolor{keyword}{call }mom\_mesg(trim(njproc\_nm)//\textcolor{stringliteral}{" used to set "}//trim(layout\_nm)//\textcolor{stringliteral}{" in dynamic mode.  "}//&
1446                     \textcolor{stringliteral}{"Shift to using "}//trim(layout\_nm)//\textcolor{stringliteral}{" instead."})
1447 \textcolor{keywordflow}{    endif}
1448 
1449     \textcolor{keywordflow}{if} ( layout(1)==0 .and. layout(2)==0 ) &
1450       \textcolor{keyword}{call }mpp\_define\_layout(global\_indices, proc\_used, layout)
1451     \textcolor{keywordflow}{if} ( layout(1)/=0 .and. layout(2)==0 ) layout(2) = proc\_used/layout(1)
1452     \textcolor{keywordflow}{if} ( layout(1)==0 .and. layout(2)/=0 ) layout(1) = proc\_used/layout(2)
1453 
1454     \textcolor{keywordflow}{if} (layout(1)*layout(2) /= proc\_used .and. (.not. mask\_table\_exists) ) \textcolor{keywordflow}{then}
1455       \textcolor{keyword}{write}(mesg,\textcolor{stringliteral}{'("MOM\_domains\_init: The product of the two components of layout, ", &}
1456 \textcolor{stringliteral}{}\textcolor{stringliteral}{            &      2i4,", is not the number of PEs used, ",i5,".")'}) &
1457             layout(1),layout(2),proc\_used
1458       \textcolor{keyword}{call }mom\_error(fatal, mesg)
1459 \textcolor{keywordflow}{    endif}
1460 \textcolor{keywordflow}{  endif}
1461   \textcolor{keyword}{call }log\_param(param\_file, mdl, trim(niproc\_nm), layout(1), &
1462                  \textcolor{stringliteral}{"The number of processors in the x-direction. With "}//&
1463                  \textcolor{stringliteral}{"STATIC\_MEMORY\_ this is set in "}//trim(inc\_nm)//\textcolor{stringliteral}{" at compile time."},&
1464                  layoutparam=.true.)
1465   \textcolor{keyword}{call }log\_param(param\_file, mdl, trim(njproc\_nm), layout(2), &
1466                  \textcolor{stringliteral}{"The number of processors in the y-direction. With "}//&
1467                  \textcolor{stringliteral}{"STATIC\_MEMORY\_ this is set in "}//trim(inc\_nm)//\textcolor{stringliteral}{" at compile time."},&
1468                  layoutparam=.true.)
1469   \textcolor{keyword}{call }log\_param(param\_file, mdl, trim(layout\_nm), layout, &
1470                  \textcolor{stringliteral}{"The processor layout that was actually used."},&
1471                  layoutparam=.true.)
1472 
1473   \textcolor{comment}{! Idiot check that fewer PEs than columns have been requested}
1474   \textcolor{keywordflow}{if} (layout(1)*layout(2)>mom\_dom%niglobal*mom\_dom%njglobal)  \textcolor{keywordflow}{then}
1475     \textcolor{keyword}{write}(mesg,\textcolor{stringliteral}{'(a,2(i5,x,a))'}) \textcolor{stringliteral}{'You requested to use'},layout(1)*layout(2), &
1476       \textcolor{stringliteral}{'PEs but there are only'},mom\_dom%niglobal*mom\_dom%njglobal,\textcolor{stringliteral}{'columns in the model'}
1477     \textcolor{keyword}{call }mom\_error(fatal, mesg)
1478 \textcolor{keywordflow}{  endif}
1479 
1480   \textcolor{keywordflow}{if} (mask\_table\_exists) \textcolor{keywordflow}{then}
1481     \textcolor{keyword}{call }mom\_error(note, \textcolor{stringliteral}{'MOM\_domains\_init: reading maskmap information from '}//&
1482                          trim(mask\_table))
1483     \textcolor{keyword}{allocate}(mom\_dom%maskmap(layout(1), layout(2)))
1484     \textcolor{keyword}{call }parse\_mask\_table(mask\_table, mom\_dom%maskmap, dom\_name)
1485 \textcolor{keywordflow}{  endif}
1486 
1487   \textcolor{comment}{!   Set up the I/O layout, and check that it uses an even multiple of the}
1488   \textcolor{comment}{! number of PEs in each direction.}
1489   io\_layout(:) = (/ 1, 1 /)
1490   \textcolor{keyword}{call }get\_param(param\_file, mdl, trim(io\_layout\_nm), io\_layout, &
1491                  \textcolor{stringliteral}{"The processor layout to be used, or 0,0 to automatically "}//&
1492                  \textcolor{stringliteral}{"set the io\_layout to be the same as the layout."}, default=1, &
1493                  layoutparam=.true.)
1494 
1495   \textcolor{keywordflow}{if} (io\_layout(1) < 0) \textcolor{keywordflow}{then}
1496     \textcolor{keyword}{write}(mesg,\textcolor{stringliteral}{'("MOM\_domains\_init: IO\_LAYOUT(1) = ",i4,".  Negative values "//&}
1497 \textcolor{stringliteral}{}\textcolor{stringliteral}{         &"are not allowed in ")'}) io\_layout(1)
1498     \textcolor{keyword}{call }mom\_error(fatal, mesg//trim(io\_layout\_nm))
1499   \textcolor{keywordflow}{elseif} (io\_layout(1) > 0) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (modulo(layout(1), io\_layout(1)) /= 0) \textcolor{keywordflow}{then}
1500     \textcolor{keyword}{write}(mesg,\textcolor{stringliteral}{'("MOM\_domains\_init: The i-direction I/O-layout, IO\_LAYOUT(1)=",i4, &}
1501 \textcolor{stringliteral}{}\textcolor{stringliteral}{         &", does not evenly divide the i-direction layout, NIPROC=,",i4,".")'}) &
1502           io\_layout(1),layout(1)
1503     \textcolor{keyword}{call }mom\_error(fatal, mesg)
1504 \textcolor{keywordflow}{  endif} ;\textcolor{keywordflow}{ endif}
1505 
1506   \textcolor{keywordflow}{if} (io\_layout(2) < 0) \textcolor{keywordflow}{then}
1507     \textcolor{keyword}{write}(mesg,\textcolor{stringliteral}{'("MOM\_domains\_init: IO\_LAYOUT(2) = ",i4,".  Negative values "//&}
1508 \textcolor{stringliteral}{}\textcolor{stringliteral}{         &"are not allowed in ")'}) io\_layout(2)
1509     \textcolor{keyword}{call }mom\_error(fatal, mesg//trim(io\_layout\_nm))
1510   \textcolor{keywordflow}{elseif} (io\_layout(2) /= 0) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (modulo(layout(2), io\_layout(2)) /= 0) \textcolor{keywordflow}{then}
1511     \textcolor{keyword}{write}(mesg,\textcolor{stringliteral}{'("MOM\_domains\_init: The j-direction I/O-layout, IO\_LAYOUT(2)=",i4, &}
1512 \textcolor{stringliteral}{}\textcolor{stringliteral}{         &", does not evenly divide the j-direction layout, NJPROC=,",i4,".")'}) &
1513           io\_layout(2),layout(2)
1514     \textcolor{keyword}{call }mom\_error(fatal, mesg)
1515 \textcolor{keywordflow}{  endif} ;\textcolor{keywordflow}{ endif}
1516 
1517   \textcolor{keywordflow}{if} (io\_layout(2) == 0) io\_layout(2) = layout(2)
1518   \textcolor{keywordflow}{if} (io\_layout(1) == 0) io\_layout(1) = layout(1)
1519 
1520   x\_flags = 0 ; y\_flags = 0
1521   \textcolor{keywordflow}{if} (reentrant\_x) x\_flags = cyclic\_global\_domain
1522   \textcolor{keywordflow}{if} (reentrant\_y) y\_flags = cyclic\_global\_domain
1523   \textcolor{keywordflow}{if} (tripolar\_n) \textcolor{keywordflow}{then}
1524     y\_flags = fold\_north\_edge
1525     \textcolor{keywordflow}{if} (reentrant\_y) \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"MOM\_domains: "}// &
1526       \textcolor{stringliteral}{"TRIPOLAR\_N and REENTRANT\_Y may not be defined together."})
1527 \textcolor{keywordflow}{  endif}
1528 
1529   global\_indices(1) = 1 ; global\_indices(2) = mom\_dom%niglobal
1530   global\_indices(3) = 1 ; global\_indices(4) = mom\_dom%njglobal
1531 
1532   \textcolor{keywordflow}{if} (mask\_table\_exists) \textcolor{keywordflow}{then}
1533     \textcolor{keyword}{call }mom\_define\_domain( global\_indices, layout, mom\_dom%mpp\_domain, &
1534                 xflags=x\_flags, yflags=y\_flags, &
1535                 xhalo=mom\_dom%nihalo, yhalo=mom\_dom%njhalo, &
1536                 symmetry = mom\_dom%symmetric, name=dom\_name, &
1537                 maskmap=mom\_dom%maskmap )
1538   \textcolor{keywordflow}{else}
1539     \textcolor{keyword}{call }mom\_define\_domain( global\_indices, layout, mom\_dom%mpp\_domain, &
1540                 xflags=x\_flags, yflags=y\_flags, &
1541                 xhalo=mom\_dom%nihalo, yhalo=mom\_dom%njhalo, &
1542                 symmetry = mom\_dom%symmetric, name=dom\_name)
1543 \textcolor{keywordflow}{  endif}
1544 
1545   \textcolor{keywordflow}{if} ((io\_layout(1) > 0) .and. (io\_layout(2) > 0) .and. &
1546       (layout(1)*layout(2) > 1)) \textcolor{keywordflow}{then}
1547     \textcolor{keyword}{call }mom\_define\_io\_domain(mom\_dom%mpp\_domain, io\_layout)
1548 \textcolor{keywordflow}{  endif}
1549 
1550 \textcolor{comment}{! Save the extra data for creating other domains of different resolution that overlay this domain}
1551   mom\_dom%X\_FLAGS = x\_flags
1552   mom\_dom%Y\_FLAGS = y\_flags
1553   mom\_dom%layout = layout
1554   mom\_dom%io\_layout = io\_layout
1555 
1556   \textcolor{keywordflow}{if} (is\_static) \textcolor{keywordflow}{then}
1557   \textcolor{comment}{!   A requirement of equal sized compute domains is necessary when STATIC\_MEMORY\_}
1558   \textcolor{comment}{! is used.}
1559     \textcolor{keyword}{call }mpp\_get\_compute\_domain(mom\_dom%mpp\_domain,isc,iec,jsc,jec)
1560     xsiz = iec - isc + 1
1561     ysiz = jec - jsc + 1
1562     \textcolor{keywordflow}{if} (xsiz*niproc /= mom\_dom%niglobal .OR. ysiz*njproc /= mom\_dom%njglobal) \textcolor{keywordflow}{then}
1563        \textcolor{keyword}{write}( char\_xsiz,\textcolor{stringliteral}{'(i4)'} ) niproc
1564        \textcolor{keyword}{write}( char\_ysiz,\textcolor{stringliteral}{'(i4)'} ) njproc
1565        \textcolor{keyword}{write}( char\_niglobal,\textcolor{stringliteral}{'(i4)'} ) mom\_dom%niglobal
1566        \textcolor{keyword}{write}( char\_njglobal,\textcolor{stringliteral}{'(i4)'} ) mom\_dom%njglobal
1567        \textcolor{keyword}{call }mom\_error(warning,\textcolor{stringliteral}{'MOM\_domains: Processor decomposition (NIPROC\_,NJPROC\_) = ('} &
1568            //trim(char\_xsiz)//\textcolor{stringliteral}{','}//trim(char\_ysiz)// &
1569            \textcolor{stringliteral}{') does not evenly divide size set by preprocessor macro ('}&
1570            //trim(char\_niglobal)//\textcolor{stringliteral}{','}//trim(char\_njglobal)// \textcolor{stringliteral}{'). '})
1571        \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'MOM\_domains:  #undef STATIC\_MEMORY\_ in "//trim(inc\_nm)//" to use &}
1572 \textcolor{stringliteral}{}\textcolor{stringliteral}{           &dynamic allocation, or change processor decomposition to evenly divide the domain.'})
1573 \textcolor{keywordflow}{    endif}
1574 \textcolor{keywordflow}{  endif}
1575 
1576   global\_indices(1) = 1 ; global\_indices(2) = int(mom\_dom%niglobal/2)
1577   global\_indices(3) = 1 ; global\_indices(4) = int(mom\_dom%njglobal/2)
1578   \textcolor{comment}{!For downsampled domain, recommend a halo of 1 (or 0?) since we're not doing wide-stencil computations.}
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}
1580   \textcolor{comment}{!error: downsample\_diag\_indices\_get: peculiar size 28 in i-direction\(\backslash\)ndoes not match one of 24 25 26 27}
1581   xhalo\_d2 = int(mom\_dom%nihalo/2)
1582   yhalo\_d2 = int(mom\_dom%njhalo/2)
1583   \textcolor{keywordflow}{if} (mask\_table\_exists) \textcolor{keywordflow}{then}
1584     \textcolor{keyword}{call }mom\_define\_domain( global\_indices, layout, mom\_dom%mpp\_domain\_d2, &
1585                 xflags=x\_flags, yflags=y\_flags, &
1586                 xhalo=xhalo\_d2, yhalo=yhalo\_d2, &
1587                 symmetry = mom\_dom%symmetric, name=trim(\textcolor{stringliteral}{"MOMc"}), &
1588                 maskmap=mom\_dom%maskmap )
1589   \textcolor{keywordflow}{else}
1590     \textcolor{keyword}{call }mom\_define\_domain( global\_indices, layout, mom\_dom%mpp\_domain\_d2, &
1591                 xflags=x\_flags, yflags=y\_flags, &
1592                 xhalo=xhalo\_d2, yhalo=yhalo\_d2, &
1593                 symmetry = mom\_dom%symmetric, name=trim(\textcolor{stringliteral}{"MOMc"}))
1594 \textcolor{keywordflow}{  endif}
1595 
1596   \textcolor{keywordflow}{if} ((io\_layout(1) > 0) .and. (io\_layout(2) > 0) .and. &
1597       (layout(1)*layout(2) > 1)) \textcolor{keywordflow}{then}
1598     \textcolor{keyword}{call }mom\_define\_io\_domain(mom\_dom%mpp\_domain\_d2, io\_layout)
1599 \textcolor{keywordflow}{  endif}
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(\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{\tt in,out}  & {\em array} & The array which is having its halos points exchanged.\\
\hline
\mbox{\tt 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{\tt 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{\tt 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{\tt 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{\tt in}  & {\em halo} & The size of the halo to update -\/ the full halo by default.\\
\hline
\mbox{\tt 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{\tt 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}
190   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:)},  \textcolor{keywordtype}{intent(inout)} :: array\textcolor{comment}{    !< The array which is having its halos points}
191 \textcolor{comment}{                                                   !! exchanged.}
192   \textcolor{keywordtype}{type}(mom\_domain\_type), \textcolor{keywordtype}{intent(inout)} :: mom\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}
193 \textcolor{comment}{                                                   !! needed to determine where data should be sent.}
194   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: sideflag\textcolor{comment}{ !< An optional integer indicating which}
195 \textcolor{comment}{      !! directions the data should be sent. It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}
196 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH.  For example, TO\_EAST sends the data to the processor to the east,}
197 \textcolor{comment}{      !! so the halos on the western side are filled.  TO\_ALL is the default if sideflag is omitted.}
198   \textcolor{keywordtype}{logical},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: complete\textcolor{comment}{ !< An optional argument indicating whether the}
199 \textcolor{comment}{                                                   !! halo updates should be completed before}
200 \textcolor{comment}{                                                   !! progress resumes.  Omitting complete is the}
201 \textcolor{comment}{                                                   !! same as setting complete to .true.}
202   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: position\textcolor{comment}{ !< An optional argument indicating the position.}
203 \textcolor{comment}{                                                   !! This is CENTER by default and is often CORNER,}
204 \textcolor{comment}{                                                   !! but could also be EAST\_FACE or NORTH\_FACE.}
205   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full halo}
206 \textcolor{comment}{                                                   !! by default.}
207   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: inner\_halo\textcolor{comment}{ !< The size of an inner halo to avoid updating,}
208 \textcolor{comment}{                                                   !! or 0 to avoid updating symmetric memory}
209 \textcolor{comment}{                                                   !! computational domain points.  Setting this >=0}
210 \textcolor{comment}{                                                   !! also enforces that complete=.true.}
211   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}
212 \textcolor{comment}{                                                   !! started then stopped to time this routine.}
213 
214   \textcolor{comment}{! Local variables}
215   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{dimension(:,:)} :: tmp
216   \textcolor{keywordtype}{integer} :: pos, i\_halo, j\_halo
217   \textcolor{keywordtype}{integer} :: isc, iec, jsc, jec, isd, ied, jsd, jed, iscb, iecb, jscb, jecb
218   \textcolor{keywordtype}{integer} :: inner, i, j, isfw, iefw, isfe, iefe, jsfs, jefs, jsfn, jefn
219   \textcolor{keywordtype}{integer} :: dirflag
220   \textcolor{keywordtype}{logical} :: block\_til\_complete
221 
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}
223 
224   dirflag = to\_all \textcolor{comment}{! 60}
225   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(sideflag)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (sideflag > 0) dirflag = sideflag ;\textcolor{keywordflow}{ endif}
226   block\_til\_complete = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(complete)) block\_til\_complete = complete
227   pos = center ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(position)) pos = position
228 
229   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(inner\_halo)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (inner\_halo >= 0) \textcolor{keywordflow}{then}
230     \textcolor{comment}{! Store the original values.}
231     \textcolor{keyword}{allocate}(tmp(\textcolor{keyword}{size}(array,1), \textcolor{keyword}{size}(array,2)))
232     tmp(:,:) = array(:,:)
233     block\_til\_complete = .true.
234 \textcolor{keywordflow}{  endif} ;\textcolor{keywordflow}{ endif}
235 
236   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo) .and. mom\_dom%thin\_halo\_updates) \textcolor{keywordflow}{then}
237     \textcolor{keyword}{call }mpp\_update\_domains(array, mom\_dom%mpp\_domain, flags=dirflag, &
238                         complete=block\_til\_complete, position=position, &
239                         whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)
240   \textcolor{keywordflow}{else}
241     \textcolor{keyword}{call }mpp\_update\_domains(array, mom\_dom%mpp\_domain, flags=dirflag, &
242                         complete=block\_til\_complete, position=position)
243 \textcolor{keywordflow}{  endif}
244 
245   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(inner\_halo)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (inner\_halo >= 0) \textcolor{keywordflow}{then}
246     \textcolor{keyword}{call }mpp\_get\_compute\_domain(mom\_dom%mpp\_domain, isc, iec, jsc, jec)
247     \textcolor{keyword}{call }mpp\_get\_data\_domain(mom\_dom%mpp\_domain, isd, ied, jsd, jed)
248     \textcolor{comment}{! Convert to local indices for arrays starting at 1.}
249     isc = isc - (isd-1) ; iec = iec - (isd-1) ; ied = ied - (isd-1) ; isd = 1
250     jsc = jsc - (jsd-1) ; jec = jec - (jsd-1) ; jed = jed - (jsd-1) ; jsd = 1
251     i\_halo = min(inner\_halo, isc-1) ; j\_halo = min(inner\_halo, jsc-1)
252 
253     \textcolor{comment}{! Figure out the array index extents of the eastern, western, northern and southern regions to copy.}
254     \textcolor{keywordflow}{if} (pos == center) \textcolor{keywordflow}{then}
255       \textcolor{keywordflow}{if} (\textcolor{keyword}{size}(array,1) == ied) \textcolor{keywordflow}{then}
256         isfw = isc - i\_halo ; iefw = isc ; isfe = iec ; iefe = iec + i\_halo
257       \textcolor{keywordflow}{else} ; \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"pass\_var\_2d: wrong i-size for CENTER array."}) ;\textcolor{keywordflow}{ endif}
258       \textcolor{keywordflow}{if} (\textcolor{keyword}{size}(array,2) == jed) \textcolor{keywordflow}{then}
259         isfw = isc - i\_halo ; iefw = isc ; isfe = iec ; iefe = iec + i\_halo
260       \textcolor{keywordflow}{else} ; \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"pass\_var\_2d: wrong j-size for CENTER array."}) ;\textcolor{keywordflow}{ endif}
261     \textcolor{keywordflow}{elseif} (pos == corner) \textcolor{keywordflow}{then}
262       \textcolor{keywordflow}{if} (\textcolor{keyword}{size}(array,1) == ied) \textcolor{keywordflow}{then}
263         isfw = max(isc - (i\_halo+1), 1) ; iefw = isc ; isfe = iec ; iefe = iec + i\_halo
264       \textcolor{keywordflow}{elseif} (\textcolor{keyword}{size}(array,1) == ied+1) \textcolor{keywordflow}{then}
265         isfw = isc - i\_halo ; iefw = isc+1 ; isfe = iec+1 ; iefe = min(iec + 1 + i\_halo, ied+1)
266       \textcolor{keywordflow}{else} ; \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"pass\_var\_2d: wrong i-size for CORNER array."}) ;\textcolor{keywordflow}{ endif}
267       \textcolor{keywordflow}{if} (\textcolor{keyword}{size}(array,2) == jed) \textcolor{keywordflow}{then}
268         jsfs = max(jsc - (j\_halo+1), 1) ; jefs = jsc ; jsfn = jec ; jefn = jec + j\_halo
269       \textcolor{keywordflow}{elseif} (\textcolor{keyword}{size}(array,2) == jed+1) \textcolor{keywordflow}{then}
270         jsfs = jsc - j\_halo ; jefs = jsc+1 ; jsfn = jec+1 ; jefn = min(jec + 1 + j\_halo, jed+1)
271       \textcolor{keywordflow}{else} ; \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"pass\_var\_2d: wrong j-size for CORNER array."}) ;\textcolor{keywordflow}{ endif}
272     \textcolor{keywordflow}{elseif} (pos == north\_face) \textcolor{keywordflow}{then}
273       \textcolor{keywordflow}{if} (\textcolor{keyword}{size}(array,1) == ied) \textcolor{keywordflow}{then}
274         isfw = isc - i\_halo ; iefw = isc ; isfe = iec ; iefe = iec + i\_halo
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}
276       \textcolor{keywordflow}{if} (\textcolor{keyword}{size}(array,2) == jed) \textcolor{keywordflow}{then}
277         jsfs = max(jsc - (j\_halo+1), 1) ; jefs = jsc ; jsfn = jec ; jefn = jec + j\_halo
278       \textcolor{keywordflow}{elseif} (\textcolor{keyword}{size}(array,2) == jed+1) \textcolor{keywordflow}{then}
279         jsfs = jsc - j\_halo ; jefs = jsc+1 ; jsfn = jec+1 ; jefn = min(jec + 1 + j\_halo, jed+1)
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}
281     \textcolor{keywordflow}{elseif} (pos == east\_face) \textcolor{keywordflow}{then}
282       \textcolor{keywordflow}{if} (\textcolor{keyword}{size}(array,1) == ied) \textcolor{keywordflow}{then}
283         isfw = max(isc - (i\_halo+1), 1) ; iefw = isc ; isfe = iec ; iefe = iec + i\_halo
284       \textcolor{keywordflow}{elseif} (\textcolor{keyword}{size}(array,1) == ied+1) \textcolor{keywordflow}{then}
285         isfw = isc - i\_halo ; iefw = isc+1 ; isfe = iec+1 ; iefe = min(iec + 1 + i\_halo, ied+1)
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}
287       \textcolor{keywordflow}{if} (\textcolor{keyword}{size}(array,2) == jed) \textcolor{keywordflow}{then}
288         isfw = isc - i\_halo ; iefw = isc ; isfe = iec ; iefe = iec + i\_halo
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}
290     \textcolor{keywordflow}{else}
291       \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"pass\_var\_2d: Unrecognized position"})
292 \textcolor{keywordflow}{    endif}
293 
294     \textcolor{comment}{! Copy back the stored inner halo points}
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}
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}
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}
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}
299 
300     \textcolor{keyword}{deallocate}(tmp)
301 \textcolor{keywordflow}{  endif} ;\textcolor{keywordflow}{ endif}
302 
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}
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(\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{\tt in,out}  & {\em array} & The array which is having its halos points exchanged.\\
\hline
\mbox{\tt 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{\tt 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{\tt 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{\tt 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{\tt in}  & {\em halo} & The size of the halo to update -\/ the full halo by default.\\
\hline
\mbox{\tt 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}
144   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: array\textcolor{comment}{    !< The array which is having its halos points}
145 \textcolor{comment}{                                                    !! exchanged.}
146   \textcolor{keywordtype}{type}(mom\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: mom\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}
147 \textcolor{comment}{                                                    !! needed to determine where data should be}
148 \textcolor{comment}{                                                    !! sent.}
149   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: sideflag\textcolor{comment}{ !< An optional integer indicating which}
150 \textcolor{comment}{      !! directions the data should be sent.  It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}
151 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH.  For example, TO\_EAST sends the data to the processor to the east,}
152 \textcolor{comment}{      !! sothe halos on the western side are filled.  TO\_ALL is the default if sideflag is omitted.}
153   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: complete\textcolor{comment}{ !< An optional argument indicating whether the}
154 \textcolor{comment}{                                                    !! halo updates should be completed before}
155 \textcolor{comment}{                                                    !! progress resumes. Omitting complete is the}
156 \textcolor{comment}{                                                    !! same as setting complete to .true.}
157   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: position\textcolor{comment}{ !< An optional argument indicating the position.}
158 \textcolor{comment}{                                                    !! This is CENTER by default and is often CORNER,}
159 \textcolor{comment}{                                                    !! but could also be EAST\_FACE or NORTH\_FACE.}
160   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}
161 \textcolor{comment}{                                                    !! halo by default.}
162   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}
163 \textcolor{comment}{                                                    !! started then stopped to time this routine.}
164 
165   \textcolor{keywordtype}{integer} :: dirflag
166   \textcolor{keywordtype}{logical} :: block\_til\_complete
167 
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}
169 
170   dirflag = to\_all \textcolor{comment}{! 60}
171   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(sideflag)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (sideflag > 0) dirflag = sideflag ;\textcolor{keywordflow}{ endif}
172   block\_til\_complete = .true.
173   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(complete)) block\_til\_complete = complete
174 
175   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo) .and. mom\_dom%thin\_halo\_updates) \textcolor{keywordflow}{then}
176     \textcolor{keyword}{call }mpp\_update\_domains(array, mom\_dom%mpp\_domain, flags=dirflag, &
177                         complete=block\_til\_complete, position=position, &
178                         whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)
179   \textcolor{keywordflow}{else}
180     \textcolor{keyword}{call }mpp\_update\_domains(array, mom\_dom%mpp\_domain, flags=dirflag, &
181                           complete=block\_til\_complete, position=position)
182 \textcolor{keywordflow}{  endif}
183 
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}
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(\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{\tt in}  & {\em id\+\_\+update} & The integer id of this update which has been returned from a previous call to \hyperlink{interfacemom__domains_1_1pass__var__start}{pass\+\_\+var\+\_\+start}.\\
\hline
\mbox{\tt in,out}  & {\em array} & The array which is having its halos points exchanged.\\
\hline
\mbox{\tt 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{\tt 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{\tt 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{\tt in}  & {\em halo} & The size of the halo to update -\/ the full halo by default.\\
\hline
\mbox{\tt 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}
400   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{intent(in)}    :: id\_update\textcolor{comment}{ !< The integer id of this update which has}
401 \textcolor{comment}{                                                    !! been returned from a previous call to}
402 \textcolor{comment}{                                                    !! pass\_var\_start.}
403   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:)},   \textcolor{keywordtype}{intent(inout)} :: array\textcolor{comment}{    !< The array which is having its halos points}
404 \textcolor{comment}{                                                    !! exchanged.}
405   \textcolor{keywordtype}{type}(mom\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: mom\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}
406 \textcolor{comment}{                                                    !! needed to determine where data should be}
407 \textcolor{comment}{                                                    !! sent.}
408   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: sideflag\textcolor{comment}{ !< An optional integer indicating which}
409 \textcolor{comment}{      !! directions the data should be sent. It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}
410 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH.  For example, TO\_EAST sends the data to the processor to the east,}
411 \textcolor{comment}{      !! so the halos on the western side are filled.  TO\_ALL is the default if sideflag is omitted.}
412   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: position\textcolor{comment}{ !< An optional argument indicating the position.}
413 \textcolor{comment}{                                                    !! This is CENTER by default and is often CORNER,}
414 \textcolor{comment}{                                                    !! but could also be EAST\_FACE or NORTH\_FACE.}
415   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}
416 \textcolor{comment}{                                                    !! halo by default.}
417   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}
418 \textcolor{comment}{                                                    !! started then stopped to time this routine.}
419 
420   \textcolor{keywordtype}{integer} :: dirflag
421 
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}
423 
424   dirflag = to\_all \textcolor{comment}{! 60}
425   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(sideflag)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (sideflag > 0) dirflag = sideflag ;\textcolor{keywordflow}{ endif}
426 
427   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo) .and. mom\_dom%thin\_halo\_updates) \textcolor{keywordflow}{then}
428     \textcolor{keyword}{call }mpp\_complete\_update\_domains(id\_update, array, mom\_dom%mpp\_domain, &
429                             flags=dirflag, position=position, &
430                             whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)
431   \textcolor{keywordflow}{else}
432     \textcolor{keyword}{call }mpp\_complete\_update\_domains(id\_update, array, mom\_dom%mpp\_domain, &
433                                      flags=dirflag, position=position)
434 \textcolor{keywordflow}{  endif}
435 
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}
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(\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{\tt in}  & {\em id\+\_\+update} & The integer id of this update which has been returned from a previous call to \hyperlink{interfacemom__domains_1_1pass__var__start}{pass\+\_\+var\+\_\+start}.\\
\hline
\mbox{\tt in,out}  & {\em array} & The array which is having its halos points exchanged.\\
\hline
\mbox{\tt 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{\tt 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{\tt 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{\tt in}  & {\em halo} & The size of the halo to update -\/ the full halo by default.\\
\hline
\mbox{\tt 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}
443   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{intent(in)}    :: id\_update\textcolor{comment}{ !< The integer id of this update which has}
444 \textcolor{comment}{                                                    !! been returned from a previous call to}
445 \textcolor{comment}{                                                    !! pass\_var\_start.}
446   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: array\textcolor{comment}{    !< The array which is having its halos points}
447 \textcolor{comment}{                                                    !! exchanged.}
448   \textcolor{keywordtype}{type}(mom\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: mom\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}
449 \textcolor{comment}{                                                    !! needed to determine where data should be}
450 \textcolor{comment}{                                                    !! sent.}
451   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: sideflag\textcolor{comment}{ !< An optional integer indicating which}
452 \textcolor{comment}{      !! directions the data should be sent. It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}
453 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH.  For example, TO\_EAST sends the data to the processor to the east,}
454 \textcolor{comment}{      !! so the halos on the western side are filled.  TO\_ALL is the default if sideflag is omitted.}
455   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: position\textcolor{comment}{ !< An optional argument indicating the position.}
456 \textcolor{comment}{                                                    !! This is CENTER by default and is often CORNER,}
457 \textcolor{comment}{                                                    !! but could also be EAST\_FACE or NORTH\_FACE.}
458   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}
459 \textcolor{comment}{                                                    !! halo by default.}
460   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}
461 \textcolor{comment}{                                                    !! started then stopped to time this routine.}
462 
463   \textcolor{keywordtype}{integer} :: dirflag
464 
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}
466 
467   dirflag = to\_all \textcolor{comment}{! 60}
468   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(sideflag)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (sideflag > 0) dirflag = sideflag ;\textcolor{keywordflow}{ endif}
469 
470   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo) .and. mom\_dom%thin\_halo\_updates) \textcolor{keywordflow}{then}
471     \textcolor{keyword}{call }mpp\_complete\_update\_domains(id\_update, array, mom\_dom%mpp\_domain, &
472                             flags=dirflag, position=position, &
473                             whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)
474   \textcolor{keywordflow}{else}
475     \textcolor{keyword}{call }mpp\_complete\_update\_domains(id\_update, array, mom\_dom%mpp\_domain, &
476                                      flags=dirflag, position=position)
477 \textcolor{keywordflow}{  endif}
478 
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}
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(\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{\tt in,out}  & {\em array} & The array which is having its halos points exchanged.\\
\hline
\mbox{\tt 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{\tt 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{\tt 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{\tt 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{\tt in}  & {\em halo} & The size of the halo to update -\/ the full halo by default.\\
\hline
\mbox{\tt 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}
310   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:)},   \textcolor{keywordtype}{intent(inout)} :: array\textcolor{comment}{    !< The array which is having its halos points}
311 \textcolor{comment}{                                                    !! exchanged.}
312   \textcolor{keywordtype}{type}(mom\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: mom\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}
313 \textcolor{comment}{                                                    !! needed to determine where data should be}
314 \textcolor{comment}{                                                    !! sent.}
315   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: sideflag\textcolor{comment}{ !< An optional integer indicating which}
316 \textcolor{comment}{      !! directions the data should be sent. It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}
317 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH.  For example, TO\_EAST sends the data to the processor to the east,}
318 \textcolor{comment}{      !! so the halos on the western side are filled.  TO\_ALL is the default if sideflag is omitted.}
319   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: position\textcolor{comment}{ !< An optional argument indicating the position.}
320 \textcolor{comment}{                                                    !! This is CENTER by default and is often CORNER,}
321 \textcolor{comment}{                                                    !! but could also be EAST\_FACE or NORTH\_FACE.}
322   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: complete\textcolor{comment}{ !< An optional argument indicating whether the}
323 \textcolor{comment}{                                                    !! halo updates should be completed before}
324 \textcolor{comment}{                                                    !! progress resumes.  Omitting complete is the}
325 \textcolor{comment}{                                                    !! same as setting complete to .true.}
326   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}
327 \textcolor{comment}{                                                    !! halo by default.}
328   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}
329 \textcolor{comment}{                                                    !! started then stopped to time this routine.}
330   \textcolor{keywordtype}{integer}                               :: pass\_var\_start\_2d\textcolor{comment}{  !<The integer index for this update.}
331 
332   \textcolor{keywordtype}{integer} :: dirflag
333 
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}
335 
336   dirflag = to\_all \textcolor{comment}{! 60}
337   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(sideflag)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (sideflag > 0) dirflag = sideflag ;\textcolor{keywordflow}{ endif}
338 
339   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo) .and. mom\_dom%thin\_halo\_updates) \textcolor{keywordflow}{then}
340     pass\_var\_start\_2d = mpp\_start\_update\_domains(array, mom\_dom%mpp\_domain, &
341                             flags=dirflag, position=position, &
342                             whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)
343   \textcolor{keywordflow}{else}
344     pass\_var\_start\_2d = mpp\_start\_update\_domains(array, mom\_dom%mpp\_domain, &
345                             flags=dirflag, position=position)
346 \textcolor{keywordflow}{  endif}
347 
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}
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(\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{\tt in,out}  & {\em array} & The array which is having its halos points exchanged.\\
\hline
\mbox{\tt 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{\tt 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{\tt 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{\tt 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{\tt in}  & {\em halo} & The size of the halo to update -\/ the full halo by default.\\
\hline
\mbox{\tt 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}
355   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: array\textcolor{comment}{    !< The array which is having its halos points}
356 \textcolor{comment}{                                                    !! exchanged.}
357   \textcolor{keywordtype}{type}(mom\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: mom\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}
358 \textcolor{comment}{                                                    !! needed to determine where data should be}
359 \textcolor{comment}{                                                    !! sent.}
360   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: sideflag\textcolor{comment}{ !< An optional integer indicating which}
361 \textcolor{comment}{      !! directions the data should be sent. It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}
362 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH.  For example, TO\_EAST sends the data to the processor to the east,}
363 \textcolor{comment}{      !! so the halos on the western side are filled.  TO\_ALL is the default if sideflag is omitted.}
364   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: position\textcolor{comment}{ !< An optional argument indicating the position.}
365 \textcolor{comment}{                                                    !! This is CENTER by default and is often CORNER,}
366 \textcolor{comment}{                                                    !! but could also be EAST\_FACE or NORTH\_FACE.}
367   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: complete\textcolor{comment}{ !< An optional argument indicating whether the}
368 \textcolor{comment}{                                                    !! halo updates should be completed before}
369 \textcolor{comment}{                                                    !! progress resumes.  Omitting complete is the}
370 \textcolor{comment}{                                                    !! same as setting complete to .true.}
371   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}
372 \textcolor{comment}{                                                    !! halo by default.}
373   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}
374 \textcolor{comment}{                                                    !! started then stopped to time this routine.}
375   \textcolor{keywordtype}{integer}                               :: pass\_var\_start\_3d\textcolor{comment}{  !< The integer index for this update.}
376 
377   \textcolor{keywordtype}{integer} :: dirflag
378 
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}
380 
381   dirflag = to\_all \textcolor{comment}{! 60}
382   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(sideflag)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (sideflag > 0) dirflag = sideflag ;\textcolor{keywordflow}{ endif}
383 
384   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo) .and. mom\_dom%thin\_halo\_updates) \textcolor{keywordflow}{then}
385     pass\_var\_start\_3d = mpp\_start\_update\_domains(array, mom\_dom%mpp\_domain, &
386                             flags=dirflag, position=position, &
387                             whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)
388   \textcolor{keywordflow}{else}
389     pass\_var\_start\_3d = mpp\_start\_update\_domains(array, mom\_dom%mpp\_domain, &
390                             flags=dirflag, position=position)
391 \textcolor{keywordflow}{  endif}
392 
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}
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(\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{\tt in,out}  & {\em u\+\_\+cmpt} & The nominal zonal (u) component of the vector pair which is having its halos points exchanged.\\
\hline
\mbox{\tt in,out}  & {\em v\+\_\+cmpt} & The nominal meridional (v) component of the vector pair which is having its halos points exchanged.\\
\hline
\mbox{\tt 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{\tt 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{\tt 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{\tt 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{\tt in}  & {\em halo} & The size of the halo to update -\/ the full halo by default.\\
\hline
\mbox{\tt 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}
487   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:)},  \textcolor{keywordtype}{intent(inout)} :: u\_cmpt\textcolor{comment}{    !< The nominal zonal (u) component of the vector}
488 \textcolor{comment}{                                                    !! pair which is having its halos points}
489 \textcolor{comment}{                                                    !! exchanged.}
490   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:)},  \textcolor{keywordtype}{intent(inout)} :: v\_cmpt\textcolor{comment}{    !< The nominal meridional (v) component of the}
491 \textcolor{comment}{                                                    !! vector pair which is having its halos points}
492 \textcolor{comment}{                                                    !! exchanged.}
493   \textcolor{keywordtype}{type}(mom\_domain\_type), \textcolor{keywordtype}{intent(inout)} :: mom\_dom\textcolor{comment}{   !< The MOM\_domain\_type containing the mpp\_domain}
494 \textcolor{comment}{                                                    !! needed to determine where data should be}
495 \textcolor{comment}{                                                    !! sent.}
496   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< An optional integer indicating which}
497 \textcolor{comment}{      !! directions the data should be sent.  It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}
498 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH, possibly plus SCALAR\_PAIR if these are paired non-directional}
499 \textcolor{comment}{      !! scalars discretized at the typical vector component locations.  For example, TO\_EAST sends}
500 \textcolor{comment}{      !! the data to the processor to the east, so the halos on the western side are filled. TO\_ALL}
501 \textcolor{comment}{      !! is the default if omitted.}
502   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: stagger\textcolor{comment}{   !< An optional flag, which may be one of A\_GRID,}
503 \textcolor{comment}{                     !! BGRID\_NE, or CGRID\_NE, indicating where the two components of the vector are}
504 \textcolor{comment}{                     !! discretized. Omitting stagger is the same as setting it to CGRID\_NE.}
505   \textcolor{keywordtype}{logical},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: complete\textcolor{comment}{  !< An optional argument indicating whether the}
506 \textcolor{comment}{                                     !! halo updates should be completed before progress resumes.}
507 \textcolor{comment}{                                     !! Omitting complete is the same as setting complete to .true.}
508   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{      !< The size of the halo to update - the full}
509 \textcolor{comment}{                                                    !! halo by default.}
510   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{     !< The handle for a cpu time clock that should be}
511 \textcolor{comment}{                                                    !! started then stopped to time this routine.}
512 
513   \textcolor{comment}{! Local variables}
514   \textcolor{keywordtype}{integer} :: stagger\_local
515   \textcolor{keywordtype}{integer} :: dirflag
516   \textcolor{keywordtype}{logical} :: block\_til\_complete
517 
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}
519 
520   stagger\_local = cgrid\_ne \textcolor{comment}{! Default value for type of grid}
521   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stagger)) stagger\_local = stagger
522 
523   dirflag = to\_all \textcolor{comment}{! 60}
524   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(direction)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (direction > 0) dirflag = direction ;\textcolor{keywordflow}{ endif}
525   block\_til\_complete = .true.
526   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(complete)) block\_til\_complete = complete
527 
528   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo) .and. mom\_dom%thin\_halo\_updates) \textcolor{keywordflow}{then}
529     \textcolor{keyword}{call }mpp\_update\_domains(u\_cmpt, v\_cmpt, mom\_dom%mpp\_domain, flags=dirflag, &
530                    gridtype=stagger\_local, complete = block\_til\_complete, &
531                    whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)
532   \textcolor{keywordflow}{else}
533     \textcolor{keyword}{call }mpp\_update\_domains(u\_cmpt, v\_cmpt, mom\_dom%mpp\_domain, flags=dirflag, &
534                    gridtype=stagger\_local, complete = block\_til\_complete)
535 \textcolor{keywordflow}{  endif}
536 
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}
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(\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{\tt in,out}  & {\em u\+\_\+cmpt} & The nominal zonal (u) component of the vector pair which is having its halos points exchanged.\\
\hline
\mbox{\tt in,out}  & {\em v\+\_\+cmpt} & The nominal meridional (v) component of the vector pair which is having its halos points exchanged.\\
\hline
\mbox{\tt 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{\tt 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{\tt 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{\tt 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{\tt in}  & {\em halo} & The size of the halo to update -\/ the full halo by default.\\
\hline
\mbox{\tt 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}
633   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: u\_cmpt\textcolor{comment}{   !< The nominal zonal (u) component of the vector}
634 \textcolor{comment}{                                                    !! pair which is having its halos points}
635 \textcolor{comment}{                                                    !! exchanged.}
636   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: v\_cmpt\textcolor{comment}{   !< The nominal meridional (v) component of the}
637 \textcolor{comment}{                                                    !! vector pair which is having its halos points}
638 \textcolor{comment}{                                                    !! exchanged.}
639   \textcolor{keywordtype}{type}(mom\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: mom\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}
640 \textcolor{comment}{                                                    !! needed to determine where data should be}
641 \textcolor{comment}{                                                    !! sent.}
642   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< An optional integer indicating which}
643 \textcolor{comment}{      !! directions the data should be sent.  It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}
644 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH, possibly plus SCALAR\_PAIR if these are paired non-directional}
645 \textcolor{comment}{      !! scalars discretized at the typical vector component locations.  For example, TO\_EAST sends}
646 \textcolor{comment}{      !! the data to the processor to the east, so the halos on the western side are filled. TO\_ALL}
647 \textcolor{comment}{      !! is the default if omitted.}
648   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: stagger\textcolor{comment}{  !< An optional flag, which may be one of A\_GRID,}
649 \textcolor{comment}{                     !! BGRID\_NE, or CGRID\_NE, indicating where the two components of the vector are}
650 \textcolor{comment}{                     !! discretized. Omitting stagger is the same as setting it to CGRID\_NE.}
651   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: complete\textcolor{comment}{ !< An optional argument indicating whether the}
652 \textcolor{comment}{                                     !! halo updates should be completed before progress resumes.}
653 \textcolor{comment}{                                     !! Omitting complete is the same as setting complete to .true.}
654   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}
655 \textcolor{comment}{                                                    !! halo by default.}
656   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}
657 \textcolor{comment}{                                                    !! started then stopped to time this routine.}
658 
659   \textcolor{comment}{! Local variables}
660   \textcolor{keywordtype}{integer} :: stagger\_local
661   \textcolor{keywordtype}{integer} :: dirflag
662   \textcolor{keywordtype}{logical} :: block\_til\_complete
663 
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}
665 
666   stagger\_local = cgrid\_ne \textcolor{comment}{! Default value for type of grid}
667   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stagger)) stagger\_local = stagger
668 
669   dirflag = to\_all \textcolor{comment}{! 60}
670   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(direction)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (direction > 0) dirflag = direction ;\textcolor{keywordflow}{ endif}
671   block\_til\_complete = .true.
672   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(complete)) block\_til\_complete = complete
673 
674   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo) .and. mom\_dom%thin\_halo\_updates) \textcolor{keywordflow}{then}
675     \textcolor{keyword}{call }mpp\_update\_domains(u\_cmpt, v\_cmpt, mom\_dom%mpp\_domain, flags=dirflag, &
676                    gridtype=stagger\_local, complete = block\_til\_complete, &
677                    whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)
678   \textcolor{keywordflow}{else}
679     \textcolor{keyword}{call }mpp\_update\_domains(u\_cmpt, v\_cmpt, mom\_dom%mpp\_domain, flags=dirflag, &
680                    gridtype=stagger\_local, complete = block\_til\_complete)
681 \textcolor{keywordflow}{  endif}
682 
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}
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(\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{\tt in}  & {\em id\+\_\+update} & The integer id of this update which has been returned from a previous call to \hyperlink{interfacemom__domains_1_1pass__var__start}{pass\+\_\+var\+\_\+start}.\\
\hline
\mbox{\tt in,out}  & {\em u\+\_\+cmpt} & The nominal zonal (u) component of the vector pair which is having its halos points exchanged.\\
\hline
\mbox{\tt in,out}  & {\em v\+\_\+cmpt} & The nominal meridional (v) component of the vector pair which is having its halos points exchanged.\\
\hline
\mbox{\tt 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{\tt 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{\tt 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{\tt in}  & {\em halo} & The size of the halo to update -\/ the full halo by default.\\
\hline
\mbox{\tt 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}
804   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{intent(in)}    :: id\_update\textcolor{comment}{ !< The integer id of this update which has been}
805 \textcolor{comment}{                                                    !! returned from a previous call to}
806 \textcolor{comment}{                                                    !! pass\_var\_start.}
807   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:)},   \textcolor{keywordtype}{intent(inout)} :: u\_cmpt\textcolor{comment}{   !< The nominal zonal (u) component of the vector}
808 \textcolor{comment}{                                                    !! pair which is having its halos points}
809 \textcolor{comment}{                                                    !! exchanged.}
810   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:)},   \textcolor{keywordtype}{intent(inout)} :: v\_cmpt\textcolor{comment}{   !< The nominal meridional (v) component of the}
811 \textcolor{comment}{                                                    !! vector pair which is having its halos points}
812 \textcolor{comment}{                                                    !! exchanged.}
813   \textcolor{keywordtype}{type}(mom\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: mom\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}
814 \textcolor{comment}{                                                    !! needed to determine where data should be}
815 \textcolor{comment}{                                                    !! sent.}
816   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< An optional integer indicating which}
817 \textcolor{comment}{      !! directions the data should be sent.  It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}
818 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH, possibly plus SCALAR\_PAIR if these are paired non-directional}
819 \textcolor{comment}{      !! scalars discretized at the typical vector component locations.  For example, TO\_EAST sends}
820 \textcolor{comment}{      !! the data to the processor to the east, so the halos on the western side are filled. TO\_ALL}
821 \textcolor{comment}{      !! is the default if omitted.}
822   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: stagger\textcolor{comment}{  !< An optional flag, which may be one of A\_GRID,}
823 \textcolor{comment}{                     !! BGRID\_NE, or CGRID\_NE, indicating where the two components of the vector are}
824 \textcolor{comment}{                     !! discretized. Omitting stagger is the same as setting it to CGRID\_NE.}
825   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}
826 \textcolor{comment}{                                                    !! halo by default.}
827   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}
828 \textcolor{comment}{                                                    !! started then stopped to time this routine.}
829   \textcolor{comment}{! Local variables}
830   \textcolor{keywordtype}{integer} :: stagger\_local
831   \textcolor{keywordtype}{integer} :: dirflag
832 
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}
834 
835   stagger\_local = cgrid\_ne \textcolor{comment}{! Default value for type of grid}
836   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stagger)) stagger\_local = stagger
837 
838   dirflag = to\_all \textcolor{comment}{! 60}
839   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(direction)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (direction > 0) dirflag = direction ;\textcolor{keywordflow}{ endif}
840 
841   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo) .and. mom\_dom%thin\_halo\_updates) \textcolor{keywordflow}{then}
842     \textcolor{keyword}{call }mpp\_complete\_update\_domains(id\_update, u\_cmpt, v\_cmpt, &
843              mom\_dom%mpp\_domain, flags=dirflag, gridtype=stagger\_local, &
844              whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)
845   \textcolor{keywordflow}{else}
846     \textcolor{keyword}{call }mpp\_complete\_update\_domains(id\_update, u\_cmpt, v\_cmpt, &
847              mom\_dom%mpp\_domain, flags=dirflag, gridtype=stagger\_local)
848 \textcolor{keywordflow}{  endif}
849 
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}
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(\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{\tt in}  & {\em id\+\_\+update} & The integer id of this update which has been returned from a previous call to \hyperlink{interfacemom__domains_1_1pass__var__start}{pass\+\_\+var\+\_\+start}.\\
\hline
\mbox{\tt in,out}  & {\em u\+\_\+cmpt} & The nominal zonal (u) component of the vector pair which is having its halos points exchanged.\\
\hline
\mbox{\tt in,out}  & {\em v\+\_\+cmpt} & The nominal meridional (v) component of the vector pair which is having its halos points exchanged.\\
\hline
\mbox{\tt 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{\tt 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{\tt 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{\tt in}  & {\em halo} & The size of the halo to update -\/ the full halo by default.\\
\hline
\mbox{\tt 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}
858   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{intent(in)}    :: id\_update\textcolor{comment}{ !< The integer id of this update which has been}
859 \textcolor{comment}{                                                    !! returned from a previous call to}
860 \textcolor{comment}{                                                    !! pass\_var\_start.}
861   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: u\_cmpt\textcolor{comment}{   !< The nominal zonal (u) component of the vector}
862 \textcolor{comment}{                                                    !! pair which is having its halos points}
863 \textcolor{comment}{                                                    !! exchanged.}
864   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: v\_cmpt\textcolor{comment}{   !< The nominal meridional (v) component of the}
865 \textcolor{comment}{                                                    !! vector pair which is having its halos points}
866 \textcolor{comment}{                                                    !! exchanged.}
867   \textcolor{keywordtype}{type}(mom\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: mom\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}
868 \textcolor{comment}{                                                    !! needed to determine where data should be}
869 \textcolor{comment}{                                                    !! sent.}
870   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< An optional integer indicating which}
871 \textcolor{comment}{      !! directions the data should be sent.  It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}
872 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH, possibly plus SCALAR\_PAIR if these are paired non-directional}
873 \textcolor{comment}{      !! scalars discretized at the typical vector component locations.  For example, TO\_EAST sends}
874 \textcolor{comment}{      !! the data to the processor to the east, so the halos on the western side are filled. TO\_ALL}
875 \textcolor{comment}{      !! is the default if omitted.}
876   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: stagger\textcolor{comment}{  !< An optional flag, which may be one of A\_GRID,}
877 \textcolor{comment}{                     !! BGRID\_NE, or CGRID\_NE, indicating where the two components of the vector are}
878 \textcolor{comment}{                     !! discretized. Omitting stagger is the same as setting it to CGRID\_NE.}
879   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}
880 \textcolor{comment}{                                                    !! halo by default.}
881   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}
882 \textcolor{comment}{                                                    !! started then stopped to time this routine.}
883   \textcolor{comment}{! Local variables}
884   \textcolor{keywordtype}{integer} :: stagger\_local
885   \textcolor{keywordtype}{integer} :: dirflag
886 
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}
888 
889   stagger\_local = cgrid\_ne \textcolor{comment}{! Default value for type of grid}
890   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stagger)) stagger\_local = stagger
891 
892   dirflag = to\_all \textcolor{comment}{! 60}
893   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(direction)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (direction > 0) dirflag = direction ;\textcolor{keywordflow}{ endif}
894 
895   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo) .and. mom\_dom%thin\_halo\_updates) \textcolor{keywordflow}{then}
896     \textcolor{keyword}{call }mpp\_complete\_update\_domains(id\_update, u\_cmpt, v\_cmpt, &
897              mom\_dom%mpp\_domain, flags=dirflag, gridtype=stagger\_local, &
898                    whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)
899   \textcolor{keywordflow}{else}
900     \textcolor{keyword}{call }mpp\_complete\_update\_domains(id\_update, u\_cmpt, v\_cmpt, &
901              mom\_dom%mpp\_domain, flags=dirflag, gridtype=stagger\_local)
902 \textcolor{keywordflow}{  endif}
903 
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}
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(\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{\tt in,out}  & {\em u\+\_\+cmpt} & The nominal zonal (u) component of the vector pair which is having its halos points exchanged.\\
\hline
\mbox{\tt in,out}  & {\em v\+\_\+cmpt} & The nominal meridional (v) component of the vector pair which is having its halos points exchanged.\\
\hline
\mbox{\tt 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{\tt 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{\tt 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{\tt 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{\tt in}  & {\em halo} & The size of the halo to update -\/ the full halo by default.\\
\hline
\mbox{\tt 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}
691   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:)},   \textcolor{keywordtype}{intent(inout)} :: u\_cmpt\textcolor{comment}{   !< The nominal zonal (u) component of the vector}
692 \textcolor{comment}{                                                    !! pair which is having its halos points}
693 \textcolor{comment}{                                                    !! exchanged.}
694   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:)},   \textcolor{keywordtype}{intent(inout)} :: v\_cmpt\textcolor{comment}{   !< The nominal meridional (v) component of the}
695 \textcolor{comment}{                                                    !! vector pair which is having its halos points}
696 \textcolor{comment}{                                                    !! exchanged.}
697   \textcolor{keywordtype}{type}(mom\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: mom\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}
698 \textcolor{comment}{                                                    !! needed to determine where data should be}
699 \textcolor{comment}{                                                    !! sent.}
700   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< An optional integer indicating which}
701 \textcolor{comment}{      !! directions the data should be sent.  It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}
702 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH, possibly plus SCALAR\_PAIR if these are paired non-directional}
703 \textcolor{comment}{      !! scalars discretized at the typical vector component locations.  For example, TO\_EAST sends}
704 \textcolor{comment}{      !! the data to the processor to the east, so the halos on the western side are filled. TO\_ALL}
705 \textcolor{comment}{      !! is the default if omitted.}
706   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: stagger\textcolor{comment}{  !< An optional flag, which may be one of A\_GRID,}
707 \textcolor{comment}{                     !! BGRID\_NE, or CGRID\_NE, indicating where the two components of the vector are}
708 \textcolor{comment}{                     !! discretized. Omitting stagger is the same as setting it to CGRID\_NE.}
709   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: complete\textcolor{comment}{ !< An optional argument indicating whether the}
710 \textcolor{comment}{                                     !! halo updates should be completed before progress resumes.}
711 \textcolor{comment}{                                     !! Omitting complete is the same as setting complete to .true.}
712   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}
713 \textcolor{comment}{                                                    !! halo by default.}
714   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}
715 \textcolor{comment}{                                                    !! started then stopped to time this routine.}
716   \textcolor{keywordtype}{integer}                               :: pass\_vector\_start\_2d\textcolor{comment}{ !< The integer index for this}
717 \textcolor{comment}{                                                                !! update.}
718 
719   \textcolor{comment}{! Local variables}
720   \textcolor{keywordtype}{integer} :: stagger\_local
721   \textcolor{keywordtype}{integer} :: dirflag
722 
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}
724 
725   stagger\_local = cgrid\_ne \textcolor{comment}{! Default value for type of grid}
726   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stagger)) stagger\_local = stagger
727 
728   dirflag = to\_all \textcolor{comment}{! 60}
729   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(direction)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (direction > 0) dirflag = direction ;\textcolor{keywordflow}{ endif}
730 
731   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo) .and. mom\_dom%thin\_halo\_updates) \textcolor{keywordflow}{then}
732     pass\_vector\_start\_2d = mpp\_start\_update\_domains(u\_cmpt, v\_cmpt, &
733         mom\_dom%mpp\_domain, flags=dirflag, gridtype=stagger\_local, &
734         whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)
735   \textcolor{keywordflow}{else}
736     pass\_vector\_start\_2d = mpp\_start\_update\_domains(u\_cmpt, v\_cmpt, &
737         mom\_dom%mpp\_domain, flags=dirflag, gridtype=stagger\_local)
738 \textcolor{keywordflow}{  endif}
739 
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}
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(\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{\tt in,out}  & {\em u\+\_\+cmpt} & The nominal zonal (u) component of the vector pair which is having its halos points exchanged.\\
\hline
\mbox{\tt in,out}  & {\em v\+\_\+cmpt} & The nominal meridional (v) component of the vector pair which is having its halos points exchanged.\\
\hline
\mbox{\tt 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{\tt 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{\tt 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{\tt 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{\tt in}  & {\em halo} & The size of the halo to update -\/ the full halo by default.\\
\hline
\mbox{\tt 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}
748   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: u\_cmpt\textcolor{comment}{   !< The nominal zonal (u) component of the vector}
749 \textcolor{comment}{                                                    !! pair which is having its halos points}
750 \textcolor{comment}{                                                    !! exchanged.}
751   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: v\_cmpt\textcolor{comment}{   !< The nominal meridional (v) component of the}
752 \textcolor{comment}{                                                    !! vector pair which is having its halos points}
753 \textcolor{comment}{                                                    !! exchanged.}
754   \textcolor{keywordtype}{type}(mom\_domain\_type),  \textcolor{keywordtype}{intent(inout)} :: mom\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}
755 \textcolor{comment}{                                                    !! needed to determine where data should be}
756 \textcolor{comment}{                                                    !! sent.}
757   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< An optional integer indicating which}
758 \textcolor{comment}{      !! directions the data should be sent.  It is TO\_ALL or the sum of any of TO\_EAST, TO\_WEST,}
759 \textcolor{comment}{      !! TO\_NORTH, and TO\_SOUTH, possibly plus SCALAR\_PAIR if these are paired non-directional}
760 \textcolor{comment}{      !! scalars discretized at the typical vector component locations.  For example, TO\_EAST sends}
761 \textcolor{comment}{      !! the data to the processor to the east, so the halos on the western side are filled. TO\_ALL}
762 \textcolor{comment}{      !! is the default if omitted.}
763   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: stagger\textcolor{comment}{  !< An optional flag, which may be one of A\_GRID,}
764 \textcolor{comment}{                     !! BGRID\_NE, or CGRID\_NE, indicating where the two components of the vector are}
765 \textcolor{comment}{                     !! discretized. Omitting stagger is the same as setting it to CGRID\_NE.}
766   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: complete\textcolor{comment}{ !< An optional argument indicating whether the}
767 \textcolor{comment}{                                     !! halo updates should be completed before progress resumes.}
768 \textcolor{comment}{                                     !! Omitting complete is the same as setting complete to .true.}
769   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halo\textcolor{comment}{     !< The size of the halo to update - the full}
770 \textcolor{comment}{                                                    !! halo by default.}
771   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}
772 \textcolor{comment}{                                                    !! started then stopped to time this routine.}
773   \textcolor{keywordtype}{integer}                               :: pass\_vector\_start\_3d\textcolor{comment}{ !< The integer index for this}
774 \textcolor{comment}{                                                                !! update.}
775   \textcolor{comment}{! Local variables}
776   \textcolor{keywordtype}{integer} :: stagger\_local
777   \textcolor{keywordtype}{integer} :: dirflag
778 
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}
780 
781   stagger\_local = cgrid\_ne \textcolor{comment}{! Default value for type of grid}
782   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stagger)) stagger\_local = stagger
783 
784   dirflag = to\_all \textcolor{comment}{! 60}
785   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(direction)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (direction > 0) dirflag = direction ;\textcolor{keywordflow}{ endif}
786 
787   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(halo) .and. mom\_dom%thin\_halo\_updates) \textcolor{keywordflow}{then}
788     pass\_vector\_start\_3d = mpp\_start\_update\_domains(u\_cmpt, v\_cmpt, &
789         mom\_dom%mpp\_domain, flags=dirflag, gridtype=stagger\_local, &
790         whalo=halo, ehalo=halo, shalo=halo, nhalo=halo)
791   \textcolor{keywordflow}{else}
792     pass\_vector\_start\_3d = mpp\_start\_update\_domains(u\_cmpt, v\_cmpt, &
793         mom\_dom%mpp\_domain, flags=dirflag, gridtype=stagger\_local)
794 \textcolor{keywordflow}{  endif}
795 
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}
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(\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{\tt in,out}  & {\em group} & The data type that store information for group update. This data will be used in do\+\_\+group\+\_\+pass.\\
\hline
\mbox{\tt 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{\tt 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}
1133   \textcolor{keywordtype}{type}(group\_pass\_type), \textcolor{keywordtype}{intent(inout)} :: group\textcolor{comment}{    !< The data type that store information for}
1134 \textcolor{comment}{                                                   !! group update. This data will be used in}
1135 \textcolor{comment}{                                                   !! do\_group\_pass.}
1136   \textcolor{keywordtype}{type}(mom\_domain\_type), \textcolor{keywordtype}{intent(inout)} :: mom\_dom\textcolor{comment}{  !< The MOM\_domain\_type containing the mpp\_domain}
1137 \textcolor{comment}{                                                   !! needed to determine where data should be}
1138 \textcolor{comment}{                                                   !! sent.}
1139   \textcolor{keywordtype}{integer},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: clock\textcolor{comment}{    !< The handle for a cpu time clock that should be}
1140 \textcolor{comment}{                                                   !! started then stopped to time this routine.}
1141 
1142   \textcolor{keywordtype}{real}                                 :: d\_type
1143 
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}
1145 
1146   \textcolor{keyword}{call }mpp\_start\_group\_update(group, mom\_dom%mpp\_domain, d\_type)
1147 
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}
1149 
\end{DoxyCode}
