\hypertarget{interfacemom__domains_1_1pass__var}{}\doxysection{mom\+\_\+domains\+::pass\+\_\+var Interface Reference}
\label{interfacemom__domains_1_1pass__var}\index{mom\_domains::pass\_var@{mom\_domains::pass\_var}}


\doxysubsection{Detailed Description}
Do a halo update on an array. 

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

\doxysubsection*{Private functions}
\begin{DoxyCompactItemize}
\item 
subroutine \mbox{\hyperlink{interfacemom__domains_1_1pass__var_ac91dc3915b4999782029df09b18efe17}{pass\+\_\+var\+\_\+3d}} (array, M\+O\+M\+\_\+dom, sideflag, complete, position, halo, clock)
\begin{DoxyCompactList}\small\item\em pass\+\_\+var\+\_\+3d does a halo update for a three-\/dimensional array. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{interfacemom__domains_1_1pass__var_a2314f1186126f7f9a0cdd2d30fdbe81b}{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}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Do a halo update on an array. 

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



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



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


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


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


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

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



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


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


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


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

\end{DoxyCode}


The documentation for this interface was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
/home/cermak/src/\+M\+O\+M6.\+devrob/src/framework/M\+O\+M\+\_\+domains.\+F90\end{DoxyCompactItemize}
