\hypertarget{interfacemom__checksums_1_1chksum}{}\section{mom\+\_\+checksums\+:\+:chksum Interface Reference}
\label{interfacemom__checksums_1_1chksum}\index{mom\+\_\+checksums\+::chksum@{mom\+\_\+checksums\+::chksum}}


\subsection{Detailed Description}
This is an older interface for 1-\/, 2-\/, or 3-\/D checksums. 

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

\subsection*{Private functions}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{interfacemom__checksums_1_1chksum_ad95756f66bded93e6be500043f9eac0d}{chksum1d} (array, mesg, start\+\_\+i, end\+\_\+i, compare\+\_\+\+P\+Es)
\begin{DoxyCompactList}\small\item\em chksum1d does a checksum of a 1-\/dimensional array. \end{DoxyCompactList}\item 
subroutine \hyperlink{interfacemom__checksums_1_1chksum_a2fba13939b2a2b0752cf960bd7fc9e17}{chksum2d} (array, mesg)
\begin{DoxyCompactList}\small\item\em chksum2d does a checksum of all data in a 2-\/d array. \end{DoxyCompactList}\item 
subroutine \hyperlink{interfacemom__checksums_1_1chksum_a6d57100cdc39c849d3c55fc182859ef1}{chksum3d} (array, mesg)
\begin{DoxyCompactList}\small\item\em chksum3d does a checksum of all data in a 2-\/d array. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
This is an older interface for 1-\/, 2-\/, or 3-\/D checksums. 

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



