\hypertarget{interfacemom__checksums_1_1uchksum}{}\doxysection{mom\+\_\+checksums\+::uchksum Interface Reference}
\label{interfacemom__checksums_1_1uchksum}\index{mom\_checksums::uchksum@{mom\_checksums::uchksum}}


\doxysubsection{Detailed Description}
Checksums an array (2d or 3d) staggered at C-\/grid u points. 

Definition at line 34 of file M\+O\+M\+\_\+checksums.\+F90.

\doxysubsection*{Private functions}
\begin{DoxyCompactItemize}
\item 
subroutine \mbox{\hyperlink{interfacemom__checksums_1_1uchksum_adddc2d74992684e0e1fe9134fd350a32}{chksum\+\_\+u\+\_\+2d}} (array\+\_\+m, mesg, H\+I\+\_\+m, haloshift, symmetric, omit\+\_\+corners, scale, logunit)
\begin{DoxyCompactList}\small\item\em Checksums a 2d array staggered at C-\/grid u points. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{interfacemom__checksums_1_1uchksum_a68d90a17a90b5b1fa898066ef562533a}{chksum\+\_\+u\+\_\+3d}} (array\+\_\+m, mesg, H\+I\+\_\+m, haloshift, symmetric, omit\+\_\+corners, scale, logunit)
\begin{DoxyCompactList}\small\item\em Checksums a 3d array staggered at C-\/grid u points. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Checksums an array (2d or 3d) staggered at C-\/grid u points. 

Definition at line 34 of file M\+O\+M\+\_\+checksums.\+F90.



