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


\doxysubsection{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.

\doxysubsection*{Private functions}
\begin{DoxyCompactItemize}
\item 
subroutine \mbox{\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 \mbox{\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 \mbox{\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}


\doxysubsection{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.



\doxysubsection{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}}
\doxysubsubsection{\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{\texttt{ in}}  & {\em array} & The array to be summed (index starts at 1). \\
\hline
\mbox{\texttt{ in}}  & {\em mesg} & An identifying message. \\
\hline
\mbox{\texttt{ in}}  & {\em start\+\_\+i} & The starting index for the sum (default 1) \\
\hline
\mbox{\texttt{ in}}  & {\em end\+\_\+i} & The ending index for the sum (default all) \\
\hline
\mbox{\texttt{ 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 1886 of file M\+O\+M\+\_\+checksums.\+F90.


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


\begin{DoxyCode}{0}
\DoxyCodeLine{1945 }
\DoxyCodeLine{1946 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:)} :: array\textcolor{comment}{ !< The array to be checksummed}}
\DoxyCodeLine{1947   \textcolor{keywordtype}{character(len=*)} :: mesg\textcolor{comment}{  !< An identifying message}}
\DoxyCodeLine{1948 }
\DoxyCodeLine{1949   \textcolor{keywordtype}{integer} :: xs,xe,ys,ye,i,j,sum1,bc}
\DoxyCodeLine{1950 \textcolor{keywordtype}{  real} :: sum}
\DoxyCodeLine{1951 }
\DoxyCodeLine{1952   xs = lbound(array,1) ; xe = ubound(array,1)}
\DoxyCodeLine{1953   ys = lbound(array,2) ; ye = ubound(array,2)}
\DoxyCodeLine{1954 }
\DoxyCodeLine{1955   sum = 0.0 ; sum1 = 0}
\DoxyCodeLine{1956   \textcolor{keywordflow}{do} i=xs,xe ; \textcolor{keywordflow}{do} j=ys,ye}
\DoxyCodeLine{1957     bc = bitcount(abs(array(i,j)))}
\DoxyCodeLine{1958     sum1 = sum1 + bc}
\DoxyCodeLine{1959 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{1960   \textcolor{keyword}{call }sum\_across\_pes(sum1)}
\DoxyCodeLine{1961 }
\DoxyCodeLine{1962   sum = reproducing\_sum(array(:,:))}
\DoxyCodeLine{1963 }
\DoxyCodeLine{1964   \textcolor{keywordflow}{if} (is\_root\_pe()) \&}
\DoxyCodeLine{1965     \textcolor{keyword}{write}(0,\textcolor{stringliteral}{'(A50,1X,ES25.16,1X,I12)'}) mesg, sum, sum1}
\DoxyCodeLine{1966 \textcolor{comment}{!    write(0,'(A40,1X,Z16.16,1X,Z16.16,1X,ES25.16,1X,I12)') \&}}
\DoxyCodeLine{1967 \textcolor{comment}{!      mesg, sum, sum1, sum, sum1}}
\DoxyCodeLine{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}}
\doxysubsubsection{\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 1972 of file M\+O\+M\+\_\+checksums.\+F90.


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