\subsection{Functions and subroutines}
\mbox{\Hypertarget{interfacemom__checksums_1_1chksum_ad95756f66bded93e6be500043f9eac0d}\label{interfacemom__checksums_1_1chksum_ad95756f66bded93e6be500043f9eac0d}} 
\index{mom\+\_\+checksums\+::chksum@{mom\+\_\+checksums\+::chksum}!chksum1d@{chksum1d}}
\index{chksum1d@{chksum1d}!mom\+\_\+checksums\+::chksum@{mom\+\_\+checksums\+::chksum}}
\subsubsection{\texorpdfstring{chksum1d()}{chksum1d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+checksums\+::chksum\+::chksum1d (\begin{DoxyParamCaption}\item[{real, dimension(\+:), intent(in)}]{array,  }\item[{character(len=$\ast$), intent(in)}]{mesg,  }\item[{integer, intent(in), optional}]{start\+\_\+i,  }\item[{integer, intent(in), optional}]{end\+\_\+i,  }\item[{logical, intent(in), optional}]{compare\+\_\+\+P\+Es }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



chksum1d does a checksum of a 1-\/dimensional array. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em array} & The array to be summed (index starts at 1).\\
\hline
\mbox{\tt in}  & {\em mesg} & An identifying message.\\
\hline
\mbox{\tt in}  & {\em start\+\_\+i} & The starting index for the sum (default 1)\\
\hline
\mbox{\tt in}  & {\em end\+\_\+i} & The ending index for the sum (default all)\\
\hline
\mbox{\tt in}  & {\em compare\+\_\+pes} & If true, compare across P\+Es instead of summing and list the root\+\_\+\+PE value (default true) \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}
1887   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(in)} :: array\textcolor{comment}{   !< The array to be summed (index starts at 1).}
1888   \textcolor{keywordtype}{character(len=*)},   \textcolor{keywordtype}{intent(in)} :: mesg\textcolor{comment}{    !< An identifying message.}
1889   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional},  \textcolor{keywordtype}{intent(in)} :: start\_i\textcolor{comment}{ !< The starting index for the sum (default 1)}
1890   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{optional},  \textcolor{keywordtype}{intent(in)} :: end\_i\textcolor{comment}{   !< The ending index for the sum (default all)}
1891   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{optional},  \textcolor{keywordtype}{intent(in)} :: compare\_pes\textcolor{comment}{ !< If true, compare across PEs instead of summing}
1892 \textcolor{comment}{                                                !! and list the root\_PE value (default true)}
1893 
1894   \textcolor{keywordtype}{integer} :: is, ie, i, bc, sum1, sum\_bc
1895   \textcolor{keywordtype}{real} :: sum
1896   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{allocatable} :: sum\_here(:)
1897   \textcolor{keywordtype}{logical} :: compare
1898   \textcolor{keywordtype}{integer} :: pe\_num   \textcolor{comment}{! pe number of the data}
1899   \textcolor{keywordtype}{integer} :: npes     \textcolor{comment}{! Total number of processsors}
1900 
1901   is = lbound(array,1) ; ie = ubound(array,1)
1902   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(start\_i)) is = start\_i
1903   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(end\_i)) ie = end\_i
1904   compare = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(compare\_pes)) compare = compare\_pes
1905 
1906   sum = 0.0 ; sum\_bc = 0
1907   \textcolor{keywordflow}{do} i=is,ie
1908     sum = sum + array(i)
1909     bc = bitcount(abs(array(i)))
1910     sum\_bc = sum\_bc + bc
1911 \textcolor{keywordflow}{  enddo}
1912 
1913   pe\_num = pe\_here() + 1 - root\_pe() ; npes = num\_pes()
1914   \textcolor{keyword}{allocate}(sum\_here(npes)) ; sum\_here(:) = 0.0 ; sum\_here(pe\_num) = sum
1915   \textcolor{keyword}{call }sum\_across\_pes(sum\_here,npes)
1916 
1917   sum1 = sum\_bc
1918   \textcolor{keyword}{call }sum\_across\_pes(sum1)
1919 
1920   \textcolor{keywordflow}{if} (.not.compare) \textcolor{keywordflow}{then}
1921     sum = 0.0
1922     \textcolor{keywordflow}{do} i=1,npes ; sum = sum + sum\_here(i) ;\textcolor{keywordflow}{ enddo}
1923     sum\_bc = sum1
1924   \textcolor{keywordflow}{elseif} (is\_root\_pe()) \textcolor{keywordflow}{then}
1925     \textcolor{keywordflow}{if} (sum1 /= npes*sum\_bc) &
1926       \textcolor{keyword}{write}(0, \textcolor{stringliteral}{'(A40," bitcounts do not match across PEs: ",I12,1X,I12)'}) &
1927             mesg, sum1, npes*sum\_bc
1928     \textcolor{keywordflow}{do} i=1,npes ; \textcolor{keywordflow}{if} (sum /= sum\_here(i)) \textcolor{keywordflow}{then}
1929       \textcolor{keyword}{write}(0, \textcolor{stringliteral}{'(A40," PE ",i4," sum mismatches root\_PE: ",3(ES22.13,1X))'}) &
1930             mesg, i, sum\_here(i), sum, sum\_here(i)-sum
1931 \textcolor{keywordflow}{    endif} ;\textcolor{keywordflow}{ enddo}
1932 \textcolor{keywordflow}{  endif}
1933   \textcolor{keyword}{deallocate}(sum\_here)
1934 
1935   \textcolor{keywordflow}{if} (is\_root\_pe()) &
1936     \textcolor{keyword}{write}(0,\textcolor{stringliteral}{'(A50,1X,ES25.16,1X,I12)'}) mesg, sum, sum\_bc
1937 
\end{DoxyCode}
\mbox{\Hypertarget{interfacemom__checksums_1_1chksum_a2fba13939b2a2b0752cf960bd7fc9e17}\label{interfacemom__checksums_1_1chksum_a2fba13939b2a2b0752cf960bd7fc9e17}} 
\index{mom\+\_\+checksums\+::chksum@{mom\+\_\+checksums\+::chksum}!chksum2d@{chksum2d}}
\index{chksum2d@{chksum2d}!mom\+\_\+checksums\+::chksum@{mom\+\_\+checksums\+::chksum}}
\subsubsection{\texorpdfstring{chksum2d()}{chksum2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+checksums\+::chksum\+::chksum2d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:)}]{array,  }\item[{character(len=$\ast$)}]{mesg }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



chksum2d does a checksum of all data in a 2-\/d array. 


