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


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

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

\doxysubsection*{Private functions}
\begin{DoxyCompactItemize}
\item 
subroutine \mbox{\hyperlink{interfacemom__checksums_1_1vchksum_a2fea0e7404edd53bbefdfa66d4706917}{chksum\+\_\+v\+\_\+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 v points. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{interfacemom__checksums_1_1vchksum_aef73c84b0fe627762c1742f57747a119}{chksum\+\_\+v\+\_\+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 v points. \end{DoxyCompactList}\end{DoxyCompactItemize}


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

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



\doxysubsection{Functions and subroutines}
\mbox{\Hypertarget{interfacemom__checksums_1_1vchksum_a2fea0e7404edd53bbefdfa66d4706917}\label{interfacemom__checksums_1_1vchksum_a2fea0e7404edd53bbefdfa66d4706917}} 
\index{mom\_checksums::vchksum@{mom\_checksums::vchksum}!chksum\_v\_2d@{chksum\_v\_2d}}
\index{chksum\_v\_2d@{chksum\_v\_2d}!mom\_checksums::vchksum@{mom\_checksums::vchksum}}
\doxysubsubsection{\texorpdfstring{chksum\_v\_2d()}{chksum\_v\_2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+checksums\+::vchksum\+::chksum\+\_\+v\+\_\+2d (\begin{DoxyParamCaption}\item[{real, dimension(hi\+\_\+m\%isd\+:,hi\+\_\+m\%jsdb\+:), intent(in), target}]{array\+\_\+m,  }\item[{character(len=$\ast$), intent(in)}]{mesg,  }\item[{type(\mbox{\hyperlink{structmom__hor__index_1_1hor__index__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 v 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 1024 of file M\+O\+M\+\_\+checksums.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1026   \textcolor{keywordtype}{type}(hor\_index\_type),  \textcolor{keywordtype}{target},   \textcolor{keywordtype}{intent(in)} :: HI\_m\textcolor{comment}{      !< A horizontal index type}}
\DoxyCodeLine{1027 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(HI\_m\%isd:,HI\_m\%JsdB:)}, \textcolor{keywordtype}{target}, \textcolor{keywordtype}{intent(in)} :: array\_m\textcolor{comment}{ !< The array to be checksummed}}
\DoxyCodeLine{1028   \textcolor{keywordtype}{character(len=*)},                \textcolor{keywordtype}{intent(in)} :: mesg\textcolor{comment}{  !< An identifying message}}
\DoxyCodeLine{1029   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: haloshift\textcolor{comment}{ !< The width of halos to check (default 0)}}
\DoxyCodeLine{1030   \textcolor{keywordtype}{logical},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: symmetric\textcolor{comment}{ !< If true, do the checksums on the full}}
\DoxyCodeLine{1031 \textcolor{comment}{                                                           !! symmetric computational domain.}}
\DoxyCodeLine{1032   \textcolor{keywordtype}{logical},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: omit\_corners\textcolor{comment}{ !< If true, avoid checking diagonal shifts}}
\DoxyCodeLine{1033 \textcolor{keywordtype}{  real},                  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: scale\textcolor{comment}{     !< A scaling factor for this array.}}
\DoxyCodeLine{1034   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: logunit\textcolor{comment}{ !< IO unit for checksum logging}}
\DoxyCodeLine{1035 }
\DoxyCodeLine{1036 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{pointer} :: array(:,:)           \textcolor{comment}{! Field array on the input grid}}
\DoxyCodeLine{1037 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{dimension(:,:)} :: rescaled\_array}
\DoxyCodeLine{1038   \textcolor{keywordtype}{type}(hor\_index\_type), \textcolor{keywordtype}{pointer} :: HI   \textcolor{comment}{! Horizontal index bounds of the input grid}}
\DoxyCodeLine{1039 \textcolor{keywordtype}{  real} :: scaling}
\DoxyCodeLine{1040   \textcolor{keywordtype}{integer} :: iounit\textcolor{comment}{ !< Log IO unit}}
\DoxyCodeLine{1041   \textcolor{keywordtype}{integer} :: i, j, Js}
\DoxyCodeLine{1042 \textcolor{keywordtype}{  real} :: aMean, aMin, aMax}
\DoxyCodeLine{1043   \textcolor{keywordtype}{integer} :: bc0, bcSW, bcSE, bcNW, bcNE, hshift}
\DoxyCodeLine{1044   \textcolor{keywordtype}{integer} :: bcN, bcS, bcE, bcW}
\DoxyCodeLine{1045   \textcolor{keywordtype}{logical} :: do\_corners, sym, sym\_stats}
\DoxyCodeLine{1046   \textcolor{keywordtype}{integer} :: turns                      \textcolor{comment}{! Quarter turns from input to model grid}}
\DoxyCodeLine{1047 }
\DoxyCodeLine{1048   \textcolor{comment}{! Rotate array to the input grid}}
\DoxyCodeLine{1049   turns = hi\_m\%turns}
\DoxyCodeLine{1050   \textcolor{keywordflow}{if} (modulo(turns, 4) /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1051     \textcolor{keyword}{allocate}(hi)}
\DoxyCodeLine{1052     \textcolor{keyword}{call }rotate\_hor\_index(hi\_m, -\/turns, hi)}
\DoxyCodeLine{1053     \textcolor{keywordflow}{if} (modulo(turns, 2) /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1054       \textcolor{comment}{! Arrays originating from u-\/points must be handled by uchksum}}
\DoxyCodeLine{1055       \textcolor{keyword}{allocate}(array(hi\%IsdB:hi\%IedB, hi\%jsd:hi\%jed))}
\DoxyCodeLine{1056       \textcolor{keyword}{call }rotate\_array(array\_m, -\/turns, array)}
\DoxyCodeLine{1057       \textcolor{keyword}{call }uchksum(array, mesg, hi, haloshift, symmetric, omit\_corners, scale, logunit)}
\DoxyCodeLine{1058       \textcolor{keywordflow}{return}}
\DoxyCodeLine{1059     \textcolor{keywordflow}{else}}
\DoxyCodeLine{1060       \textcolor{keyword}{allocate}(array(hi\%isd:hi\%ied, hi\%JsdB:hi\%JedB))}
\DoxyCodeLine{1061       \textcolor{keyword}{call }rotate\_array(array\_m, -\/turns, array)}
\DoxyCodeLine{1062 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1063   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1064     hi => hi\_m}
\DoxyCodeLine{1065     array => array\_m}
\DoxyCodeLine{1066 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1067 }
\DoxyCodeLine{1068   \textcolor{keywordflow}{if} (checkfornans) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1069     \textcolor{keywordflow}{if} (is\_nan(array(hi\%isc:hi\%iec,hi\%JscB:hi\%JecB))) \&}
\DoxyCodeLine{1070       \textcolor{keyword}{call }chksum\_error(fatal, \textcolor{stringliteral}{'NaN detected: '}//trim(mesg))}
\DoxyCodeLine{1071 \textcolor{comment}{!   if (is\_NaN(array)) \&}}
\DoxyCodeLine{1072 \textcolor{comment}{!     call chksum\_error(FATAL, 'NaN detected in halo: '//trim(mesg))}}
\DoxyCodeLine{1073 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1074 }
\DoxyCodeLine{1075   scaling = 1.0 ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) scaling = scale}
\DoxyCodeLine{1076   iounit = error\_unit; \textcolor{keywordflow}{if}(\textcolor{keyword}{present}(logunit)) iounit = logunit}
\DoxyCodeLine{1077   sym\_stats = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(symmetric)) sym\_stats = symmetric}
\DoxyCodeLine{1078   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(haloshift)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (haloshift > 0) sym\_stats = .true. ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1079 }
\DoxyCodeLine{1080   \textcolor{keywordflow}{if} (calculatestatistics) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1081     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1082       \textcolor{keyword}{allocate}( rescaled\_array(lbound(array,1):ubound(array,1), \&}
\DoxyCodeLine{1083                                lbound(array,2):ubound(array,2)) )}
\DoxyCodeLine{1084       rescaled\_array(:,:) = 0.0}
\DoxyCodeLine{1085       js = hi\%jsc ; \textcolor{keywordflow}{if} (sym\_stats) js = hi\%jsc-\/1}
\DoxyCodeLine{1086       \textcolor{keywordflow}{do} j=js,hi\%JecB ; \textcolor{keywordflow}{do} i=hi\%isc,hi\%iec}
\DoxyCodeLine{1087         rescaled\_array(i,j) = scale*array(i,j)}
\DoxyCodeLine{1088 \textcolor{keywordflow}{      enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{1089       \textcolor{keyword}{call }substats(hi, rescaled\_array, sym\_stats, amean, amin, amax)}
\DoxyCodeLine{1090       \textcolor{keyword}{deallocate}(rescaled\_array)}
\DoxyCodeLine{1091     \textcolor{keywordflow}{else}}
\DoxyCodeLine{1092       \textcolor{keyword}{call }substats(hi, array, sym\_stats, amean, amin, amax)}
\DoxyCodeLine{1093 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1094 }
\DoxyCodeLine{1095     \textcolor{keywordflow}{if} (is\_root\_pe()) \&}
\DoxyCodeLine{1096       \textcolor{keyword}{call }chk\_sum\_msg(\textcolor{stringliteral}{"{}v-\/point:"{}}, amean, amin, amax, mesg, iounit)}
\DoxyCodeLine{1097 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1098 }
\DoxyCodeLine{1099   \textcolor{keywordflow}{if} (.not.writechksums) \textcolor{keywordflow}{return}}
\DoxyCodeLine{1100 }
\DoxyCodeLine{1101   hshift = default\_shift}
\DoxyCodeLine{1102   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(haloshift)) hshift = haloshift}
\DoxyCodeLine{1103   \textcolor{keywordflow}{if} (hshift<0) hshift = hi\%ied-\/hi\%iec}
\DoxyCodeLine{1104 }
\DoxyCodeLine{1105   \textcolor{keywordflow}{if} ( hi\%isc-\/hshift<hi\%isd .or. hi\%iec+hshift>hi\%ied .or. \&}
\DoxyCodeLine{1106        hi\%jscB-\/hshift<hi\%jsdB .or. hi\%jecB+hshift>hi\%jedB ) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1107     \textcolor{keyword}{write}(0,*) \textcolor{stringliteral}{'chksum\_v\_2d: haloshift ='},hshift}
\DoxyCodeLine{1108     \textcolor{keyword}{write}(0,*) \textcolor{stringliteral}{'chksum\_v\_2d: isd,isc,iec,ied='},hi\%isd,hi\%isc,hi\%iec,hi\%ied}
\DoxyCodeLine{1109     \textcolor{keyword}{write}(0,*) \textcolor{stringliteral}{'chksum\_v\_2d: jsd,jsc,jec,jed='},hi\%jsdB,hi\%jscB,hi\%jecB,hi\%jedB}
\DoxyCodeLine{1110     \textcolor{keyword}{call }chksum\_error(fatal,\textcolor{stringliteral}{'Error in chksum\_v\_2d '}//trim(mesg))}
\DoxyCodeLine{1111 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1112 }
\DoxyCodeLine{1113   bc0 = subchk(array, hi, 0, 0, scaling)}
\DoxyCodeLine{1114 }
\DoxyCodeLine{1115   sym = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(symmetric)) sym = symmetric}
\DoxyCodeLine{1116 }
\DoxyCodeLine{1117   \textcolor{keywordflow}{if} ((hshift==0) .and. .not.sym) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1118     \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keyword}{call }chk\_sum\_msg(\textcolor{stringliteral}{"{}v-\/point:"{}}, bc0, mesg, iounit)}
\DoxyCodeLine{1119     \textcolor{keywordflow}{return}}
\DoxyCodeLine{1120 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1121 }
\DoxyCodeLine{1122   do\_corners = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(omit\_corners)) do\_corners = .not.omit\_corners}
\DoxyCodeLine{1123 }
\DoxyCodeLine{1124   \textcolor{keywordflow}{if} (hshift==0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1125     bcs = subchk(array, hi, 0, -\/hshift-\/1, scaling)}
\DoxyCodeLine{1126     \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keyword}{call }chk\_sum\_msg\_s(\textcolor{stringliteral}{"{}v-\/point:"{}}, bc0, bcs, mesg, iounit)}
\DoxyCodeLine{1127   \textcolor{keywordflow}{elseif} (do\_corners) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1128     \textcolor{keywordflow}{if} (sym) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1129       bcsw = subchk(array, hi, -\/hshift, -\/hshift-\/1, scaling)}
\DoxyCodeLine{1130       bcse = subchk(array, hi, hshift, -\/hshift-\/1, scaling)}
\DoxyCodeLine{1131     \textcolor{keywordflow}{else}}
\DoxyCodeLine{1132       bcsw = subchk(array, hi, -\/hshift, -\/hshift, scaling)}
\DoxyCodeLine{1133       bcse = subchk(array, hi, hshift, -\/hshift, scaling)}
\DoxyCodeLine{1134 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1135     bcnw = subchk(array, hi, -\/hshift, hshift, scaling)}
\DoxyCodeLine{1136     bcne = subchk(array, hi, hshift, hshift, scaling)}
\DoxyCodeLine{1137 }
\DoxyCodeLine{1138     \textcolor{keywordflow}{if} (is\_root\_pe()) \&}
\DoxyCodeLine{1139       \textcolor{keyword}{call }chk\_sum\_msg(\textcolor{stringliteral}{"{}v-\/point:"{}}, bc0, bcsw, bcse, bcnw, bcne, mesg, iounit)}
\DoxyCodeLine{1140   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1141     \textcolor{keywordflow}{if} (sym) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1142       bcs = subchk(array, hi, 0, -\/hshift-\/1, scaling)}
\DoxyCodeLine{1143     \textcolor{keywordflow}{else}}
\DoxyCodeLine{1144       bcs = subchk(array, hi, 0, -\/hshift, scaling)}
\DoxyCodeLine{1145 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1146     bce = subchk(array, hi, hshift, 0, scaling)}
\DoxyCodeLine{1147     bcw = subchk(array, hi, -\/hshift, 0, scaling)}
\DoxyCodeLine{1148     bcn = subchk(array, hi, 0, hshift, scaling)}
\DoxyCodeLine{1149 }
\DoxyCodeLine{1150     \textcolor{keywordflow}{if} (is\_root\_pe()) \&}
\DoxyCodeLine{1151       \textcolor{keyword}{call }chk\_sum\_msg\_nsew(\textcolor{stringliteral}{"{}v-\/point:"{}}, bc0, bcn, bcs, bce, bcw, mesg, iounit)}
\DoxyCodeLine{1152 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1153 }
\DoxyCodeLine{1154   \textcolor{keyword}{contains}}
\DoxyCodeLine{1155 }
\DoxyCodeLine{1156   \textcolor{keyword}{integer }\textcolor{keyword}{function }subchk(array, HI, di, dj, scale)}
\DoxyCodeLine{1157     \textcolor{keywordtype}{type}(hor\_index\_type), \textcolor{keywordtype}{intent(in)} ::  HI\textcolor{comment}{     !< A horizontal index type}}
\DoxyCodeLine{1158 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{dimension(HI\%isd:,HI\%JsdB:)}, \textcolor{keywordtype}{intent(in)} :: array\textcolor{comment}{ !< The array to be checksummed}}
\DoxyCodeLine{1159     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: di\textcolor{comment}{    !< i-\/ direction array shift for this checksum}}
\DoxyCodeLine{1160     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: dj\textcolor{comment}{    !< j-\/ direction array shift for this checksum}}
\DoxyCodeLine{1161 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{intent(in)}    :: scale\textcolor{comment}{ !< A scaling factor for this array.}}
\DoxyCodeLine{1162     \textcolor{keywordtype}{integer} :: i, j, bc}
\DoxyCodeLine{1163     subchk = 0}
\DoxyCodeLine{1164     \textcolor{comment}{! This line deliberately uses the h-\/point computational domain.}}
\DoxyCodeLine{1165     \textcolor{keywordflow}{do} j=hi\%jsc+dj,hi\%jec+dj; \textcolor{keywordflow}{do} i=hi\%isc+di,hi\%iec+di}
\DoxyCodeLine{1166       bc = bitcount(abs(scale*array(i,j)))}
\DoxyCodeLine{1167       subchk = subchk + bc}
\DoxyCodeLine{1168 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{1169     \textcolor{keyword}{call }sum\_across\_pes(subchk)}
\DoxyCodeLine{1170     subchk=mod(subchk, bc\_modulus)}
\DoxyCodeLine{1171   \textcolor{keyword}{end function }subchk}
\DoxyCodeLine{1172 }
\DoxyCodeLine{1173   \textcolor{keyword}{subroutine }substats(HI, array, sym\_stats, aMean, aMin, aMax)}
\DoxyCodeLine{1174     \textcolor{keywordtype}{type}(hor\_index\_type), \textcolor{keywordtype}{intent(in)} ::  HI\textcolor{comment}{     !< A horizontal index type}}
\DoxyCodeLine{1175 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{dimension(HI\%isd:,HI\%JsdB:)}, \textcolor{keywordtype}{intent(in)} :: array\textcolor{comment}{ !< The array to be checksummed}}
\DoxyCodeLine{1176     \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{intent(in)} :: sym\_stats\textcolor{comment}{ !< If true, evaluate the statistics on the}}
\DoxyCodeLine{1177 \textcolor{comment}{                                              !! full symmetric computational domain.}}
\DoxyCodeLine{1178 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{intent(out)} :: aMean\textcolor{comment}{ !< Array mean}}
\DoxyCodeLine{1179 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{intent(out)} :: aMin\textcolor{comment}{ !< Array minimum}}
\DoxyCodeLine{1180 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{intent(out)} :: aMax\textcolor{comment}{ !< Array maximum}}
\DoxyCodeLine{1181 }
\DoxyCodeLine{1182     \textcolor{keywordtype}{integer} :: i, j, n, JsB}
\DoxyCodeLine{1183 }
\DoxyCodeLine{1184     jsb = hi\%jsc ; \textcolor{keywordflow}{if} (sym\_stats) jsb = hi\%jsc-\/1}
\DoxyCodeLine{1185 }
\DoxyCodeLine{1186     amin = array(hi\%isc,hi\%jsc) ; amax = amin}
\DoxyCodeLine{1187     \textcolor{keywordflow}{do} j=jsb,hi\%JecB ; \textcolor{keywordflow}{do} i=hi\%isc,hi\%iec}
\DoxyCodeLine{1188       amin = min(amin, array(i,j))}
\DoxyCodeLine{1189       amax = max(amax, array(i,j))}
\DoxyCodeLine{1190 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{1191     \textcolor{comment}{! This line deliberately uses the h-\/computational domain.}}
\DoxyCodeLine{1192     amean = reproducing\_sum(array(hi\%isc:hi\%iec,hi\%jsc:hi\%jec))}
\DoxyCodeLine{1193     n = (1 + hi\%jec -\/ hi\%jsc) * (1 + hi\%iec -\/ hi\%isc)}
\DoxyCodeLine{1194     \textcolor{keyword}{call }sum\_across\_pes(n)}
\DoxyCodeLine{1195     \textcolor{keyword}{call }min\_across\_pes(amin)}
\DoxyCodeLine{1196     \textcolor{keyword}{call }max\_across\_pes(amax)}
\DoxyCodeLine{1197     amean = amean / real(n)}
\DoxyCodeLine{1198   \textcolor{keyword}{end subroutine }substats}
\DoxyCodeLine{1199 }

\end{DoxyCode}
\mbox{\Hypertarget{interfacemom__checksums_1_1vchksum_aef73c84b0fe627762c1742f57747a119}\label{interfacemom__checksums_1_1vchksum_aef73c84b0fe627762c1742f57747a119}} 
\index{mom\_checksums::vchksum@{mom\_checksums::vchksum}!chksum\_v\_3d@{chksum\_v\_3d}}
\index{chksum\_v\_3d@{chksum\_v\_3d}!mom\_checksums::vchksum@{mom\_checksums::vchksum}}
\doxysubsubsection{\texorpdfstring{chksum\_v\_3d()}{chksum\_v\_3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+checksums\+::vchksum\+::chksum\+\_\+v\+\_\+3d (\begin{DoxyParamCaption}\item[{real, dimension(hi\+\_\+m\%isd\+:,hi\+\_\+m\%jsdb\+:,\+:), intent(in), target}]{array\+\_\+m,  }\item[{character(len=$\ast$), intent(in)}]{mesg,  }\item[{type(\mbox{\hyperlink{structmom__hor__index_1_1hor__index__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 v 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 1703 of file M\+O\+M\+\_\+checksums.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1705   \textcolor{keywordtype}{type}(hor\_index\_type),    \textcolor{keywordtype}{target},   \textcolor{keywordtype}{intent(in)} :: HI\_m\textcolor{comment}{ !< A horizontal index type}}
\DoxyCodeLine{1706 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(HI\_m\%isd:,HI\_m\%JsdB:,:)}, \textcolor{keywordtype}{target}, \textcolor{keywordtype}{intent(in)} :: array\_m\textcolor{comment}{ !< The array to be checksummed}}
\DoxyCodeLine{1707   \textcolor{keywordtype}{character(len=*)},                  \textcolor{keywordtype}{intent(in)} :: mesg\textcolor{comment}{  !< An identifying message}}
\DoxyCodeLine{1708   \textcolor{keywordtype}{integer},                 \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: haloshift\textcolor{comment}{ !< The width of halos to check (default 0)}}
\DoxyCodeLine{1709   \textcolor{keywordtype}{logical},                 \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: symmetric\textcolor{comment}{ !< If true, do the checksums on the full}}
\DoxyCodeLine{1710 \textcolor{comment}{                                                             !! symmetric computational domain.}}
\DoxyCodeLine{1711   \textcolor{keywordtype}{logical},                 \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: omit\_corners\textcolor{comment}{ !< If true, avoid checking diagonal shifts}}
\DoxyCodeLine{1712 \textcolor{keywordtype}{  real},                    \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: scale\textcolor{comment}{     !< A scaling factor for this array.}}
\DoxyCodeLine{1713   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: logunit\textcolor{comment}{ !< IO unit for checksum logging}}
\DoxyCodeLine{1714 }
\DoxyCodeLine{1715 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{pointer} :: array(:,:,:)         \textcolor{comment}{! Field array on the input grid}}
\DoxyCodeLine{1716 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{allocatable}, \textcolor{keywordtype}{dimension(:,:,:)} :: rescaled\_array}
\DoxyCodeLine{1717   \textcolor{keywordtype}{type}(hor\_index\_type), \textcolor{keywordtype}{pointer} :: HI   \textcolor{comment}{! Horizontal index bounds of the input grid}}
\DoxyCodeLine{1718 \textcolor{keywordtype}{  real} :: scaling}
\DoxyCodeLine{1719   \textcolor{keywordtype}{integer} :: iounit\textcolor{comment}{ !< Log IO unit}}
\DoxyCodeLine{1720   \textcolor{keywordtype}{integer} :: i, j, k, Js}
\DoxyCodeLine{1721   \textcolor{keywordtype}{integer} :: bc0, bcSW, bcSE, bcNW, bcNE, hshift}
\DoxyCodeLine{1722   \textcolor{keywordtype}{integer} :: bcN, bcS, bcE, bcW}
\DoxyCodeLine{1723 \textcolor{keywordtype}{  real} :: aMean, aMin, aMax}
\DoxyCodeLine{1724   \textcolor{keywordtype}{logical} :: do\_corners, sym, sym\_stats}
\DoxyCodeLine{1725   \textcolor{keywordtype}{integer} :: turns                      \textcolor{comment}{! Quarter turns from input to model grid}}
\DoxyCodeLine{1726 }
\DoxyCodeLine{1727   \textcolor{comment}{! Rotate array to the input grid}}
\DoxyCodeLine{1728   turns = hi\_m\%turns}
\DoxyCodeLine{1729   \textcolor{keywordflow}{if} (modulo(turns, 4) /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1730     \textcolor{keyword}{allocate}(hi)}
\DoxyCodeLine{1731     \textcolor{keyword}{call }rotate\_hor\_index(hi\_m, -\/turns, hi)}
\DoxyCodeLine{1732     \textcolor{keywordflow}{if} (modulo(turns, 2) /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1733       \textcolor{comment}{! Arrays originating from u-\/points must be handled by uchksum}}
\DoxyCodeLine{1734       \textcolor{keyword}{allocate}(array(hi\%IsdB:hi\%IedB, hi\%jsd:hi\%jed, \textcolor{keyword}{size}(array\_m, 3)))}
\DoxyCodeLine{1735       \textcolor{keyword}{call }rotate\_array(array\_m, -\/turns, array)}
\DoxyCodeLine{1736       \textcolor{keyword}{call }uchksum(array, mesg, hi, haloshift, symmetric, omit\_corners, scale, logunit)}
\DoxyCodeLine{1737       \textcolor{keywordflow}{return}}
\DoxyCodeLine{1738     \textcolor{keywordflow}{else}}
\DoxyCodeLine{1739       \textcolor{keyword}{allocate}(array(hi\%isd:hi\%ied, hi\%JsdB:hi\%JedB, \textcolor{keyword}{size}(array\_m, 3)))}
\DoxyCodeLine{1740       \textcolor{keyword}{call }rotate\_array(array\_m, -\/turns, array)}
\DoxyCodeLine{1741 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1742   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1743     hi => hi\_m}
\DoxyCodeLine{1744     array => array\_m}
\DoxyCodeLine{1745 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1746 }
\DoxyCodeLine{1747   \textcolor{keywordflow}{if} (checkfornans) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1748     \textcolor{keywordflow}{if} (is\_nan(array(hi\%isc:hi\%iec,hi\%JscB:hi\%JecB,:))) \&}
\DoxyCodeLine{1749       \textcolor{keyword}{call }chksum\_error(fatal, \textcolor{stringliteral}{'NaN detected: '}//trim(mesg))}
\DoxyCodeLine{1750 \textcolor{comment}{!   if (is\_NaN(array)) \&}}
\DoxyCodeLine{1751 \textcolor{comment}{!     call chksum\_error(FATAL, 'NaN detected in halo: '//trim(mesg))}}
\DoxyCodeLine{1752 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1753 }
\DoxyCodeLine{1754   scaling = 1.0 ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) scaling = scale}
\DoxyCodeLine{1755   iounit = error\_unit; \textcolor{keywordflow}{if}(\textcolor{keyword}{present}(logunit)) iounit = logunit}
\DoxyCodeLine{1756   sym\_stats = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(symmetric)) sym\_stats = symmetric}
\DoxyCodeLine{1757   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(haloshift)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (haloshift > 0) sym\_stats = .true. ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1758 }
\DoxyCodeLine{1759   \textcolor{keywordflow}{if} (calculatestatistics) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1760     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1761       \textcolor{keyword}{allocate}( rescaled\_array(lbound(array,1):ubound(array,1), \&}
\DoxyCodeLine{1762                                lbound(array,2):ubound(array,2), \&}
\DoxyCodeLine{1763                                lbound(array,3):ubound(array,3)) )}
\DoxyCodeLine{1764       rescaled\_array(:,:,:) = 0.0}
\DoxyCodeLine{1765       js = hi\%jsc ; \textcolor{keywordflow}{if} (sym\_stats) js = hi\%jsc-\/1}
\DoxyCodeLine{1766       \textcolor{keywordflow}{do} k=1,\textcolor{keyword}{size}(array,3) ; \textcolor{keywordflow}{do} j=js,hi\%JecB ; \textcolor{keywordflow}{do} i=hi\%isc,hi\%iec}
\DoxyCodeLine{1767         rescaled\_array(i,j,k) = scale*array(i,j,k)}
\DoxyCodeLine{1768 \textcolor{keywordflow}{      enddo} ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{1769       \textcolor{keyword}{call }substats(hi, rescaled\_array, sym\_stats, amean, amin, amax)}
\DoxyCodeLine{1770       \textcolor{keyword}{deallocate}(rescaled\_array)}
\DoxyCodeLine{1771     \textcolor{keywordflow}{else}}
\DoxyCodeLine{1772       \textcolor{keyword}{call }substats(hi, array, sym\_stats, amean, amin, amax)}
\DoxyCodeLine{1773 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1774     \textcolor{keywordflow}{if} (is\_root\_pe()) \&}
\DoxyCodeLine{1775       \textcolor{keyword}{call }chk\_sum\_msg(\textcolor{stringliteral}{"{}v-\/point:"{}}, amean, amin, amax, mesg, iounit)}
\DoxyCodeLine{1776 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1777 }
\DoxyCodeLine{1778   \textcolor{keywordflow}{if} (.not.writechksums) \textcolor{keywordflow}{return}}
\DoxyCodeLine{1779 }
\DoxyCodeLine{1780   hshift = default\_shift}
\DoxyCodeLine{1781   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(haloshift)) hshift = haloshift}
\DoxyCodeLine{1782   \textcolor{keywordflow}{if} (hshift<0) hshift = hi\%ied-\/hi\%iec}
\DoxyCodeLine{1783 }
\DoxyCodeLine{1784   \textcolor{keywordflow}{if} ( hi\%isc-\/hshift<hi\%isd .or. hi\%iec+hshift>hi\%ied .or. \&}
\DoxyCodeLine{1785        hi\%jsc-\/hshift<hi\%jsd .or. hi\%jec+hshift>hi\%jed ) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1786     \textcolor{keyword}{write}(0,*) \textcolor{stringliteral}{'chksum\_v\_3d: haloshift ='},hshift}
\DoxyCodeLine{1787     \textcolor{keyword}{write}(0,*) \textcolor{stringliteral}{'chksum\_v\_3d: isd,isc,iec,ied='},hi\%isd,hi\%isc,hi\%iec,hi\%ied}
\DoxyCodeLine{1788     \textcolor{keyword}{write}(0,*) \textcolor{stringliteral}{'chksum\_v\_3d: jsd,jsc,jec,jed='},hi\%jsd,hi\%jsc,hi\%jec,hi\%jed}
\DoxyCodeLine{1789     \textcolor{keyword}{call }chksum\_error(fatal,\textcolor{stringliteral}{'Error in chksum\_v\_3d '}//trim(mesg))}
\DoxyCodeLine{1790 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1791 }
\DoxyCodeLine{1792   bc0 = subchk(array, hi, 0, 0, scaling)}
\DoxyCodeLine{1793 }
\DoxyCodeLine{1794   sym = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(symmetric)) sym = symmetric}
\DoxyCodeLine{1795 }
\DoxyCodeLine{1796   \textcolor{keywordflow}{if} ((hshift==0) .and. .not.sym) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1797     \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keyword}{call }chk\_sum\_msg(\textcolor{stringliteral}{"{}v-\/point:"{}}, bc0, mesg, iounit)}
\DoxyCodeLine{1798     \textcolor{keywordflow}{return}}
\DoxyCodeLine{1799 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1800 }
\DoxyCodeLine{1801   do\_corners = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(omit\_corners)) do\_corners = .not.omit\_corners}
\DoxyCodeLine{1802 }
\DoxyCodeLine{1803   \textcolor{keywordflow}{if} (hshift==0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1804     bcs = subchk(array, hi, 0, -\/hshift-\/1, scaling)}
\DoxyCodeLine{1805     \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keyword}{call }chk\_sum\_msg\_s(\textcolor{stringliteral}{"{}v-\/point:"{}}, bc0, bcs, mesg, iounit)}
\DoxyCodeLine{1806   \textcolor{keywordflow}{elseif} (do\_corners) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1807     \textcolor{keywordflow}{if} (sym) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1808       bcsw = subchk(array, hi, -\/hshift, -\/hshift-\/1, scaling)}
\DoxyCodeLine{1809       bcse = subchk(array, hi, hshift, -\/hshift-\/1, scaling)}
\DoxyCodeLine{1810     \textcolor{keywordflow}{else}}
\DoxyCodeLine{1811       bcsw = subchk(array, hi, -\/hshift, -\/hshift, scaling)}
\DoxyCodeLine{1812       bcse = subchk(array, hi, hshift, -\/hshift, scaling)}
\DoxyCodeLine{1813 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1814     bcnw = subchk(array, hi, -\/hshift, hshift, scaling)}
\DoxyCodeLine{1815     bcne = subchk(array, hi, hshift, hshift, scaling)}
\DoxyCodeLine{1816 }
\DoxyCodeLine{1817     \textcolor{keywordflow}{if} (is\_root\_pe()) \&}
\DoxyCodeLine{1818       \textcolor{keyword}{call }chk\_sum\_msg(\textcolor{stringliteral}{"{}v-\/point:"{}}, bc0, bcsw, bcse, bcnw, bcne, mesg, iounit)}
\DoxyCodeLine{1819   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1820     \textcolor{keywordflow}{if} (sym) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1821       bcs = subchk(array, hi, 0, -\/hshift-\/1, scaling)}
\DoxyCodeLine{1822     \textcolor{keywordflow}{else}}
\DoxyCodeLine{1823       bcs = subchk(array, hi, 0, -\/hshift, scaling)}
\DoxyCodeLine{1824 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1825     bce = subchk(array, hi, hshift, 0, scaling)}
\DoxyCodeLine{1826     bcw = subchk(array, hi, -\/hshift, 0, scaling)}
\DoxyCodeLine{1827     bcn = subchk(array, hi, 0, hshift, scaling)}
\DoxyCodeLine{1828 }
\DoxyCodeLine{1829     \textcolor{keywordflow}{if} (is\_root\_pe()) \&}
\DoxyCodeLine{1830       \textcolor{keyword}{call }chk\_sum\_msg\_nsew(\textcolor{stringliteral}{"{}v-\/point:"{}}, bc0, bcn, bcs, bce, bcw, mesg, iounit)}
\DoxyCodeLine{1831 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1832 }
\DoxyCodeLine{1833   \textcolor{keyword}{contains}}
\DoxyCodeLine{1834 }
\DoxyCodeLine{1835   \textcolor{keyword}{integer }\textcolor{keyword}{function }subchk(array, HI, di, dj, scale)}
\DoxyCodeLine{1836     \textcolor{keywordtype}{type}(hor\_index\_type), \textcolor{keywordtype}{intent(in)} ::  HI\textcolor{comment}{     !< A horizontal index type}}
\DoxyCodeLine{1837 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{dimension(HI\%isd:,HI\%JsdB:,:)}, \textcolor{keywordtype}{intent(in)} :: array\textcolor{comment}{ !< The array to be checksummed}}
\DoxyCodeLine{1838     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: di\textcolor{comment}{    !< i-\/ direction array shift for this checksum}}
\DoxyCodeLine{1839     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: dj\textcolor{comment}{    !< j-\/ direction array shift for this checksum}}
\DoxyCodeLine{1840 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{intent(in)}    :: scale\textcolor{comment}{ !< A scaling factor for this array.}}
\DoxyCodeLine{1841     \textcolor{keywordtype}{integer} :: i, j, k, bc}
\DoxyCodeLine{1842     subchk = 0}
\DoxyCodeLine{1843     \textcolor{comment}{! This line deliberately uses the h-\/point computational domain.}}
\DoxyCodeLine{1844     \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{1845       bc = bitcount(abs(scale*array(i,j,k)))}
\DoxyCodeLine{1846       subchk = subchk + bc}
\DoxyCodeLine{1847 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{1848     \textcolor{keyword}{call }sum\_across\_pes(subchk)}
\DoxyCodeLine{1849     subchk=mod(subchk, bc\_modulus)}
\DoxyCodeLine{1850   \textcolor{keyword}{end function }subchk}
\DoxyCodeLine{1851 }
\DoxyCodeLine{1852   \textcolor{comment}{!subroutine subStats(HI, array, mesg, sym\_stats)}}
\DoxyCodeLine{1853   \textcolor{keyword}{subroutine }substats(HI, array, sym\_stats, aMean, aMin, aMax)}
\DoxyCodeLine{1854     \textcolor{keywordtype}{type}(hor\_index\_type), \textcolor{keywordtype}{intent(in)} ::  HI\textcolor{comment}{     !< A horizontal index type}}
\DoxyCodeLine{1855 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{dimension(HI\%isd:,HI\%JsdB:,:)}, \textcolor{keywordtype}{intent(in)} :: array\textcolor{comment}{ !< The array to be checksummed}}
\DoxyCodeLine{1856     \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{intent(in)} :: sym\_stats\textcolor{comment}{ !< If true, evaluate the statistics on the}}
\DoxyCodeLine{1857 \textcolor{comment}{                                              !! full symmetric computational domain.}}
\DoxyCodeLine{1858 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{intent(out)} :: aMean\textcolor{comment}{   !< Mean of array over domain}}
\DoxyCodeLine{1859 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{intent(out)} :: aMin\textcolor{comment}{    !< Minimum of array over domain}}
\DoxyCodeLine{1860 \textcolor{keywordtype}{    real}, \textcolor{keywordtype}{intent(out)} :: aMax\textcolor{comment}{    !< Maximum of array over domain}}
\DoxyCodeLine{1861 }
\DoxyCodeLine{1862     \textcolor{keywordtype}{integer} :: i, j, k, n, JsB}
\DoxyCodeLine{1863 }
\DoxyCodeLine{1864     jsb = hi\%jsc ; \textcolor{keywordflow}{if} (sym\_stats) jsb = hi\%jsc-\/1}
\DoxyCodeLine{1865 }
\DoxyCodeLine{1866     amin = array(hi\%isc,hi\%jsc,1) ; amax = amin}
\DoxyCodeLine{1867     \textcolor{keywordflow}{do} k=lbound(array,3),ubound(array,3) ; \textcolor{keywordflow}{do} j=jsb,hi\%JecB ; \textcolor{keywordflow}{do} i=hi\%isc,hi\%iec}
\DoxyCodeLine{1868       amin = min(amin, array(i,j,k))}
\DoxyCodeLine{1869       amax = max(amax, array(i,j,k))}
\DoxyCodeLine{1870 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{1871     \textcolor{comment}{! This line deliberately uses the h-\/point computational domain.}}
\DoxyCodeLine{1872     amean = reproducing\_sum(array(hi\%isc:hi\%iec,hi\%jsc:hi\%jec,:))}
\DoxyCodeLine{1873     n = (1 + hi\%jec -\/ hi\%jsc) * (1 + hi\%iec -\/ hi\%isc) * \textcolor{keyword}{size}(array,3)}
\DoxyCodeLine{1874     \textcolor{keyword}{call }sum\_across\_pes(n)}
\DoxyCodeLine{1875     \textcolor{keyword}{call }min\_across\_pes(amin)}
\DoxyCodeLine{1876     \textcolor{keyword}{call }max\_across\_pes(amax)}
\DoxyCodeLine{1877     amean = amean / real(n)}
\DoxyCodeLine{1878   \textcolor{keyword}{end subroutine }substats}
\DoxyCodeLine{1879 }

\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}