\doxysubsection{Functions and subroutines}
\mbox{\Hypertarget{interfacemom__checksums_1_1uchksum_adddc2d74992684e0e1fe9134fd350a32}\label{interfacemom__checksums_1_1uchksum_adddc2d74992684e0e1fe9134fd350a32}} 
\index{mom\_checksums::uchksum@{mom\_checksums::uchksum}!chksum\_u\_2d@{chksum\_u\_2d}}
\index{chksum\_u\_2d@{chksum\_u\_2d}!mom\_checksums::uchksum@{mom\_checksums::uchksum}}
\doxysubsubsection{\texorpdfstring{chksum\_u\_2d()}{chksum\_u\_2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+checksums\+::uchksum\+::chksum\+\_\+u\+\_\+2d (\begin{DoxyParamCaption}\item[{real, dimension(hi\+\_\+m\%isdb\+:,hi\+\_\+m\%jsd\+:), intent(in), target}]{array\+\_\+m,  }\item[{character(len=$\ast$), intent(in)}]{mesg,  }\item[{type(hor\+\_\+index\+\_\+type), intent(in), target}]{H\+I\+\_\+m,  }\item[{integer, intent(in), optional}]{haloshift,  }\item[{logical, intent(in), optional}]{symmetric,  }\item[{logical, intent(in), optional}]{omit\+\_\+corners,  }\item[{real, intent(in), optional}]{scale,  }\item[{integer, intent(in), optional}]{logunit }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Checksums a 2d array staggered at C-\/grid u points. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em hi\+\_\+m} & A horizontal index type \\
\hline
\mbox{\texttt{ in}}  & {\em array\+\_\+m} & The array to be checksummed \\
\hline
\mbox{\texttt{ in}}  & {\em mesg} & An identifying message \\
\hline
\mbox{\texttt{ in}}  & {\em haloshift} & The width of halos to check (default 0) \\
\hline
\mbox{\texttt{ in}}  & {\em symmetric} & If true, do the checksums on the full symmetric computational domain. \\
\hline
\mbox{\texttt{ in}}  & {\em omit\+\_\+corners} & If true, avoid checking diagonal shifts \\
\hline
\mbox{\texttt{ in}}  & {\em scale} & A scaling factor for this array. \\
\hline
\mbox{\texttt{ in}}  & {\em logunit} & IO unit for checksum logging \\
\hline
\end{DoxyParams}


Definition at line 845 of file M\+O\+M\+\_\+checksums.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{847   \textcolor{keywordtype}{type}(hor\_index\_type),  \textcolor{keywordtype}{target},   \textcolor{keywordtype}{intent(in)} :: HI\_m\textcolor{comment}{     !< A horizontal index type}}
\DoxyCodeLine{848 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(HI\_m\%IsdB:,HI\_m\%jsd:)}, \textcolor{keywordtype}{target}, \textcolor{keywordtype}{intent(in)} :: array\_m\textcolor{comment}{ !< The array to be checksummed}}
\DoxyCodeLine{849   \textcolor{keywordtype}{character(len=*)},                \textcolor{keywordtype}{intent(in)} :: mesg\textcolor{comment}{  !< An identifying message}}
\DoxyCodeLine{850   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: haloshift\textcolor{comment}{ !< The width of halos to check (default 0)}}
\DoxyCodeLine{851   \textcolor{keywordtype}{logical},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: symmetric\textcolor{comment}{ !< If true, do the checksums on the full}}
\DoxyCodeLine{852 \textcolor{comment}{                                                           !! symmetric computational domain.}}
\DoxyCodeLine{853   \textcolor{keywordtype}{logical},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: omit\_corners\textcolor{comment}{ !< If true, avoid checking diagonal shifts}}
\DoxyCodeLine{854 \textcolor{keywordtype}{  real},                    \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: scale\textcolor{comment}{     !< A scaling factor for this array.}}
\DoxyCodeLine{855   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: logunit\textcolor{comment}{ !< IO unit for checksum logging}}
\DoxyCodeLine{856 }
\DoxyCodeLine{857 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{pointer} :: array(:,:)           \textcolor{comment}{! Field array on the input grid}}
\DoxyCodeLine{858 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{dimension(:,:)} :: rescaled\_array}
\DoxyCodeLine{859   \textcolor{keywordtype}{type}(hor\_index\_type), \textcolor{keywordtype}{pointer} :: HI   \textcolor{comment}{! Horizontal index bounds of the input grid}}
\DoxyCodeLine{860 \textcolor{keywordtype}{  real} :: scaling}
\DoxyCodeLine{861   \textcolor{keywordtype}{integer} :: iounit\textcolor{comment}{ !< Log IO unit}}
\DoxyCodeLine{862   \textcolor{keywordtype}{integer} :: i, j, Is}
\DoxyCodeLine{863 \textcolor{keywordtype}{  real} :: aMean, aMin, aMax}
\DoxyCodeLine{864   \textcolor{keywordtype}{integer} :: bc0, bcSW, bcSE, bcNW, bcNE, hshift}
\DoxyCodeLine{865   \textcolor{keywordtype}{integer} :: bcN, bcS, bcE, bcW}
\DoxyCodeLine{866   \textcolor{keywordtype}{logical} :: do\_corners, sym, sym\_stats}
\DoxyCodeLine{867   \textcolor{keywordtype}{integer} :: turns                      \textcolor{comment}{! Quarter turns from input to model grid}}
\DoxyCodeLine{868 }
\DoxyCodeLine{869   \textcolor{comment}{! Rotate array to the input grid}}
\DoxyCodeLine{870   turns = hi\_m\%turns}
\DoxyCodeLine{871   \textcolor{keywordflow}{if} (modulo(turns, 4) /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{872     \textcolor{keyword}{allocate}(hi)}
\DoxyCodeLine{873     \textcolor{keyword}{call }rotate\_hor\_index(hi\_m, -\/turns, hi)}
\DoxyCodeLine{874     \textcolor{keywordflow}{if} (modulo(turns, 2) /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{875       \textcolor{comment}{! Arrays originating from v-\/points must be handled by vchksum}}
\DoxyCodeLine{876       \textcolor{keyword}{allocate}(array(hi\%isd:hi\%ied, hi\%JsdB:hi\%JedB))}
\DoxyCodeLine{877       \textcolor{keyword}{call }rotate\_array(array\_m, -\/turns, array)}
\DoxyCodeLine{878       \textcolor{keyword}{call }vchksum(array, mesg, hi, haloshift, symmetric, omit\_corners, scale, logunit)}
\DoxyCodeLine{879       \textcolor{keywordflow}{return}}
\DoxyCodeLine{880     \textcolor{keywordflow}{else}}
\DoxyCodeLine{881       \textcolor{keyword}{allocate}(array(hi\%IsdB:hi\%IedB, hi\%jsd:hi\%jed))}
\DoxyCodeLine{882       \textcolor{keyword}{call }rotate\_array(array\_m, -\/turns, array)}
\DoxyCodeLine{883 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{884   \textcolor{keywordflow}{else}}
\DoxyCodeLine{885     hi => hi\_m}
\DoxyCodeLine{886     array => array\_m}
\DoxyCodeLine{887 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{888 }
\DoxyCodeLine{889   \textcolor{keywordflow}{if} (checkfornans) \textcolor{keywordflow}{then}}
\DoxyCodeLine{890     \textcolor{keywordflow}{if} (is\_nan(array(hi\%IscB:hi\%IecB,hi\%jsc:hi\%jec))) \&}
\DoxyCodeLine{891       \textcolor{keyword}{call }chksum\_error(fatal, \textcolor{stringliteral}{'NaN detected: '}//trim(mesg))}
\DoxyCodeLine{892 \textcolor{comment}{!   if (is\_NaN(array)) \&}}
\DoxyCodeLine{893 \textcolor{comment}{!     call chksum\_error(FATAL, 'NaN detected in halo: '//trim(mesg))}}
\DoxyCodeLine{894 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{895 }
\DoxyCodeLine{896   scaling = 1.0 ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) scaling = scale}
\DoxyCodeLine{897   iounit = error\_unit; \textcolor{keywordflow}{if}(\textcolor{keyword}{present}(logunit)) iounit = logunit}
\DoxyCodeLine{898   sym\_stats = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(symmetric)) sym\_stats = symmetric}
\DoxyCodeLine{899   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(haloshift)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (haloshift > 0) sym\_stats = .true. ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{900 }
\DoxyCodeLine{901   \textcolor{keywordflow}{if} (calculatestatistics) \textcolor{keywordflow}{then}}
\DoxyCodeLine{902     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{903       \textcolor{keyword}{allocate}( rescaled\_array(lbound(array,1):ubound(array,1), \&}
\DoxyCodeLine{904                                lbound(array,2):ubound(array,2)) )}
\DoxyCodeLine{905       rescaled\_array(:,:) = 0.0}
\DoxyCodeLine{906       is = hi\%isc ; \textcolor{keywordflow}{if} (sym\_stats) is = hi\%isc-\/1}
\DoxyCodeLine{907       \textcolor{keywordflow}{do} j=hi\%jsc,hi\%jec ; \textcolor{keywordflow}{do} i=is,hi\%IecB}
\DoxyCodeLine{908         rescaled\_array(i,j) = scale*array(i,j)}
\DoxyCodeLine{909 \textcolor{keywordflow}{      enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{910       \textcolor{keyword}{call }substats(hi, rescaled\_array, sym\_stats, amean, amin, amax)}
\DoxyCodeLine{911       \textcolor{keyword}{deallocate}(rescaled\_array)}
\DoxyCodeLine{912     \textcolor{keywordflow}{else}}
\DoxyCodeLine{913       \textcolor{keyword}{call }substats(hi, array, sym\_stats, amean, amin, amax)}
\DoxyCodeLine{914 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{915 }
\DoxyCodeLine{916     \textcolor{keywordflow}{if} (is\_root\_pe()) \&}
\DoxyCodeLine{917       \textcolor{keyword}{call }chk\_sum\_msg(\textcolor{stringliteral}{"u-\/point:"}, amean, amin, amax, mesg, iounit)}
\DoxyCodeLine{918 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{919 }
\DoxyCodeLine{920   \textcolor{keywordflow}{if} (.not.writechksums) \textcolor{keywordflow}{return}}
\DoxyCodeLine{921 }
\DoxyCodeLine{922   hshift = default\_shift}
\DoxyCodeLine{923   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(haloshift)) hshift = haloshift}
\DoxyCodeLine{924   \textcolor{keywordflow}{if} (hshift<0) hshift = hi\%iedB-\/hi\%iecB}
\DoxyCodeLine{925 }
\DoxyCodeLine{926   \textcolor{keywordflow}{if} ( hi\%iscB-\/hshift<hi\%isdB .or. hi\%iecB+hshift>hi\%iedB .or. \&}
\DoxyCodeLine{927        hi\%jsc-\/hshift<hi\%jsd .or. hi\%jec+hshift>hi\%jed ) \textcolor{keywordflow}{then}}
\DoxyCodeLine{928     \textcolor{keyword}{write}(0,*) \textcolor{stringliteral}{'chksum\_u\_2d: haloshift ='},hshift}
\DoxyCodeLine{929     \textcolor{keyword}{write}(0,*) \textcolor{stringliteral}{'chksum\_u\_2d: isd,isc,iec,ied='},hi\%isdB,hi\%iscB,hi\%iecB,hi\%iedB}
\DoxyCodeLine{930     \textcolor{keyword}{write}(0,*) \textcolor{stringliteral}{'chksum\_u\_2d: jsd,jsc,jec,jed='},hi\%jsd,hi\%jsc,hi\%jec,hi\%jed}
\DoxyCodeLine{931     \textcolor{keyword}{call }chksum\_error(fatal,\textcolor{stringliteral}{'Error in chksum\_u\_2d '}//trim(mesg))}
\DoxyCodeLine{932 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{933 }
\DoxyCodeLine{934   bc0 = subchk(array, hi, 0, 0, scaling)}
\DoxyCodeLine{935 }
\DoxyCodeLine{936   sym = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(symmetric)) sym = symmetric}
\DoxyCodeLine{937 }
\DoxyCodeLine{938   \textcolor{keywordflow}{if} ((hshift==0) .and. .not.sym) \textcolor{keywordflow}{then}}
\DoxyCodeLine{939     \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keyword}{call }chk\_sum\_msg(\textcolor{stringliteral}{"u-\/point:"}, bc0, mesg, iounit)}
\DoxyCodeLine{940     \textcolor{keywordflow}{return}}
\DoxyCodeLine{941 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{942 }
\DoxyCodeLine{943   do\_corners = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(omit\_corners)) do\_corners = .not.omit\_corners}
\DoxyCodeLine{944 }
\DoxyCodeLine{945   \textcolor{keywordflow}{if} (hshift==0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{946     bcw = subchk(array, hi, -\/hshift-\/1, 0, scaling)}
\DoxyCodeLine{947     \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keyword}{call }chk\_sum\_msg\_w(\textcolor{stringliteral}{"u-\/point:"}, bc0, bcw, mesg, iounit)}
\DoxyCodeLine{948   \textcolor{keywordflow}{elseif} (do\_corners) \textcolor{keywordflow}{then}}
\DoxyCodeLine{949     \textcolor{keywordflow}{if} (sym) \textcolor{keywordflow}{then}}
\DoxyCodeLine{950       bcsw = subchk(array, hi, -\/hshift-\/1, -\/hshift, scaling)}
\DoxyCodeLine{951       bcnw = subchk(array, hi, -\/hshift-\/1, hshift, scaling)}
\DoxyCodeLine{952     \textcolor{keywordflow}{else}}
\DoxyCodeLine{953       bcsw = subchk(array, hi, -\/hshift, -\/hshift, scaling)}
\DoxyCodeLine{954       bcnw = subchk(array, hi, -\/hshift, hshift, scaling)}
\DoxyCodeLine{955 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{956     bcse = subchk(array, hi, hshift, -\/hshift, scaling)}
\DoxyCodeLine{957     bcne = subchk(array, hi, hshift, hshift, scaling)}
\DoxyCodeLine{958 }
\DoxyCodeLine{959     \textcolor{keywordflow}{if} (is\_root\_pe()) \&}
\DoxyCodeLine{960       \textcolor{keyword}{call }chk\_sum\_msg(\textcolor{stringliteral}{"u-\/point:"}, bc0, bcsw, bcse, bcnw, bcne, mesg, iounit)}
\DoxyCodeLine{961   \textcolor{keywordflow}{else}}
\DoxyCodeLine{962     bcs = subchk(array, hi, 0, -\/hshift, scaling)}
\DoxyCodeLine{963     bce = subchk(array, hi, hshift, 0, scaling)}
\DoxyCodeLine{964     \textcolor{keywordflow}{if} (sym) \textcolor{keywordflow}{then}}
\DoxyCodeLine{965       bcw = subchk(array, hi, -\/hshift-\/1, 0, scaling)}
\DoxyCodeLine{966     \textcolor{keywordflow}{else}}
\DoxyCodeLine{967       bcw = subchk(array, hi, -\/hshift, 0, scaling)}
\DoxyCodeLine{968 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{969     bcn = subchk(array, hi, 0, hshift, scaling)}
\DoxyCodeLine{970 }
\DoxyCodeLine{971     \textcolor{keywordflow}{if} (is\_root\_pe()) \&}
\DoxyCodeLine{972       \textcolor{keyword}{call }chk\_sum\_msg\_nsew(\textcolor{stringliteral}{"u-\/point:"}, bc0, bcn, bcs, bce, bcw, mesg, iounit)}
\DoxyCodeLine{973 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{974 }
\DoxyCodeLine{975   \textcolor{keyword}{contains}}
\DoxyCodeLine{976 }
\DoxyCodeLine{977   \textcolor{keyword}{integer }\textcolor{keyword}{function }subchk(array, HI, di, dj, scale)}
\DoxyCodeLine{978     \textcolor{keywordtype}{type}(hor\_index\_type), \textcolor{keywordtype}{intent(in)} ::  HI\textcolor{comment}{     !< A horizontal index type}}
\DoxyCodeLine{979 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{dimension(HI\%IsdB:,HI\%jsd:)}, \textcolor{keywordtype}{intent(in)} :: array\textcolor{comment}{ !< The array to be checksummed}}
\DoxyCodeLine{980     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: di\textcolor{comment}{    !< i-\/ direction array shift for this checksum}}
\DoxyCodeLine{981     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: dj\textcolor{comment}{    !< j-\/ direction array shift for this checksum}}
\DoxyCodeLine{982 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{intent(in)}    :: scale\textcolor{comment}{ !< A scaling factor for this array.}}
\DoxyCodeLine{983     \textcolor{keywordtype}{integer} :: i, j, bc}
\DoxyCodeLine{984     subchk = 0}
\DoxyCodeLine{985     \textcolor{comment}{! This line deliberately uses the h-\/point computational domain.}}
\DoxyCodeLine{986     \textcolor{keywordflow}{do} j=hi\%jsc+dj,hi\%jec+dj; \textcolor{keywordflow}{do} i=hi\%isc+di,hi\%iec+di}
\DoxyCodeLine{987       bc = bitcount(abs(scale*array(i,j)))}
\DoxyCodeLine{988       subchk = subchk + bc}
\DoxyCodeLine{989 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{990     \textcolor{keyword}{call }sum\_across\_pes(subchk)}
\DoxyCodeLine{991     subchk=mod(subchk, bc\_modulus)}
\DoxyCodeLine{992   \textcolor{keyword}{end function }subchk}
\DoxyCodeLine{993 }
\DoxyCodeLine{994   \textcolor{keyword}{subroutine }substats(HI, array, sym\_stats, aMean, aMin, aMax)}
\DoxyCodeLine{995     \textcolor{keywordtype}{type}(hor\_index\_type), \textcolor{keywordtype}{intent(in)} ::  HI\textcolor{comment}{     !< A horizontal index type}}
\DoxyCodeLine{996 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{dimension(HI\%IsdB:,HI\%jsd:)}, \textcolor{keywordtype}{intent(in)} :: array\textcolor{comment}{ !< The array to be checksummed}}
\DoxyCodeLine{997     \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{intent(in)} :: sym\_stats\textcolor{comment}{ !< If true, evaluate the statistics on the}}
\DoxyCodeLine{998 \textcolor{comment}{                                              !! full symmetric computational domain.}}
\DoxyCodeLine{999 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{intent(out)} :: aMean\textcolor{comment}{ !< Array mean}}
\DoxyCodeLine{1000 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{intent(out)} :: aMin\textcolor{comment}{ !< Array minimum}}
\DoxyCodeLine{1001 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{intent(out)} :: aMax\textcolor{comment}{ !< Array maximum}}
\DoxyCodeLine{1002 }
\DoxyCodeLine{1003     \textcolor{keywordtype}{integer} :: i, j, n, IsB}
\DoxyCodeLine{1004 }
\DoxyCodeLine{1005     isb = hi\%isc ; \textcolor{keywordflow}{if} (sym\_stats) isb = hi\%isc-\/1}
\DoxyCodeLine{1006 }
\DoxyCodeLine{1007     amin = array(hi\%isc,hi\%jsc) ; amax = amin}
\DoxyCodeLine{1008     \textcolor{keywordflow}{do} j=hi\%jsc,hi\%jec ; \textcolor{keywordflow}{do} i=isb,hi\%IecB}
\DoxyCodeLine{1009       amin = min(amin, array(i,j))}
\DoxyCodeLine{1010       amax = max(amax, array(i,j))}
\DoxyCodeLine{1011 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{1012     \textcolor{comment}{! This line deliberately uses the h-\/point computational domain.}}
\DoxyCodeLine{1013     amean = reproducing\_sum(array(hi\%isc:hi\%iec,hi\%jsc:hi\%jec))}
\DoxyCodeLine{1014     n = (1 + hi\%jec -\/ hi\%jsc) * (1 + hi\%iec -\/ hi\%isc)}
\DoxyCodeLine{1015     \textcolor{keyword}{call }sum\_across\_pes(n)}
\DoxyCodeLine{1016     \textcolor{keyword}{call }min\_across\_pes(amin)}
\DoxyCodeLine{1017     \textcolor{keyword}{call }max\_across\_pes(amax)}
\DoxyCodeLine{1018     amean = amean / real(n)}
\DoxyCodeLine{1019   \textcolor{keyword}{end subroutine }substats}
\DoxyCodeLine{1020 }

\end{DoxyCode}
\mbox{\Hypertarget{interfacemom__checksums_1_1uchksum_a68d90a17a90b5b1fa898066ef562533a}\label{interfacemom__checksums_1_1uchksum_a68d90a17a90b5b1fa898066ef562533a}} 
\index{mom\_checksums::uchksum@{mom\_checksums::uchksum}!chksum\_u\_3d@{chksum\_u\_3d}}
\index{chksum\_u\_3d@{chksum\_u\_3d}!mom\_checksums::uchksum@{mom\_checksums::uchksum}}
\doxysubsubsection{\texorpdfstring{chksum\_u\_3d()}{chksum\_u\_3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+checksums\+::uchksum\+::chksum\+\_\+u\+\_\+3d (\begin{DoxyParamCaption}\item[{real, dimension(hi\+\_\+m\%isdb\+:,hi\+\_\+m\%jsd\+:,\+:), intent(in), target}]{array\+\_\+m,  }\item[{character(len=$\ast$), intent(in)}]{mesg,  }\item[{type(hor\+\_\+index\+\_\+type), intent(in), target}]{H\+I\+\_\+m,  }\item[{integer, intent(in), optional}]{haloshift,  }\item[{logical, intent(in), optional}]{symmetric,  }\item[{logical, intent(in), optional}]{omit\+\_\+corners,  }\item[{real, intent(in), optional}]{scale,  }\item[{integer, intent(in), optional}]{logunit }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Checksums a 3d array staggered at C-\/grid u points. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em hi\+\_\+m} & A horizontal index type \\
\hline
\mbox{\texttt{ in}}  & {\em array\+\_\+m} & The array to be checksummed \\
\hline
\mbox{\texttt{ in}}  & {\em mesg} & An identifying message \\
\hline
\mbox{\texttt{ in}}  & {\em haloshift} & The width of halos to check (default 0) \\
\hline
\mbox{\texttt{ in}}  & {\em symmetric} & If true, do the checksums on the full symmetric computational domain. \\
\hline
\mbox{\texttt{ in}}  & {\em omit\+\_\+corners} & If true, avoid checking diagonal shifts \\
\hline
\mbox{\texttt{ in}}  & {\em scale} & A scaling factor for this array. \\
\hline
\mbox{\texttt{ in}}  & {\em logunit} & IO unit for checksum logging \\
\hline
\end{DoxyParams}


Definition at line 1524 of file M\+O\+M\+\_\+checksums.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1526   \textcolor{keywordtype}{type}(hor\_index\_type),    \textcolor{keywordtype}{target},   \textcolor{keywordtype}{intent(in)} :: HI\_m\textcolor{comment}{ !< A horizontal index type}}
\DoxyCodeLine{1527 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(HI\_m\%isdB:,HI\_m\%Jsd:,:)}, \textcolor{keywordtype}{target}, \textcolor{keywordtype}{intent(in)} :: array\_m\textcolor{comment}{ !< The array to be checksummed}}
\DoxyCodeLine{1528   \textcolor{keywordtype}{character(len=*)},                  \textcolor{keywordtype}{intent(in)} :: mesg\textcolor{comment}{  !< An identifying message}}
\DoxyCodeLine{1529   \textcolor{keywordtype}{integer},                 \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: haloshift\textcolor{comment}{ !< The width of halos to check (default 0)}}
\DoxyCodeLine{1530   \textcolor{keywordtype}{logical},                 \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: symmetric\textcolor{comment}{ !< If true, do the checksums on the full}}
\DoxyCodeLine{1531 \textcolor{comment}{                                                             !! symmetric computational domain.}}
\DoxyCodeLine{1532   \textcolor{keywordtype}{logical},                 \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: omit\_corners\textcolor{comment}{ !< If true, avoid checking diagonal shifts}}
\DoxyCodeLine{1533 \textcolor{keywordtype}{  real},                    \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: scale\textcolor{comment}{     !< A scaling factor for this array.}}
\DoxyCodeLine{1534   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: logunit\textcolor{comment}{ !< IO unit for checksum logging}}
\DoxyCodeLine{1535 }
\DoxyCodeLine{1536 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{pointer} :: array(:,:,:)         \textcolor{comment}{! Field array on the input grid}}
\DoxyCodeLine{1537 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{dimension(:,:,:)} :: rescaled\_array}
\DoxyCodeLine{1538   \textcolor{keywordtype}{type}(hor\_index\_type), \textcolor{keywordtype}{pointer} :: HI   \textcolor{comment}{! Horizontal index bounds of the input grid}}
\DoxyCodeLine{1539 \textcolor{keywordtype}{  real} :: scaling}
\DoxyCodeLine{1540   \textcolor{keywordtype}{integer} :: iounit\textcolor{comment}{ !< Log IO unit}}
\DoxyCodeLine{1541   \textcolor{keywordtype}{integer} :: i, j, k, Is}
\DoxyCodeLine{1542 \textcolor{keywordtype}{  real} :: aMean, aMin, aMax}
\DoxyCodeLine{1543   \textcolor{keywordtype}{integer} :: bc0, bcSW, bcSE, bcNW, bcNE, hshift}
\DoxyCodeLine{1544   \textcolor{keywordtype}{integer} :: bcN, bcS, bcE, bcW}
\DoxyCodeLine{1545   \textcolor{keywordtype}{logical} :: do\_corners, sym, sym\_stats}
\DoxyCodeLine{1546   \textcolor{keywordtype}{integer} :: turns                      \textcolor{comment}{! Quarter turns from input to model grid}}
\DoxyCodeLine{1547 }
\DoxyCodeLine{1548   \textcolor{comment}{! Rotate array to the input grid}}
\DoxyCodeLine{1549   turns = hi\_m\%turns}
\DoxyCodeLine{1550   \textcolor{keywordflow}{if} (modulo(turns, 4) /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1551     \textcolor{keyword}{allocate}(hi)}
\DoxyCodeLine{1552     \textcolor{keyword}{call }rotate\_hor\_index(hi\_m, -\/turns, hi)}
\DoxyCodeLine{1553     \textcolor{keywordflow}{if} (modulo(turns, 2) /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1554       \textcolor{comment}{! Arrays originating from v-\/points must be handled by vchksum}}
\DoxyCodeLine{1555       \textcolor{keyword}{allocate}(array(hi\%isd:hi\%ied, hi\%JsdB:hi\%JedB, \textcolor{keyword}{size}(array\_m, 3)))}
\DoxyCodeLine{1556       \textcolor{keyword}{call }rotate\_array(array\_m, -\/turns, array)}
\DoxyCodeLine{1557       \textcolor{keyword}{call }vchksum(array, mesg, hi, haloshift, symmetric, omit\_corners, scale, logunit)}
\DoxyCodeLine{1558       \textcolor{keywordflow}{return}}
\DoxyCodeLine{1559     \textcolor{keywordflow}{else}}
\DoxyCodeLine{1560       \textcolor{keyword}{allocate}(array(hi\%IsdB:hi\%IedB, hi\%jsd:hi\%jed, \textcolor{keyword}{size}(array\_m, 3)))}
\DoxyCodeLine{1561       \textcolor{keyword}{call }rotate\_array(array\_m, -\/turns, array)}
\DoxyCodeLine{1562 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1563   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1564     hi => hi\_m}
\DoxyCodeLine{1565     array => array\_m}
\DoxyCodeLine{1566 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1567 }
\DoxyCodeLine{1568   \textcolor{keywordflow}{if} (checkfornans) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1569     \textcolor{keywordflow}{if} (is\_nan(array(hi\%IscB:hi\%IecB,hi\%jsc:hi\%jec,:))) \&}
\DoxyCodeLine{1570       \textcolor{keyword}{call }chksum\_error(fatal, \textcolor{stringliteral}{'NaN detected: '}//trim(mesg))}
\DoxyCodeLine{1571 \textcolor{comment}{!   if (is\_NaN(array)) \&}}
\DoxyCodeLine{1572 \textcolor{comment}{!     call chksum\_error(FATAL, 'NaN detected in halo: '//trim(mesg))}}
\DoxyCodeLine{1573 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1574 }
\DoxyCodeLine{1575   scaling = 1.0 ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) scaling = scale}
\DoxyCodeLine{1576   iounit = error\_unit; \textcolor{keywordflow}{if}(\textcolor{keyword}{present}(logunit)) iounit = logunit}
\DoxyCodeLine{1577   sym\_stats = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(symmetric)) sym\_stats = symmetric}
\DoxyCodeLine{1578   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(haloshift)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (haloshift > 0) sym\_stats = .true. ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1579 }
\DoxyCodeLine{1580   \textcolor{keywordflow}{if} (calculatestatistics) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1581     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1582       \textcolor{keyword}{allocate}( rescaled\_array(lbound(array,1):ubound(array,1), \&}
\DoxyCodeLine{1583                                lbound(array,2):ubound(array,2), \&}
\DoxyCodeLine{1584                                lbound(array,3):ubound(array,3)) )}
\DoxyCodeLine{1585       rescaled\_array(:,:,:) = 0.0}
\DoxyCodeLine{1586       is = hi\%isc ; \textcolor{keywordflow}{if} (sym\_stats) is = hi\%isc-\/1}
\DoxyCodeLine{1587       \textcolor{keywordflow}{do} k=1,\textcolor{keyword}{size}(array,3) ; \textcolor{keywordflow}{do} j=hi\%jsc,hi\%jec ; \textcolor{keywordflow}{do} i=is,hi\%IecB}
\DoxyCodeLine{1588         rescaled\_array(i,j,k) = scale*array(i,j,k)}
\DoxyCodeLine{1589 \textcolor{keywordflow}{      enddo} ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{1590       \textcolor{keyword}{call }substats(hi, rescaled\_array, sym\_stats, amean, amin, amax)}
\DoxyCodeLine{1591       \textcolor{keyword}{deallocate}(rescaled\_array)}
\DoxyCodeLine{1592     \textcolor{keywordflow}{else}}
\DoxyCodeLine{1593       \textcolor{keyword}{call }substats(hi, array, sym\_stats, amean, amin, amax)}
\DoxyCodeLine{1594 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1595     \textcolor{keywordflow}{if} (is\_root\_pe()) \&}
\DoxyCodeLine{1596       \textcolor{keyword}{call }chk\_sum\_msg(\textcolor{stringliteral}{"u-\/point:"}, amean, amin, amax, mesg, iounit)}
\DoxyCodeLine{1597 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1598 }
\DoxyCodeLine{1599   \textcolor{keywordflow}{if} (.not.writechksums) \textcolor{keywordflow}{return}}
\DoxyCodeLine{1600 }
\DoxyCodeLine{1601   hshift = default\_shift}
\DoxyCodeLine{1602   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(haloshift)) hshift = haloshift}
\DoxyCodeLine{1603   \textcolor{keywordflow}{if} (hshift<0) hshift = hi\%ied-\/hi\%iec}
\DoxyCodeLine{1604 }
\DoxyCodeLine{1605   \textcolor{keywordflow}{if} ( hi\%isc-\/hshift<hi\%isd .or. hi\%iec+hshift>hi\%ied .or. \&}
\DoxyCodeLine{1606        hi\%jsc-\/hshift<hi\%jsd .or. hi\%jec+hshift>hi\%jed ) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1607     \textcolor{keyword}{write}(0,*) \textcolor{stringliteral}{'chksum\_u\_3d: haloshift ='},hshift}
\DoxyCodeLine{1608     \textcolor{keyword}{write}(0,*) \textcolor{stringliteral}{'chksum\_u\_3d: isd,isc,iec,ied='},hi\%isd,hi\%isc,hi\%iec,hi\%ied}
\DoxyCodeLine{1609     \textcolor{keyword}{write}(0,*) \textcolor{stringliteral}{'chksum\_u\_3d: jsd,jsc,jec,jed='},hi\%jsd,hi\%jsc,hi\%jec,hi\%jed}
\DoxyCodeLine{1610     \textcolor{keyword}{call }chksum\_error(fatal,\textcolor{stringliteral}{'Error in chksum\_u\_3d '}//trim(mesg))}
\DoxyCodeLine{1611 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1612 }
\DoxyCodeLine{1613   bc0 = subchk(array, hi, 0, 0, scaling)}
\DoxyCodeLine{1614 }
\DoxyCodeLine{1615   sym = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(symmetric)) sym = symmetric}
\DoxyCodeLine{1616 }
\DoxyCodeLine{1617   \textcolor{keywordflow}{if} ((hshift==0) .and. .not.sym) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1618     \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keyword}{call }chk\_sum\_msg(\textcolor{stringliteral}{"u-\/point:"}, bc0, mesg, iounit)}
\DoxyCodeLine{1619     \textcolor{keywordflow}{return}}
\DoxyCodeLine{1620 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1621 }
\DoxyCodeLine{1622   do\_corners = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(omit\_corners)) do\_corners = .not.omit\_corners}
\DoxyCodeLine{1623 }
\DoxyCodeLine{1624   \textcolor{keywordflow}{if} (hshift==0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1625     bcw = subchk(array, hi, -\/hshift-\/1, 0, scaling)}
\DoxyCodeLine{1626     \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keyword}{call }chk\_sum\_msg\_w(\textcolor{stringliteral}{"u-\/point:"}, bc0, bcw, mesg, iounit)}
\DoxyCodeLine{1627   \textcolor{keywordflow}{elseif} (do\_corners) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1628     \textcolor{keywordflow}{if} (sym) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1629       bcsw = subchk(array, hi, -\/hshift-\/1, -\/hshift, scaling)}
\DoxyCodeLine{1630       bcnw = subchk(array, hi, -\/hshift-\/1, hshift, scaling)}
\DoxyCodeLine{1631     \textcolor{keywordflow}{else}}
\DoxyCodeLine{1632       bcsw = subchk(array, hi, -\/hshift, -\/hshift, scaling)}
\DoxyCodeLine{1633       bcnw = subchk(array, hi, -\/hshift, hshift, scaling)}
\DoxyCodeLine{1634 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1635     bcse = subchk(array, hi, hshift, -\/hshift, scaling)}
\DoxyCodeLine{1636     bcne = subchk(array, hi, hshift, hshift, scaling)}
\DoxyCodeLine{1637 }
\DoxyCodeLine{1638     \textcolor{keywordflow}{if} (is\_root\_pe()) \&}
\DoxyCodeLine{1639       \textcolor{keyword}{call }chk\_sum\_msg(\textcolor{stringliteral}{"u-\/point:"}, bc0, bcsw, bcse, bcnw, bcne, mesg, iounit)}
\DoxyCodeLine{1640   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1641     bcs = subchk(array, hi, 0, -\/hshift, scaling)}
\DoxyCodeLine{1642     bce = subchk(array, hi, hshift, 0, scaling)}
\DoxyCodeLine{1643     \textcolor{keywordflow}{if} (sym) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1644       bcw = subchk(array, hi, -\/hshift-\/1, 0, scaling)}
\DoxyCodeLine{1645     \textcolor{keywordflow}{else}}
\DoxyCodeLine{1646       bcw = subchk(array, hi, -\/hshift, 0, scaling)}
\DoxyCodeLine{1647 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1648     bcn = subchk(array, hi, 0, hshift, scaling)}
\DoxyCodeLine{1649 }
\DoxyCodeLine{1650     \textcolor{keywordflow}{if} (is\_root\_pe()) \&}
\DoxyCodeLine{1651       \textcolor{keyword}{call }chk\_sum\_msg\_nsew(\textcolor{stringliteral}{"u-\/point:"}, bc0, bcn, bcs, bce, bcw, mesg, iounit)}
\DoxyCodeLine{1652 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1653 }
\DoxyCodeLine{1654   \textcolor{keyword}{contains}}
\DoxyCodeLine{1655 }
\DoxyCodeLine{1656   \textcolor{keyword}{integer }\textcolor{keyword}{function }subchk(array, HI, di, dj, scale)}
\DoxyCodeLine{1657     \textcolor{keywordtype}{type}(hor\_index\_type), \textcolor{keywordtype}{intent(in)} ::  HI\textcolor{comment}{     !< A horizontal index type}}
\DoxyCodeLine{1658 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{dimension(HI\%IsdB:,HI\%jsd:,:)}, \textcolor{keywordtype}{intent(in)} :: array\textcolor{comment}{ !< The array to be checksummed}}
\DoxyCodeLine{1659     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: di\textcolor{comment}{    !< i-\/ direction array shift for this checksum}}
\DoxyCodeLine{1660     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: dj\textcolor{comment}{    !< j-\/ direction array shift for this checksum}}
\DoxyCodeLine{1661 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{intent(in)}    :: scale\textcolor{comment}{ !< A scaling factor for this array.}}
\DoxyCodeLine{1662     \textcolor{keywordtype}{integer} :: i, j, k, bc}
\DoxyCodeLine{1663     subchk = 0}
\DoxyCodeLine{1664     \textcolor{comment}{! This line deliberately uses the h-\/point computational domain.}}
\DoxyCodeLine{1665     \textcolor{keywordflow}{do} k=lbound(array,3),ubound(array,3) ; \textcolor{keywordflow}{do} j=hi\%jsc+dj,hi\%jec+dj ; \textcolor{keywordflow}{do} i=hi\%isc+di,hi\%iec+di}
\DoxyCodeLine{1666       bc = bitcount(abs(scale*array(i,j,k)))}
\DoxyCodeLine{1667       subchk = subchk + bc}
\DoxyCodeLine{1668 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{1669     \textcolor{keyword}{call }sum\_across\_pes(subchk)}
\DoxyCodeLine{1670     subchk=mod(subchk, bc\_modulus)}
\DoxyCodeLine{1671   \textcolor{keyword}{end function }subchk}
\DoxyCodeLine{1672 }
\DoxyCodeLine{1673   \textcolor{keyword}{subroutine }substats(HI, array, sym\_stats, aMean, aMin, aMax)}
\DoxyCodeLine{1674     \textcolor{keywordtype}{type}(hor\_index\_type), \textcolor{keywordtype}{intent(in)} ::  HI\textcolor{comment}{     !< A horizontal index type}}
\DoxyCodeLine{1675 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{dimension(HI\%IsdB:,HI\%jsd:,:)}, \textcolor{keywordtype}{intent(in)} :: array\textcolor{comment}{ !< The array to be checksummed}}
\DoxyCodeLine{1676     \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{intent(in)} :: sym\_stats\textcolor{comment}{ !< If true, evaluate the statistics on the}}
\DoxyCodeLine{1677 \textcolor{comment}{                                              !! full symmetric computational domain.}}
\DoxyCodeLine{1678 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{intent(out)} :: aMean\textcolor{comment}{ !< Array mean}}
\DoxyCodeLine{1679 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{intent(out)} :: aMin\textcolor{comment}{ !< Array minimum}}
\DoxyCodeLine{1680 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{intent(out)} :: aMax\textcolor{comment}{ !< Array maximum}}
\DoxyCodeLine{1681 }
\DoxyCodeLine{1682     \textcolor{keywordtype}{integer} :: i, j, k, n, IsB}
\DoxyCodeLine{1683 }
\DoxyCodeLine{1684     isb = hi\%isc ; \textcolor{keywordflow}{if} (sym\_stats) isb = hi\%isc-\/1}
\DoxyCodeLine{1685 }
\DoxyCodeLine{1686     amin = array(hi\%isc,hi\%jsc,1) ; amax = amin}
\DoxyCodeLine{1687     \textcolor{keywordflow}{do} k=lbound(array,3),ubound(array,3) ; \textcolor{keywordflow}{do} j=hi\%jsc,hi\%jec ; \textcolor{keywordflow}{do} i=isb,hi\%IecB}
\DoxyCodeLine{1688       amin = min(amin, array(i,j,k))}
\DoxyCodeLine{1689       amax = max(amax, array(i,j,k))}
\DoxyCodeLine{1690 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{1691     \textcolor{comment}{! This line deliberately uses the h-\/point computational domain.}}
\DoxyCodeLine{1692     amean = reproducing\_sum(array(hi\%isc:hi\%iec,hi\%jsc:hi\%jec,:))}
\DoxyCodeLine{1693     n = (1 + hi\%jec -\/ hi\%jsc) * (1 + hi\%iec -\/ hi\%isc) * \textcolor{keyword}{size}(array,3)}
\DoxyCodeLine{1694     \textcolor{keyword}{call }sum\_across\_pes(n)}
\DoxyCodeLine{1695     \textcolor{keyword}{call }min\_across\_pes(amin)}
\DoxyCodeLine{1696     \textcolor{keyword}{call }max\_across\_pes(amax)}
\DoxyCodeLine{1697     amean = amean / real(n)}
\DoxyCodeLine{1698   \textcolor{keyword}{end subroutine }substats}
\DoxyCodeLine{1699 }

\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\+\_\+checksums.\+F90\end{DoxyCompactItemize}