\begin{DoxyParams}{Parameters}
{\em array} & The array to be checksummed\\
\hline
{\em mesg} & An identifying message \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}
1945 
1946   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:)} :: array\textcolor{comment}{ !< The array to be checksummed}
1947   \textcolor{keywordtype}{character(len=*)} :: mesg\textcolor{comment}{  !< An identifying message}
1948 
1949   \textcolor{keywordtype}{integer} :: xs,xe,ys,ye,i,j,sum1,bc
1950   \textcolor{keywordtype}{real} :: sum
1951 
1952   xs = lbound(array,1) ; xe = ubound(array,1)
1953   ys = lbound(array,2) ; ye = ubound(array,2)
1954 
1955   sum = 0.0 ; sum1 = 0
1956   \textcolor{keywordflow}{do} i=xs,xe ; \textcolor{keywordflow}{do} j=ys,ye
1957     bc = bitcount(abs(array(i,j)))
1958     sum1 = sum1 + bc
1959 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}
1960   \textcolor{keyword}{call }sum\_across\_pes(sum1)
1961 
1962   sum = reproducing\_sum(array(:,:))
1963 
1964   \textcolor{keywordflow}{if} (is\_root\_pe()) &
1965     \textcolor{keyword}{write}(0,\textcolor{stringliteral}{'(A50,1X,ES25.16,1X,I12)'}) mesg, sum, sum1
1966 \textcolor{comment}{!    write(0,'(A40,1X,Z16.16,1X,Z16.16,1X,ES25.16,1X,I12)') &}
1967 \textcolor{comment}{!      mesg, sum, sum1, sum, sum1}
1968 
\end{DoxyCode}
\mbox{\Hypertarget{interfacemom__checksums_1_1chksum_a6d57100cdc39c849d3c55fc182859ef1}\label{interfacemom__checksums_1_1chksum_a6d57100cdc39c849d3c55fc182859ef1}} 
\index{mom\+\_\+checksums\+::chksum@{mom\+\_\+checksums\+::chksum}!chksum3d@{chksum3d}}
\index{chksum3d@{chksum3d}!mom\+\_\+checksums\+::chksum@{mom\+\_\+checksums\+::chksum}}
\subsubsection{\texorpdfstring{chksum3d()}{chksum3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+checksums\+::chksum\+::chksum3d (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:,\+:)}]{array,  }\item[{character(len=$\ast$)}]{mesg }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



chksum3d does a checksum of all data in a 2-\/d array. 


\begin{DoxyParams}{Parameters}
{\em array} & The array to be checksummed\\
\hline
{\em mesg} & An identifying message \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}
1973 
1974   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:,:)} :: array\textcolor{comment}{ !< The array to be checksummed}
1975   \textcolor{keywordtype}{character(len=*)} :: mesg\textcolor{comment}{  !< An identifying message}
1976 
1977   \textcolor{keywordtype}{integer} :: xs,xe,ys,ye,zs,ze,i,j,k, bc,sum1
1978   \textcolor{keywordtype}{real} :: sum
1979 
1980   xs = lbound(array,1) ; xe = ubound(array,1)
1981   ys = lbound(array,2) ; ye = ubound(array,2)
1982   zs = lbound(array,3) ; ze = ubound(array,3)
1983 
1984   sum = 0.0 ; sum1 = 0
1985   \textcolor{keywordflow}{do} i=xs,xe ; \textcolor{keywordflow}{do} j=ys,ye ; \textcolor{keywordflow}{do} k=zs,ze
1986     bc = bitcount(abs(array(i,j,k)))
1987     sum1 = sum1 + bc
1988 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}
1989 
1990   \textcolor{keyword}{call }sum\_across\_pes(sum1)
1991   sum = reproducing\_sum(array(:,:,:))
1992 
1993   \textcolor{keywordflow}{if} (is\_root\_pe()) &
1994     \textcolor{keyword}{write}(0,\textcolor{stringliteral}{'(A50,1X,ES25.16,1X,I12)'}) mesg, sum, sum1
1995 \textcolor{comment}{!    write(0,'(A40,1X,Z16.16,1X,Z16.16,1X,ES25.16,1X,I12)') &}
1996 \textcolor{comment}{!      mesg, sum, sum1, sum, sum1}
1997 
\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}
