\hypertarget{namespacemom__debugging}{}\section{mom\+\_\+debugging Module Reference}
\label{namespacemom__debugging}\index{mom\_debugging@{mom\_debugging}}


\subsection{Detailed Description}
Provides checksumming functions for debugging. 

This module contains subroutines that perform various error checking and debugging functions for M\+O\+M6. This routine is similar to it counterpart in the S\+I\+S2 code, except for the use of the ocean\+\_\+grid\+\_\+type and by keeping them separate we retain the ability to set up M\+O\+M6 and S\+I\+S2 debugging separately. \subsection*{Data Types}
\begin{DoxyCompactItemize}
\item 
interface \mbox{\hyperlink{interfacemom__debugging_1_1check__redundant}{check\+\_\+redundant}}
\begin{DoxyCompactList}\small\item\em Check for consistency between the duplicated points of a C-\/grid vector. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__debugging_1_1check__redundant__b}{check\+\_\+redundant\+\_\+b}}
\begin{DoxyCompactList}\small\item\em Check for consistency between the duplicated points of a B-\/grid vector or scalar. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__debugging_1_1check__redundant__c}{check\+\_\+redundant\+\_\+c}}
\begin{DoxyCompactList}\small\item\em Check for consistency between the duplicated points of a C-\/grid vector. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__debugging_1_1check__redundant__t}{check\+\_\+redundant\+\_\+t}}
\begin{DoxyCompactList}\small\item\em Check for consistency between the duplicated points of an A-\/grid vector or scalar. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__debugging_1_1vec__chksum}{vec\+\_\+chksum}}
\begin{DoxyCompactList}\small\item\em Do checksums on the components of a C-\/grid vector. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__debugging_1_1vec__chksum__a}{vec\+\_\+chksum\+\_\+a}}
\begin{DoxyCompactList}\small\item\em Do checksums on the components of an A-\/grid vector. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__debugging_1_1vec__chksum__b}{vec\+\_\+chksum\+\_\+b}}
\begin{DoxyCompactList}\small\item\em Do checksums on the components of a B-\/grid vector. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__debugging_1_1vec__chksum__c}{vec\+\_\+chksum\+\_\+c}}
\begin{DoxyCompactList}\small\item\em Do checksums on the components of a C-\/grid vector. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \mbox{\hyperlink{namespacemom__debugging_a6b65b94cacf1435ce1a593c2b03f40c8}{mom\+\_\+debugging\+\_\+init}} (param\+\_\+file)
\begin{DoxyCompactList}\small\item\em M\+O\+M\+\_\+debugging\+\_\+init initializes the M\+O\+M\+\_\+debugging module, and sets the parameterts that control which checks are active for M\+O\+M6. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__debugging_a810c5bc7956b4735d2d6c0fa30cf1ef6}{check\+\_\+redundant\+\_\+vc3d}} (mesg, u\+\_\+comp, v\+\_\+comp, G, is, ie, js, je, direction)
\begin{DoxyCompactList}\small\item\em Check for consistency between the duplicated points of a 3-\/D C-\/grid vector. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__debugging_a764937fe64b416cc93b28ec646f2e21b}{check\+\_\+redundant\+\_\+vc2d}} (mesg, u\+\_\+comp, v\+\_\+comp, G, is, ie, js, je, direction)
\begin{DoxyCompactList}\small\item\em Check for consistency between the duplicated points of a 2-\/D C-\/grid vector. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__debugging_ad65b8f68f5c940f3b4c1fa322a334657}{check\+\_\+redundant\+\_\+sb3d}} (mesg, array, G, is, ie, js, je)
\begin{DoxyCompactList}\small\item\em Check for consistency between the duplicated points of a 3-\/D scalar at corner points. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__debugging_a30f0883aa7a65b8e39b0da6de34afb59}{check\+\_\+redundant\+\_\+sb2d}} (mesg, array, G, is, ie, js, je)
\begin{DoxyCompactList}\small\item\em Check for consistency between the duplicated points of a 2-\/D scalar at corner points. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__debugging_a1d85ea0234c675fb2b42cb1074f70340}{check\+\_\+redundant\+\_\+vb3d}} (mesg, u\+\_\+comp, v\+\_\+comp, G, is, ie, js, je, direction)
\begin{DoxyCompactList}\small\item\em Check for consistency between the duplicated points of a 3-\/D B-\/grid vector. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__debugging_a4d8a15fa84cda4a4fe3dfc3158539445}{check\+\_\+redundant\+\_\+vb2d}} (mesg, u\+\_\+comp, v\+\_\+comp, G, is, ie, js, je, direction)
\begin{DoxyCompactList}\small\item\em Check for consistency between the duplicated points of a 2-\/D B-\/grid vector. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__debugging_a8afdb938cede34a10ea0838339b05654}{check\+\_\+redundant\+\_\+st3d}} (mesg, array, G, is, ie, js, je)
\begin{DoxyCompactList}\small\item\em Check for consistency between the duplicated points of a 3-\/D scalar at tracer points. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__debugging_a0bd233b19527a7e2cd2e345488ad90a8}{check\+\_\+redundant\+\_\+st2d}} (mesg, array, G, is, ie, js, je)
\begin{DoxyCompactList}\small\item\em Check for consistency between the duplicated points of a 2-\/D scalar at tracer points. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__debugging_aaa0097c89c865d9f226f895c7bb19904}{check\+\_\+redundant\+\_\+vt3d}} (mesg, u\+\_\+comp, v\+\_\+comp, G, is, ie, js, je, direction)
\begin{DoxyCompactList}\small\item\em Check for consistency between the duplicated points of a 3-\/D A-\/grid vector. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__debugging_ad30d2c18e907363c1f62dff0106c2fee}{check\+\_\+redundant\+\_\+vt2d}} (mesg, u\+\_\+comp, v\+\_\+comp, G, is, ie, js, je, direction)
\begin{DoxyCompactList}\small\item\em Check for consistency between the duplicated points of a 2-\/D A-\/grid vector. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__debugging_a6ff3e4eeb933a992d78dbc771d62bfc1}{chksum\+\_\+vec\+\_\+c3d}} (mesg, u\+\_\+comp, v\+\_\+comp, G, halos, scalars)
\begin{DoxyCompactList}\small\item\em Do a checksum and redundant point check on a 3d C-\/grid vector. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__debugging_a0ec85b9298cb751749a46c33a5415a69}{chksum\+\_\+vec\+\_\+c2d}} (mesg, u\+\_\+comp, v\+\_\+comp, G, halos, scalars)
\begin{DoxyCompactList}\small\item\em Do a checksum and redundant point check on a 2d C-\/grid vector. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__debugging_ad66ab7451d216eb9f8136e10142d9b22}{chksum\+\_\+vec\+\_\+b3d}} (mesg, u\+\_\+comp, v\+\_\+comp, G, halos, scalars)
\begin{DoxyCompactList}\small\item\em Do a checksum and redundant point check on a 3d B-\/grid vector. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__debugging_ab480752dac4d519fb8b37438c7a696da}{chksum\+\_\+vec\+\_\+b2d}} (mesg, u\+\_\+comp, v\+\_\+comp, G, halos, scalars, symmetric)
\item 
subroutine \mbox{\hyperlink{namespacemom__debugging_aab19ba6d8d509d831102929dc636ea4e}{chksum\+\_\+vec\+\_\+a3d}} (mesg, u\+\_\+comp, v\+\_\+comp, G, halos, scalars)
\begin{DoxyCompactList}\small\item\em Do a checksum and redundant point check on a 3d C-\/grid vector. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__debugging_a8a9901e010cdb264dbd8f8b3513eba1d}{chksum\+\_\+vec\+\_\+a2d}} (mesg, u\+\_\+comp, v\+\_\+comp, G, halos, scalars)
\begin{DoxyCompactList}\small\item\em Do a checksum and redundant point check on a 2d C-\/grid vector. \end{DoxyCompactList}\item 
real function, public \mbox{\hyperlink{namespacemom__debugging_a2fef51731d0369bea648bd7c39936940}{totalstuff}} (HI, h\+Thick, areaT, stuff)
\begin{DoxyCompactList}\small\item\em This function returns the sum over computational domain of all processors of h\+Thick$\ast$stuff, where stuff is a 3-\/d array at tracer points. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__debugging_af436163fcb320db3d9b34e86d0e33e86}{totaltands}} (HI, h\+Thick, areaT, temperature, salinity, mesg)
\begin{DoxyCompactList}\small\item\em This subroutine display the total thickness, temperature and salinity as well as the change since the last call. \end{DoxyCompactList}\item 
logical function, public \mbox{\hyperlink{namespacemom__debugging_a186573d3fb332e1640dbe9ecffe11f3b}{check\+\_\+column\+\_\+integral}} (nk, field, known\+\_\+answer)
\begin{DoxyCompactList}\small\item\em Returns false if the column integral of a given quantity is within roundoff. \end{DoxyCompactList}\item 
logical function, public \mbox{\hyperlink{namespacemom__debugging_af1e942023de249345f52c931aed2cc5f}{check\+\_\+column\+\_\+integrals}} (nk\+\_\+1, field\+\_\+1, nk\+\_\+2, field\+\_\+2, missing\+\_\+value)
\begin{DoxyCompactList}\small\item\em Returns false if the column integrals of two given quantities are within roundoff of each other. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{namespacemom__debugging_a01a02decbce243d6cc7605a3b78d776a}\label{namespacemom__debugging_a01a02decbce243d6cc7605a3b78d776a}} 
integer \mbox{\hyperlink{namespacemom__debugging_a01a02decbce243d6cc7605a3b78d776a}{max\+\_\+redundant\+\_\+prints}} = 100
\begin{DoxyCompactList}\small\item\em Maximum number of times to write redundant messages. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__debugging_a8d2ab90f8888b51f9471e266d12a2539}\label{namespacemom__debugging_a8d2ab90f8888b51f9471e266d12a2539}} 
integer, dimension(3) \mbox{\hyperlink{namespacemom__debugging_a8d2ab90f8888b51f9471e266d12a2539}{redundant\+\_\+prints}} = 0
\begin{DoxyCompactList}\small\item\em Counters for controlling redundant printing. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__debugging_a913bcff274a97326d5b4dd41c6cf9522}\label{namespacemom__debugging_a913bcff274a97326d5b4dd41c6cf9522}} 
logical \mbox{\hyperlink{namespacemom__debugging_a913bcff274a97326d5b4dd41c6cf9522}{debug}} = .false.
\begin{DoxyCompactList}\small\item\em Write out verbose debugging data. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__debugging_a365c7b54a2041311a41fe0fae933d346}\label{namespacemom__debugging_a365c7b54a2041311a41fe0fae933d346}} 
logical \mbox{\hyperlink{namespacemom__debugging_a365c7b54a2041311a41fe0fae933d346}{debug\+\_\+chksums}} = .true.
\begin{DoxyCompactList}\small\item\em Perform checksums on arrays. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__debugging_ae8d448d9758178275218779811446b4a}\label{namespacemom__debugging_ae8d448d9758178275218779811446b4a}} 
logical \mbox{\hyperlink{namespacemom__debugging_ae8d448d9758178275218779811446b4a}{debug\+\_\+redundant}} = .true.
\begin{DoxyCompactList}\small\item\em Check redundant values on PE boundaries. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacemom__debugging_a186573d3fb332e1640dbe9ecffe11f3b}\label{namespacemom__debugging_a186573d3fb332e1640dbe9ecffe11f3b}} 
\index{mom\_debugging@{mom\_debugging}!check\_column\_integral@{check\_column\_integral}}
\index{check\_column\_integral@{check\_column\_integral}!mom\_debugging@{mom\_debugging}}
\subsubsection{\texorpdfstring{check\_column\_integral()}{check\_column\_integral()}}
{\footnotesize\ttfamily logical function, public mom\+\_\+debugging\+::check\+\_\+column\+\_\+integral (\begin{DoxyParamCaption}\item[{integer, intent(in)}]{nk,  }\item[{real, dimension(nk), intent(in)}]{field,  }\item[{real, intent(in), optional}]{known\+\_\+answer }\end{DoxyParamCaption})}



Returns false if the column integral of a given quantity is within roundoff. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em nk} & Number of levels in column \\
\hline
\mbox{\texttt{ in}}  & {\em field} & Field to be summed \\
\hline
\mbox{\texttt{ in}}  & {\em known\+\_\+answer} & If present is the expected sum, If missing, assumed zero \\
\hline
\end{DoxyParams}


Definition at line 790 of file M\+O\+M\+\_\+debugging.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{790   \textcolor{keywordtype}{integer},             \textcolor{keywordtype}{intent(in)} :: nk\textcolor{comment}{           !< Number of levels in column}}
\DoxyCodeLine{791 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(nk)}, \textcolor{keywordtype}{intent(in)} :: field\textcolor{comment}{        !< Field to be summed}}
\DoxyCodeLine{792 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{optional},      \textcolor{keywordtype}{intent(in)} :: known\_answer\textcolor{comment}{ !< If present is the expected sum,}}
\DoxyCodeLine{793 \textcolor{comment}{                                                  !! If missing, assumed zero}}
\DoxyCodeLine{794   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{795 \textcolor{keywordtype}{  real}    :: u\_sum, error, expected}
\DoxyCodeLine{796   \textcolor{keywordtype}{integer} :: k}
\DoxyCodeLine{797 }
\DoxyCodeLine{798   u\_sum = field(1)}
\DoxyCodeLine{799   error = 0.}
\DoxyCodeLine{800 }
\DoxyCodeLine{801   \textcolor{comment}{! Reintegrate and sum roundoff errors}}
\DoxyCodeLine{802   \textcolor{keywordflow}{do} k=2,nk}
\DoxyCodeLine{803     u\_sum = u\_sum + field(k)}
\DoxyCodeLine{804     error = error + epsilon(u\_sum)*max(abs(u\_sum),abs(field(k)))}
\DoxyCodeLine{805 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{806 }
\DoxyCodeLine{807   \textcolor{comment}{! Assign expected answer to either the optional input or 0}}
\DoxyCodeLine{808   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(known\_answer)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{809     expected = known\_answer}
\DoxyCodeLine{810   \textcolor{keywordflow}{else}}
\DoxyCodeLine{811     expected = 0.}
\DoxyCodeLine{812 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{813 }
\DoxyCodeLine{814   \textcolor{comment}{! Compare the column integrals against calculated roundoff error}}
\DoxyCodeLine{815   \textcolor{keywordflow}{if} (abs(u\_sum-expected) > error) \textcolor{keywordflow}{then}}
\DoxyCodeLine{816     check\_column\_integral = .true.}
\DoxyCodeLine{817   \textcolor{keywordflow}{else}}
\DoxyCodeLine{818     check\_column\_integral = .false.}
\DoxyCodeLine{819 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{820 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__debugging_af1e942023de249345f52c931aed2cc5f}\label{namespacemom__debugging_af1e942023de249345f52c931aed2cc5f}} 
\index{mom\_debugging@{mom\_debugging}!check\_column\_integrals@{check\_column\_integrals}}
\index{check\_column\_integrals@{check\_column\_integrals}!mom\_debugging@{mom\_debugging}}
\subsubsection{\texorpdfstring{check\_column\_integrals()}{check\_column\_integrals()}}
{\footnotesize\ttfamily logical function, public mom\+\_\+debugging\+::check\+\_\+column\+\_\+integrals (\begin{DoxyParamCaption}\item[{integer, intent(in)}]{nk\+\_\+1,  }\item[{real, dimension(nk\+\_\+1), intent(in)}]{field\+\_\+1,  }\item[{integer, intent(in)}]{nk\+\_\+2,  }\item[{real, dimension(nk\+\_\+2), intent(in)}]{field\+\_\+2,  }\item[{real, intent(in), optional}]{missing\+\_\+value }\end{DoxyParamCaption})}



Returns false if the column integrals of two given quantities are within roundoff of each other. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em nk\+\_\+1} & Number of levels in field 1 \\
\hline
\mbox{\texttt{ in}}  & {\em nk\+\_\+2} & Number of levels in field 2 \\
\hline
\mbox{\texttt{ in}}  & {\em field\+\_\+1} & First field to be summed \\
\hline
\mbox{\texttt{ in}}  & {\em field\+\_\+2} & Second field to be summed \\
\hline
\mbox{\texttt{ in}}  & {\em missing\+\_\+value} & If column contains missing values, mask them from the sum \\
\hline
\end{DoxyParams}


Definition at line 825 of file M\+O\+M\+\_\+debugging.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{825   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{intent(in)} :: nk\_1\textcolor{comment}{           !< Number of levels in field 1}}
\DoxyCodeLine{826   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{intent(in)} :: nk\_2\textcolor{comment}{           !< Number of levels in field 2}}
\DoxyCodeLine{827 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(nk\_1)}, \textcolor{keywordtype}{intent(in)} :: field\_1\textcolor{comment}{        !< First field to be summed}}
\DoxyCodeLine{828 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(nk\_2)}, \textcolor{keywordtype}{intent(in)} :: field\_2\textcolor{comment}{        !< Second field to be summed}}
\DoxyCodeLine{829 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{optional},        \textcolor{keywordtype}{intent(in)} :: missing\_value\textcolor{comment}{  !< If column contains missing values,}}
\DoxyCodeLine{830 \textcolor{comment}{                                                      !! mask them from the sum}}
\DoxyCodeLine{831   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{832 \textcolor{keywordtype}{  real}    :: u1\_sum, error1, u2\_sum, error2, misval}
\DoxyCodeLine{833   \textcolor{keywordtype}{integer} :: k}
\DoxyCodeLine{834 }
\DoxyCodeLine{835   \textcolor{comment}{! Assign missing value}}
\DoxyCodeLine{836   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(missing\_value)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{837     misval = missing\_value}
\DoxyCodeLine{838   \textcolor{keywordflow}{else}}
\DoxyCodeLine{839     misval = 0.}
\DoxyCodeLine{840 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{841 }
\DoxyCodeLine{842   u1\_sum = field\_1(1)}
\DoxyCodeLine{843   error1 = 0.}
\DoxyCodeLine{844 }
\DoxyCodeLine{845   \textcolor{comment}{! Reintegrate and sum roundoff errors}}
\DoxyCodeLine{846   \textcolor{keywordflow}{do} k=2,nk\_1}
\DoxyCodeLine{847     \textcolor{keywordflow}{if} (field\_1(k)/=misval) \textcolor{keywordflow}{then}}
\DoxyCodeLine{848       u1\_sum = u1\_sum + field\_1(k)}
\DoxyCodeLine{849       error1 = error1 + epsilon(u1\_sum)*max(abs(u1\_sum),abs(field\_1(k)))}
\DoxyCodeLine{850 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{851 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{852 }
\DoxyCodeLine{853   u2\_sum = field\_2(1)}
\DoxyCodeLine{854   error2 = 0.}
\DoxyCodeLine{855 }
\DoxyCodeLine{856   \textcolor{comment}{! Reintegrate and sum roundoff errors}}
\DoxyCodeLine{857   \textcolor{keywordflow}{do} k=2,nk\_2}
\DoxyCodeLine{858     \textcolor{keywordflow}{if} (field\_2(k)/=misval) \textcolor{keywordflow}{then}}
\DoxyCodeLine{859       u2\_sum = u2\_sum + field\_2(k)}
\DoxyCodeLine{860       error2 = error2 + epsilon(u2\_sum)*max(abs(u2\_sum),abs(field\_2(k)))}
\DoxyCodeLine{861 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{862 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{863 }
\DoxyCodeLine{864   \textcolor{comment}{! Compare the column integrals against calculated roundoff error}}
\DoxyCodeLine{865   \textcolor{keywordflow}{if} (abs(u1\_sum-u2\_sum) > (error1+error2)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{866     check\_column\_integrals = .true.}
\DoxyCodeLine{867   \textcolor{keywordflow}{else}}
\DoxyCodeLine{868     check\_column\_integrals = .false.}
\DoxyCodeLine{869 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{870 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__debugging_a30f0883aa7a65b8e39b0da6de34afb59}\label{namespacemom__debugging_a30f0883aa7a65b8e39b0da6de34afb59}} 
\index{mom\_debugging@{mom\_debugging}!check\_redundant\_sb2d@{check\_redundant\_sb2d}}
\index{check\_redundant\_sb2d@{check\_redundant\_sb2d}!mom\_debugging@{mom\_debugging}}
\subsubsection{\texorpdfstring{check\_redundant\_sb2d()}{check\_redundant\_sb2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+debugging\+::check\+\_\+redundant\+\_\+sb2d (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{mesg,  }\item[{real, dimension(g\%isdb\+:,g\%jsdb\+:), intent(in)}]{array,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(inout)}]{G,  }\item[{integer, intent(in), optional}]{is,  }\item[{integer, intent(in), optional}]{ie,  }\item[{integer, intent(in), optional}]{js,  }\item[{integer, intent(in), optional}]{je }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Check for consistency between the duplicated points of a 2-\/D scalar at corner points. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em mesg} & An identifying message \\
\hline
\mbox{\texttt{ in,out}}  & {\em g} & The ocean\textquotesingle{}s grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em array} & The array to be checked for consistency \\
\hline
\mbox{\texttt{ in}}  & {\em is} & The starting i-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em ie} & The ending i-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em js} & The starting j-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em je} & The ending j-\/index to check \\
\hline
\end{DoxyParams}


Definition at line 236 of file M\+O\+M\+\_\+debugging.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{236   \textcolor{keywordtype}{character(len=*)},                 \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{  !< An identifying message}}
\DoxyCodeLine{237   \textcolor{keywordtype}{type}(ocean\_grid\_type),            \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{     !< The ocean's grid structure}}
\DoxyCodeLine{238 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%IsdB:,G\%JsdB:)}, \textcolor{keywordtype}{intent(in)}    :: array\textcolor{comment}{ !< The array to be checked for consistency}}
\DoxyCodeLine{239   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: is\textcolor{comment}{    !< The starting i-index to check}}
\DoxyCodeLine{240   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: ie\textcolor{comment}{    !< The ending i-index to check}}
\DoxyCodeLine{241   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: js\textcolor{comment}{    !< The starting j-index to check}}
\DoxyCodeLine{242   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: je\textcolor{comment}{    !< The ending j-index to check}}
\DoxyCodeLine{243   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{244 \textcolor{keywordtype}{  real} :: a\_nonsym(G\%isd:G\%ied,G\%jsd:G\%jed)}
\DoxyCodeLine{245 \textcolor{keywordtype}{  real} :: a\_resym(G\%IsdB:G\%IedB,G\%JsdB:G\%JedB)}
\DoxyCodeLine{246   \textcolor{keywordtype}{character(len=128)} :: mesg2}
\DoxyCodeLine{247   \textcolor{keywordtype}{integer} :: i, j, is\_ch, ie\_ch, js\_ch, je\_ch}
\DoxyCodeLine{248   \textcolor{keywordtype}{integer} :: Isq, Ieq, Jsq, Jeq, isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB}
\DoxyCodeLine{249 }
\DoxyCodeLine{250   isq = g\%IscB ; ieq = g\%IecB ; jsq = g\%JscB ; jeq = g\%JecB}
\DoxyCodeLine{251   isd = g\%isd ; ied = g\%ied ; jsd = g\%jsd ; jed = g\%jed}
\DoxyCodeLine{252   isdb = g\%IsdB ; iedb = g\%IedB ; jsdb = g\%JsdB ; jedb = g\%JedB}
\DoxyCodeLine{253 }
\DoxyCodeLine{254   \textcolor{keywordflow}{if} (.not.(\textcolor{keyword}{present}(is) .or. \textcolor{keyword}{present}(ie) .or. \textcolor{keyword}{present}(js) .or. \textcolor{keyword}{present}(je))) \textcolor{keywordflow}{then}}
\DoxyCodeLine{255     \textcolor{comment}{! This only works with symmetric memory, so otherwise return.}}
\DoxyCodeLine{256     \textcolor{keywordflow}{if} ((isd == isdb) .and. (jsd == jsdb)) \textcolor{keywordflow}{return}}
\DoxyCodeLine{257 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{258 }
\DoxyCodeLine{259   \textcolor{keywordflow}{do} i=isd,ied ; \textcolor{keywordflow}{do} j=jsd,jed}
\DoxyCodeLine{260     a\_nonsym(i,j) = array(i,j)}
\DoxyCodeLine{261 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{262 }
\DoxyCodeLine{263   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(g\%Domain\_aux)) \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{" check\_redundant"}//\&}
\DoxyCodeLine{264     \textcolor{stringliteral}{" called with a non-associated auxiliary domain the grid type."})}
\DoxyCodeLine{265   \textcolor{keyword}{call }pass\_vector(a\_nonsym, a\_nonsym, g\%Domain\_aux, \&}
\DoxyCodeLine{266                    direction=to\_all+scalar\_pair, stagger=bgrid\_ne)}
\DoxyCodeLine{267 }
\DoxyCodeLine{268   \textcolor{keywordflow}{do} i=isdb,iedb ; \textcolor{keywordflow}{do} j=jsdb,jedb ; a\_resym(i,j) = array(i,j) ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{269   \textcolor{keywordflow}{do} i=isd,ied ; \textcolor{keywordflow}{do} j=jsd,jed}
\DoxyCodeLine{270     a\_resym(i,j) = a\_nonsym(i,j)}
\DoxyCodeLine{271 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{272   \textcolor{keyword}{call }pass\_vector(a\_resym, a\_resym, g\%Domain, direction=to\_all+scalar\_pair, \&}
\DoxyCodeLine{273                    stagger=bgrid\_ne)}
\DoxyCodeLine{274 }
\DoxyCodeLine{275   is\_ch = isq ; ie\_ch = ieq ; js\_ch = jsq ; je\_ch = jeq}
\DoxyCodeLine{276   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(is)) is\_ch = is ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(ie)) ie\_ch = ie}
\DoxyCodeLine{277   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(js)) js\_ch = js ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(js)) je\_ch = je}
\DoxyCodeLine{278 }
\DoxyCodeLine{279   \textcolor{keywordflow}{do} i=is\_ch,ie\_ch ; \textcolor{keywordflow}{do} j=js\_ch,je\_ch}
\DoxyCodeLine{280     \textcolor{keywordflow}{if} (a\_resym(i,j) /= array(i,j) .and. \&}
\DoxyCodeLine{281         redundant\_prints(2) < max\_redundant\_prints) \textcolor{keywordflow}{then}}
\DoxyCodeLine{282       \textcolor{keyword}{write}(mesg2,\textcolor{stringliteral}{'(" Redundant points",2(1pe12.4)," differ by ", \&}}
\DoxyCodeLine{283 \textcolor{stringliteral}{}\textcolor{stringliteral}{                    \& 1pe12.4," at i,j = ",2i4," on pe ",i4)'}) \&}
\DoxyCodeLine{284            array(i,j), a\_resym(i,j),array(i,j)-a\_resym(i,j),i,j,pe\_here()}
\DoxyCodeLine{285       \textcolor{keyword}{write}(0,\textcolor{stringliteral}{'(A130)'}) trim(mesg)//trim(mesg2)}
\DoxyCodeLine{286       redundant\_prints(2) = redundant\_prints(2) + 1}
\DoxyCodeLine{287 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{288 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{289 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__debugging_ad65b8f68f5c940f3b4c1fa322a334657}\label{namespacemom__debugging_ad65b8f68f5c940f3b4c1fa322a334657}} 
\index{mom\_debugging@{mom\_debugging}!check\_redundant\_sb3d@{check\_redundant\_sb3d}}
\index{check\_redundant\_sb3d@{check\_redundant\_sb3d}!mom\_debugging@{mom\_debugging}}
\subsubsection{\texorpdfstring{check\_redundant\_sb3d()}{check\_redundant\_sb3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+debugging\+::check\+\_\+redundant\+\_\+sb3d (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{mesg,  }\item[{real, dimension(g\%isdb\+:,g\%jsdb\+:,\+:), intent(in)}]{array,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(inout)}]{G,  }\item[{integer, intent(in), optional}]{is,  }\item[{integer, intent(in), optional}]{ie,  }\item[{integer, intent(in), optional}]{js,  }\item[{integer, intent(in), optional}]{je }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Check for consistency between the duplicated points of a 3-\/D scalar at corner points. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em mesg} & An identifying message \\
\hline
\mbox{\texttt{ in,out}}  & {\em g} & The ocean\textquotesingle{}s grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em array} & The array to be checked for consistency \\
\hline
\mbox{\texttt{ in}}  & {\em is} & The starting i-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em ie} & The ending i-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em js} & The starting j-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em je} & The ending j-\/index to check \\
\hline
\end{DoxyParams}


Definition at line 211 of file M\+O\+M\+\_\+debugging.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{211   \textcolor{keywordtype}{character(len=*)},                     \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{  !< An identifying message}}
\DoxyCodeLine{212   \textcolor{keywordtype}{type}(ocean\_grid\_type),                \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{     !< The ocean's grid structure}}
\DoxyCodeLine{213 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%IsdB:,G\%JsdB:,:)},   \textcolor{keywordtype}{intent(in)}    :: array\textcolor{comment}{ !< The array to be checked for consistency}}
\DoxyCodeLine{214   \textcolor{keywordtype}{integer},                    \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: is\textcolor{comment}{    !< The starting i-index to check}}
\DoxyCodeLine{215   \textcolor{keywordtype}{integer},                    \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: ie\textcolor{comment}{    !< The ending i-index to check}}
\DoxyCodeLine{216   \textcolor{keywordtype}{integer},                    \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: js\textcolor{comment}{    !< The starting j-index to check}}
\DoxyCodeLine{217   \textcolor{keywordtype}{integer},                    \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: je\textcolor{comment}{    !< The ending j-index to check}}
\DoxyCodeLine{218 }
\DoxyCodeLine{219   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{220   \textcolor{keywordtype}{character(len=24)} :: mesg\_k}
\DoxyCodeLine{221   \textcolor{keywordtype}{integer} :: k}
\DoxyCodeLine{222 }
\DoxyCodeLine{223   \textcolor{keywordflow}{do} k=1,\textcolor{keyword}{size}(array,3)}
\DoxyCodeLine{224     \textcolor{keywordflow}{if} (k < 10) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i2," ")'}) k}
\DoxyCodeLine{225     \textcolor{keywordflow}{elseif} (k < 100) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i3," ")'}) k}
\DoxyCodeLine{226     \textcolor{keywordflow}{elseif} (k < 1000) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i4," ")'}) k}
\DoxyCodeLine{227     \textcolor{keywordflow}{else} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i9," ")'}) k ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{228 }
\DoxyCodeLine{229     \textcolor{keyword}{call }check\_redundant\_sb2d(trim(mesg)//trim(mesg\_k), array(:,:,k), \&}
\DoxyCodeLine{230                               g, is, ie, js, je)}
\DoxyCodeLine{231 \textcolor{keywordflow}{  enddo}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__debugging_a0bd233b19527a7e2cd2e345488ad90a8}\label{namespacemom__debugging_a0bd233b19527a7e2cd2e345488ad90a8}} 
\index{mom\_debugging@{mom\_debugging}!check\_redundant\_st2d@{check\_redundant\_st2d}}
\index{check\_redundant\_st2d@{check\_redundant\_st2d}!mom\_debugging@{mom\_debugging}}
\subsubsection{\texorpdfstring{check\_redundant\_st2d()}{check\_redundant\_st2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+debugging\+::check\+\_\+redundant\+\_\+st2d (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{mesg,  }\item[{real, dimension(g\%isd\+:,g\%jsd\+:), intent(in)}]{array,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(inout)}]{G,  }\item[{integer, intent(in), optional}]{is,  }\item[{integer, intent(in), optional}]{ie,  }\item[{integer, intent(in), optional}]{js,  }\item[{integer, intent(in), optional}]{je }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Check for consistency between the duplicated points of a 2-\/D scalar at tracer points. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em mesg} & An identifying message \\
\hline
\mbox{\texttt{ in,out}}  & {\em g} & The ocean\textquotesingle{}s grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em array} & The array to be checked for consistency \\
\hline
\mbox{\texttt{ in}}  & {\em is} & The starting i-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em ie} & The ending i-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em js} & The starting j-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em je} & The ending j-\/index to check \\
\hline
\end{DoxyParams}


Definition at line 426 of file M\+O\+M\+\_\+debugging.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{426   \textcolor{keywordtype}{character(len=*)},                 \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{  !< An identifying message}}
\DoxyCodeLine{427   \textcolor{keywordtype}{type}(ocean\_grid\_type),            \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{     !< The ocean's grid structure}}
\DoxyCodeLine{428 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%isd:,G\%jsd:)},   \textcolor{keywordtype}{intent(in)}    :: array\textcolor{comment}{ !< The array to be checked for consistency}}
\DoxyCodeLine{429   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: is\textcolor{comment}{    !< The starting i-index to check}}
\DoxyCodeLine{430   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: ie\textcolor{comment}{    !< The ending i-index to check}}
\DoxyCodeLine{431   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: js\textcolor{comment}{    !< The starting j-index to check}}
\DoxyCodeLine{432   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: je\textcolor{comment}{    !< The ending j-index to check}}
\DoxyCodeLine{433   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{434 \textcolor{keywordtype}{  real} :: a\_nonsym(G\%isd:G\%ied,G\%jsd:G\%jed)}
\DoxyCodeLine{435   \textcolor{keywordtype}{character(len=128)} :: mesg2}
\DoxyCodeLine{436 }
\DoxyCodeLine{437   \textcolor{keywordtype}{integer} :: i, j, is\_ch, ie\_ch, js\_ch, je\_ch}
\DoxyCodeLine{438   \textcolor{keywordtype}{integer} :: Isq, Ieq, Jsq, Jeq, isd, ied, jsd, jed}
\DoxyCodeLine{439   isd = g\%isd ; ied = g\%ied ; jsd = g\%jsd ; jed = g\%jed}
\DoxyCodeLine{440 }
\DoxyCodeLine{441   is\_ch = g\%isc ; ie\_ch = g\%iec ; js\_ch = g\%jsc ; je\_ch = g\%jec}
\DoxyCodeLine{442   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(is)) is\_ch = is ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(ie)) ie\_ch = ie}
\DoxyCodeLine{443   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(js)) js\_ch = js ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(js)) je\_ch = je}
\DoxyCodeLine{444 }
\DoxyCodeLine{445   \textcolor{comment}{! This only works on points outside of the standard computational domain.}}
\DoxyCodeLine{446   \textcolor{keywordflow}{if} ((is\_ch == g\%isc) .and. (ie\_ch == g\%iec) .and. \&}
\DoxyCodeLine{447       (js\_ch == g\%jsc) .and. (je\_ch == g\%jec)) \textcolor{keywordflow}{return}}
\DoxyCodeLine{448 }
\DoxyCodeLine{449   \textcolor{keywordflow}{do} i=isd,ied ; \textcolor{keywordflow}{do} j=jsd,jed}
\DoxyCodeLine{450     a\_nonsym(i,j) = array(i,j)}
\DoxyCodeLine{451 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{452 }
\DoxyCodeLine{453   \textcolor{keyword}{call }pass\_var(a\_nonsym, g\%Domain)}
\DoxyCodeLine{454 }
\DoxyCodeLine{455   \textcolor{keywordflow}{do} i=is\_ch,ie\_ch ; \textcolor{keywordflow}{do} j=js\_ch,je\_ch}
\DoxyCodeLine{456     \textcolor{keywordflow}{if} (a\_nonsym(i,j) /= array(i,j) .and. \&}
\DoxyCodeLine{457         redundant\_prints(1) < max\_redundant\_prints) \textcolor{keywordflow}{then}}
\DoxyCodeLine{458       \textcolor{keyword}{write}(mesg2,\textcolor{stringliteral}{'(" Redundant points",2(1pe12.4)," differ by ", \&}}
\DoxyCodeLine{459 \textcolor{stringliteral}{}\textcolor{stringliteral}{                    \& 1pe12.4," at i,j = ",2i4," on pe ",i4)'}) \&}
\DoxyCodeLine{460            array(i,j), a\_nonsym(i,j),array(i,j)-a\_nonsym(i,j),i,j,pe\_here()}
\DoxyCodeLine{461       \textcolor{keyword}{write}(0,\textcolor{stringliteral}{'(A130)'}) trim(mesg)//trim(mesg2)}
\DoxyCodeLine{462      redundant\_prints(1) = redundant\_prints(1) + 1}
\DoxyCodeLine{463 \textcolor{keywordflow}{   endif}}
\DoxyCodeLine{464 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{465 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__debugging_a8afdb938cede34a10ea0838339b05654}\label{namespacemom__debugging_a8afdb938cede34a10ea0838339b05654}} 
\index{mom\_debugging@{mom\_debugging}!check\_redundant\_st3d@{check\_redundant\_st3d}}
\index{check\_redundant\_st3d@{check\_redundant\_st3d}!mom\_debugging@{mom\_debugging}}
\subsubsection{\texorpdfstring{check\_redundant\_st3d()}{check\_redundant\_st3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+debugging\+::check\+\_\+redundant\+\_\+st3d (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{mesg,  }\item[{real, dimension(g\%isd\+:,g\%jsd\+:,\+:), intent(in)}]{array,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(inout)}]{G,  }\item[{integer, intent(in), optional}]{is,  }\item[{integer, intent(in), optional}]{ie,  }\item[{integer, intent(in), optional}]{js,  }\item[{integer, intent(in), optional}]{je }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Check for consistency between the duplicated points of a 3-\/D scalar at tracer points. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em mesg} & An identifying message \\
\hline
\mbox{\texttt{ in,out}}  & {\em g} & The ocean\textquotesingle{}s grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em array} & The array to be checked for consistency \\
\hline
\mbox{\texttt{ in}}  & {\em is} & The starting i-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em ie} & The ending i-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em js} & The starting j-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em je} & The ending j-\/index to check \\
\hline
\end{DoxyParams}


Definition at line 401 of file M\+O\+M\+\_\+debugging.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{401   \textcolor{keywordtype}{character(len=*)},                     \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{  !< An identifying message}}
\DoxyCodeLine{402   \textcolor{keywordtype}{type}(ocean\_grid\_type),                \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{     !< The ocean's grid structure}}
\DoxyCodeLine{403 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%isd:,G\%jsd:,:)},     \textcolor{keywordtype}{intent(in)}    :: array\textcolor{comment}{ !< The array to be checked for consistency}}
\DoxyCodeLine{404   \textcolor{keywordtype}{integer},                    \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: is\textcolor{comment}{    !< The starting i-index to check}}
\DoxyCodeLine{405   \textcolor{keywordtype}{integer},                    \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: ie\textcolor{comment}{    !< The ending i-index to check}}
\DoxyCodeLine{406   \textcolor{keywordtype}{integer},                    \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: js\textcolor{comment}{    !< The starting j-index to check}}
\DoxyCodeLine{407   \textcolor{keywordtype}{integer},                    \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: je\textcolor{comment}{    !< The ending j-index to check}}
\DoxyCodeLine{408   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{409   \textcolor{keywordtype}{character(len=24)} :: mesg\_k}
\DoxyCodeLine{410   \textcolor{keywordtype}{integer} :: k}
\DoxyCodeLine{411 }
\DoxyCodeLine{412   \textcolor{keywordflow}{do} k=1,\textcolor{keyword}{size}(array,3)}
\DoxyCodeLine{413     \textcolor{keywordflow}{if} (k < 10) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i2," ")'}) k}
\DoxyCodeLine{414     \textcolor{keywordflow}{elseif} (k < 100) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i3," ")'}) k}
\DoxyCodeLine{415     \textcolor{keywordflow}{elseif} (k < 1000) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i4," ")'}) k}
\DoxyCodeLine{416     \textcolor{keywordflow}{else} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i9," ")'}) k ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{417 }
\DoxyCodeLine{418     \textcolor{keyword}{call }check\_redundant\_st2d(trim(mesg)//trim(mesg\_k), array(:,:,k), \&}
\DoxyCodeLine{419                               g, is, ie, js, je)}
\DoxyCodeLine{420 \textcolor{keywordflow}{  enddo}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__debugging_a4d8a15fa84cda4a4fe3dfc3158539445}\label{namespacemom__debugging_a4d8a15fa84cda4a4fe3dfc3158539445}} 
\index{mom\_debugging@{mom\_debugging}!check\_redundant\_vb2d@{check\_redundant\_vb2d}}
\index{check\_redundant\_vb2d@{check\_redundant\_vb2d}!mom\_debugging@{mom\_debugging}}
\subsubsection{\texorpdfstring{check\_redundant\_vb2d()}{check\_redundant\_vb2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+debugging\+::check\+\_\+redundant\+\_\+vb2d (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{mesg,  }\item[{real, dimension(g\%isdb\+:,g\%jsdb\+:), intent(in)}]{u\+\_\+comp,  }\item[{real, dimension(g\%isdb\+:,g\%jsdb\+:), intent(in)}]{v\+\_\+comp,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(inout)}]{G,  }\item[{integer, intent(in), optional}]{is,  }\item[{integer, intent(in), optional}]{ie,  }\item[{integer, intent(in), optional}]{js,  }\item[{integer, intent(in), optional}]{je,  }\item[{integer, intent(in), optional}]{direction }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Check for consistency between the duplicated points of a 2-\/D B-\/grid vector. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em mesg} & An identifying message \\
\hline
\mbox{\texttt{ in,out}}  & {\em g} & The ocean\textquotesingle{}s grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em u\+\_\+comp} & The u-\/component of the vector to be checked for consistency \\
\hline
\mbox{\texttt{ in}}  & {\em v\+\_\+comp} & The v-\/component of the vector to be checked for consistency \\
\hline
\mbox{\texttt{ in}}  & {\em is} & The starting i-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em ie} & The ending i-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em js} & The starting j-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em je} & The ending j-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em direction} & the direction flag to be passed to pass\+\_\+vector \\
\hline
\end{DoxyParams}


Definition at line 325 of file M\+O\+M\+\_\+debugging.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{325   \textcolor{keywordtype}{character(len=*)},                 \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{   !< An identifying message}}
\DoxyCodeLine{326   \textcolor{keywordtype}{type}(ocean\_grid\_type),            \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{      !< The ocean's grid structure}}
\DoxyCodeLine{327 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%IsdB:,G\%JsdB:)}, \textcolor{keywordtype}{intent(in)}    :: u\_comp\textcolor{comment}{ !< The u-component of the vector}}
\DoxyCodeLine{328 \textcolor{comment}{                                                            !! to be checked for consistency}}
\DoxyCodeLine{329 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%IsdB:,G\%JsdB:)}, \textcolor{keywordtype}{intent(in)}    :: v\_comp\textcolor{comment}{ !< The v-component of the vector}}
\DoxyCodeLine{330 \textcolor{comment}{                                                            !! to be checked for consistency}}
\DoxyCodeLine{331   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: is\textcolor{comment}{     !< The starting i-index to check}}
\DoxyCodeLine{332   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: ie\textcolor{comment}{     !< The ending i-index to check}}
\DoxyCodeLine{333   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: js\textcolor{comment}{     !< The starting j-index to check}}
\DoxyCodeLine{334   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: je\textcolor{comment}{     !< The ending j-index to check}}
\DoxyCodeLine{335   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< the direction flag to be}}
\DoxyCodeLine{336 \textcolor{comment}{                                                            !! passed to pass\_vector}}
\DoxyCodeLine{337   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{338 \textcolor{keywordtype}{  real} :: u\_nonsym(G\%isd:G\%ied,G\%jsd:G\%jed)}
\DoxyCodeLine{339 \textcolor{keywordtype}{  real} :: v\_nonsym(G\%isd:G\%ied,G\%jsd:G\%jed)}
\DoxyCodeLine{340 \textcolor{keywordtype}{  real} :: u\_resym(G\%IsdB:G\%IedB,G\%JsdB:G\%JedB)}
\DoxyCodeLine{341 \textcolor{keywordtype}{  real} :: v\_resym(G\%IsdB:G\%IedB,G\%JsdB:G\%JedB)}
\DoxyCodeLine{342   \textcolor{keywordtype}{character(len=128)} :: mesg2}
\DoxyCodeLine{343   \textcolor{keywordtype}{integer} :: i, j, is\_ch, ie\_ch, js\_ch, je\_ch}
\DoxyCodeLine{344   \textcolor{keywordtype}{integer} :: Isq, Ieq, Jsq, Jeq, isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB}
\DoxyCodeLine{345 }
\DoxyCodeLine{346   isq = g\%IscB ; ieq = g\%IecB ; jsq = g\%JscB ; jeq = g\%JecB}
\DoxyCodeLine{347   isd = g\%isd ; ied = g\%ied ; jsd = g\%jsd ; jed = g\%jed}
\DoxyCodeLine{348   isdb = g\%IsdB ; iedb = g\%IedB ; jsdb = g\%JsdB ; jedb = g\%JedB}
\DoxyCodeLine{349 }
\DoxyCodeLine{350   \textcolor{keywordflow}{if} (.not.(\textcolor{keyword}{present}(is) .or. \textcolor{keyword}{present}(ie) .or. \textcolor{keyword}{present}(js) .or. \textcolor{keyword}{present}(je))) \textcolor{keywordflow}{then}}
\DoxyCodeLine{351     \textcolor{comment}{! This only works with symmetric memory, so otherwise return.}}
\DoxyCodeLine{352     \textcolor{keywordflow}{if} ((isd == isdb) .and. (jsd == jsdb)) \textcolor{keywordflow}{return}}
\DoxyCodeLine{353 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{354 }
\DoxyCodeLine{355   \textcolor{keywordflow}{do} i=isd,ied ; \textcolor{keywordflow}{do} j=jsd,jed}
\DoxyCodeLine{356     u\_nonsym(i,j) = u\_comp(i,j) ; v\_nonsym(i,j) = v\_comp(i,j)}
\DoxyCodeLine{357 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{358 }
\DoxyCodeLine{359   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(g\%Domain\_aux)) \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{" check\_redundant"}//\&}
\DoxyCodeLine{360     \textcolor{stringliteral}{" called with a non-associated auxiliary domain the grid type."})}
\DoxyCodeLine{361   \textcolor{keyword}{call }pass\_vector(u\_nonsym, v\_nonsym, g\%Domain\_aux, direction, stagger=bgrid\_ne)}
\DoxyCodeLine{362 }
\DoxyCodeLine{363   \textcolor{keywordflow}{do} i=isdb,iedb ; \textcolor{keywordflow}{do} j=jsdb,jedb}
\DoxyCodeLine{364     u\_resym(i,j) = u\_comp(i,j) ; v\_resym(i,j) = v\_comp(i,j)}
\DoxyCodeLine{365 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{366   \textcolor{keywordflow}{do} i=isd,ied ; \textcolor{keywordflow}{do} j=jsd,jed}
\DoxyCodeLine{367     u\_resym(i,j) = u\_nonsym(i,j) ; v\_resym(i,j) = v\_nonsym(i,j)}
\DoxyCodeLine{368 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{369   \textcolor{keyword}{call }pass\_vector(u\_resym, v\_resym, g\%Domain, direction, stagger=bgrid\_ne)}
\DoxyCodeLine{370 }
\DoxyCodeLine{371   is\_ch = isq ; ie\_ch = ieq ; js\_ch = jsq ; je\_ch = jeq}
\DoxyCodeLine{372   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(is)) is\_ch = is ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(ie)) ie\_ch = ie}
\DoxyCodeLine{373   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(js)) js\_ch = js ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(js)) je\_ch = je}
\DoxyCodeLine{374 }
\DoxyCodeLine{375   \textcolor{keywordflow}{do} i=is\_ch,ie\_ch ; \textcolor{keywordflow}{do} j=js\_ch,je\_ch}
\DoxyCodeLine{376     \textcolor{keywordflow}{if} (u\_resym(i,j) /= u\_comp(i,j) .and. \&}
\DoxyCodeLine{377         redundant\_prints(2) < max\_redundant\_prints) \textcolor{keywordflow}{then}}
\DoxyCodeLine{378       \textcolor{keyword}{write}(mesg2,\textcolor{stringliteral}{'(" redundant u-components",2(1pe12.4)," differ by ", \&}}
\DoxyCodeLine{379 \textcolor{stringliteral}{}\textcolor{stringliteral}{                    \& 1pe12.4," at i,j = ",2i4," on pe ",i4)'}) \&}
\DoxyCodeLine{380            u\_comp(i,j), u\_resym(i,j),u\_comp(i,j)-u\_resym(i,j),i,j,pe\_here()}
\DoxyCodeLine{381       \textcolor{keyword}{write}(0,\textcolor{stringliteral}{'(A130)'}) trim(mesg)//trim(mesg2)}
\DoxyCodeLine{382       redundant\_prints(2) = redundant\_prints(2) + 1}
\DoxyCodeLine{383 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{384 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{385   \textcolor{keywordflow}{do} i=is\_ch,ie\_ch ; \textcolor{keywordflow}{do} j=js\_ch,je\_ch}
\DoxyCodeLine{386     \textcolor{keywordflow}{if} (v\_resym(i,j) /= v\_comp(i,j) .and. \&}
\DoxyCodeLine{387         redundant\_prints(2) < max\_redundant\_prints) \textcolor{keywordflow}{then}}
\DoxyCodeLine{388       \textcolor{keyword}{write}(mesg2,\textcolor{stringliteral}{'(" redundant v-comps",2(1pe12.4)," differ by ", \&}}
\DoxyCodeLine{389 \textcolor{stringliteral}{}\textcolor{stringliteral}{                    \& 1pe12.4," at i,j = ",2i4," x,y = ",2(1pe12.4)" on pe ",i4)'}) \&}
\DoxyCodeLine{390            v\_comp(i,j), v\_resym(i,j),v\_comp(i,j)-v\_resym(i,j),i,j, \&}
\DoxyCodeLine{391            g\%geoLonBu(i,j), g\%geoLatBu(i,j), pe\_here()}
\DoxyCodeLine{392       \textcolor{keyword}{write}(0,\textcolor{stringliteral}{'(A155)'}) trim(mesg)//trim(mesg2)}
\DoxyCodeLine{393       redundant\_prints(2) = redundant\_prints(2) + 1}
\DoxyCodeLine{394 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{395 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{396 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__debugging_a1d85ea0234c675fb2b42cb1074f70340}\label{namespacemom__debugging_a1d85ea0234c675fb2b42cb1074f70340}} 
\index{mom\_debugging@{mom\_debugging}!check\_redundant\_vb3d@{check\_redundant\_vb3d}}
\index{check\_redundant\_vb3d@{check\_redundant\_vb3d}!mom\_debugging@{mom\_debugging}}
\subsubsection{\texorpdfstring{check\_redundant\_vb3d()}{check\_redundant\_vb3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+debugging\+::check\+\_\+redundant\+\_\+vb3d (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{mesg,  }\item[{real, dimension(g\%isdb\+:,g\%jsdb\+:,\+:), intent(in)}]{u\+\_\+comp,  }\item[{real, dimension(g\%isdb\+:,g\%jsdb\+:,\+:), intent(in)}]{v\+\_\+comp,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(inout)}]{G,  }\item[{integer, intent(in), optional}]{is,  }\item[{integer, intent(in), optional}]{ie,  }\item[{integer, intent(in), optional}]{js,  }\item[{integer, intent(in), optional}]{je,  }\item[{integer, intent(in), optional}]{direction }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Check for consistency between the duplicated points of a 3-\/D B-\/grid vector. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em mesg} & An identifying message \\
\hline
\mbox{\texttt{ in,out}}  & {\em g} & The ocean\textquotesingle{}s grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em u\+\_\+comp} & The u-\/component of the vector to be checked for consistency \\
\hline
\mbox{\texttt{ in}}  & {\em v\+\_\+comp} & The v-\/component of the vector to be checked for consistency \\
\hline
\mbox{\texttt{ in}}  & {\em is} & The starting i-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em ie} & The ending i-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em js} & The starting j-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em je} & The ending j-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em direction} & the direction flag to be passed to pass\+\_\+vector \\
\hline
\end{DoxyParams}


Definition at line 295 of file M\+O\+M\+\_\+debugging.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{295   \textcolor{keywordtype}{character(len=*)},                    \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{   !< An identifying message}}
\DoxyCodeLine{296   \textcolor{keywordtype}{type}(ocean\_grid\_type),               \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{      !< The ocean's grid structure}}
\DoxyCodeLine{297 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%IsdB:,G\%JsdB:,:)},  \textcolor{keywordtype}{intent(in)}    :: u\_comp\textcolor{comment}{ !< The u-component of the vector}}
\DoxyCodeLine{298 \textcolor{comment}{                                                           !! to be checked for consistency}}
\DoxyCodeLine{299 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%IsdB:,G\%JsdB:,:)},  \textcolor{keywordtype}{intent(in)}    :: v\_comp\textcolor{comment}{ !< The v-component of the vector}}
\DoxyCodeLine{300 \textcolor{comment}{                                                           !! to be checked for consistency}}
\DoxyCodeLine{301   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: is\textcolor{comment}{     !< The starting i-index to check}}
\DoxyCodeLine{302   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: ie\textcolor{comment}{     !< The ending i-index to check}}
\DoxyCodeLine{303   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: js\textcolor{comment}{     !< The starting j-index to check}}
\DoxyCodeLine{304   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: je\textcolor{comment}{     !< The ending j-index to check}}
\DoxyCodeLine{305   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< the direction flag to be}}
\DoxyCodeLine{306 \textcolor{comment}{                                                               !! passed to pass\_vector}}
\DoxyCodeLine{307   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{308   \textcolor{keywordtype}{character(len=24)} :: mesg\_k}
\DoxyCodeLine{309   \textcolor{keywordtype}{integer} :: k}
\DoxyCodeLine{310 }
\DoxyCodeLine{311   \textcolor{keywordflow}{do} k=1,\textcolor{keyword}{size}(u\_comp,3)}
\DoxyCodeLine{312     \textcolor{keywordflow}{if} (k < 10) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i2," ")'}) k}
\DoxyCodeLine{313     \textcolor{keywordflow}{elseif} (k < 100) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i3," ")'}) k}
\DoxyCodeLine{314     \textcolor{keywordflow}{elseif} (k < 1000) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i4," ")'}) k}
\DoxyCodeLine{315     \textcolor{keywordflow}{else} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i9," ")'}) k ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{316 }
\DoxyCodeLine{317     \textcolor{keyword}{call }check\_redundant\_vb2d(trim(mesg)//trim(mesg\_k), u\_comp(:,:,k), \&}
\DoxyCodeLine{318              v\_comp(:,:,k), g, is, ie, js, je, direction)}
\DoxyCodeLine{319 \textcolor{keywordflow}{  enddo}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__debugging_a764937fe64b416cc93b28ec646f2e21b}\label{namespacemom__debugging_a764937fe64b416cc93b28ec646f2e21b}} 
\index{mom\_debugging@{mom\_debugging}!check\_redundant\_vc2d@{check\_redundant\_vc2d}}
\index{check\_redundant\_vc2d@{check\_redundant\_vc2d}!mom\_debugging@{mom\_debugging}}
\subsubsection{\texorpdfstring{check\_redundant\_vc2d()}{check\_redundant\_vc2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+debugging\+::check\+\_\+redundant\+\_\+vc2d (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{mesg,  }\item[{real, dimension(g\%isdb\+:,g\%jsd\+:), intent(in)}]{u\+\_\+comp,  }\item[{real, dimension(g\%isd\+:,g\%jsdb\+:), intent(in)}]{v\+\_\+comp,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(inout)}]{G,  }\item[{integer, intent(in), optional}]{is,  }\item[{integer, intent(in), optional}]{ie,  }\item[{integer, intent(in), optional}]{js,  }\item[{integer, intent(in), optional}]{je,  }\item[{integer, intent(in), optional}]{direction }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Check for consistency between the duplicated points of a 2-\/D C-\/grid vector. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em mesg} & An identifying message \\
\hline
\mbox{\texttt{ in,out}}  & {\em g} & The ocean\textquotesingle{}s grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em u\+\_\+comp} & The u-\/component of the vector to be checked for consistency \\
\hline
\mbox{\texttt{ in}}  & {\em v\+\_\+comp} & The u-\/component of the vector to be checked for consistency \\
\hline
\mbox{\texttt{ in}}  & {\em is} & The starting i-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em ie} & The ending i-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em js} & The starting j-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em je} & The ending j-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em direction} & the direction flag to be passed to pass\+\_\+vector \\
\hline
\end{DoxyParams}


Definition at line 136 of file M\+O\+M\+\_\+debugging.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{136   \textcolor{keywordtype}{character(len=*)},                \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{   !< An identifying message}}
\DoxyCodeLine{137   \textcolor{keywordtype}{type}(ocean\_grid\_type),           \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{      !< The ocean's grid structure}}
\DoxyCodeLine{138 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%IsdB:,G\%jsd:)}, \textcolor{keywordtype}{intent(in)}    :: u\_comp\textcolor{comment}{ !< The u-component of the vector}}
\DoxyCodeLine{139 \textcolor{comment}{                                                           !! to be checked for consistency}}
\DoxyCodeLine{140 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%isd:,G\%JsdB:)}, \textcolor{keywordtype}{intent(in)}    :: v\_comp\textcolor{comment}{ !< The u-component of the vector}}
\DoxyCodeLine{141 \textcolor{comment}{                                                           !! to be checked for consistency}}
\DoxyCodeLine{142   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: is\textcolor{comment}{     !< The starting i-index to check}}
\DoxyCodeLine{143   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: ie\textcolor{comment}{     !< The ending i-index to check}}
\DoxyCodeLine{144   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: js\textcolor{comment}{     !< The starting j-index to check}}
\DoxyCodeLine{145   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: je\textcolor{comment}{     !< The ending j-index to check}}
\DoxyCodeLine{146   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< the direction flag to be}}
\DoxyCodeLine{147 \textcolor{comment}{                                                           !! passed to pass\_vector}}
\DoxyCodeLine{148   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{149 \textcolor{keywordtype}{  real} :: u\_nonsym(G\%isd:G\%ied,G\%jsd:G\%jed)}
\DoxyCodeLine{150 \textcolor{keywordtype}{  real} :: v\_nonsym(G\%isd:G\%ied,G\%jsd:G\%jed)}
\DoxyCodeLine{151 \textcolor{keywordtype}{  real} :: u\_resym(G\%IsdB:G\%IedB,G\%jsd:G\%jed)}
\DoxyCodeLine{152 \textcolor{keywordtype}{  real} :: v\_resym(G\%isd:G\%ied,G\%JsdB:G\%JedB)}
\DoxyCodeLine{153   \textcolor{keywordtype}{character(len=128)} :: mesg2}
\DoxyCodeLine{154   \textcolor{keywordtype}{integer} :: i, j, is\_ch, ie\_ch, js\_ch, je\_ch}
\DoxyCodeLine{155   \textcolor{keywordtype}{integer} :: Isq, Ieq, Jsq, Jeq, isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB}
\DoxyCodeLine{156 }
\DoxyCodeLine{157   isq = g\%IscB ; ieq = g\%IecB ; jsq = g\%JscB ; jeq = g\%JecB}
\DoxyCodeLine{158   isd = g\%isd ; ied = g\%ied ; jsd = g\%jsd ; jed = g\%jed}
\DoxyCodeLine{159   isdb = g\%IsdB ; iedb = g\%IedB ; jsdb = g\%JsdB ; jedb = g\%JedB}
\DoxyCodeLine{160 }
\DoxyCodeLine{161   \textcolor{keywordflow}{if} (.not.(\textcolor{keyword}{present}(is) .or. \textcolor{keyword}{present}(ie) .or. \textcolor{keyword}{present}(js) .or. \textcolor{keyword}{present}(je))) \textcolor{keywordflow}{then}}
\DoxyCodeLine{162     \textcolor{comment}{! This only works with symmetric memory, so otherwise return.}}
\DoxyCodeLine{163     \textcolor{keywordflow}{if} ((isd == isdb) .and. (jsd == jsdb)) \textcolor{keywordflow}{return}}
\DoxyCodeLine{164 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{165 }
\DoxyCodeLine{166   \textcolor{keywordflow}{do} i=isd,ied ; \textcolor{keywordflow}{do} j=jsd,jed}
\DoxyCodeLine{167     u\_nonsym(i,j) = u\_comp(i,j) ; v\_nonsym(i,j) = v\_comp(i,j)}
\DoxyCodeLine{168 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{169 }
\DoxyCodeLine{170   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(g\%Domain\_aux)) \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{" check\_redundant"}//\&}
\DoxyCodeLine{171     \textcolor{stringliteral}{" called with a non-associated auxiliary domain the grid type."})}
\DoxyCodeLine{172   \textcolor{keyword}{call }pass\_vector(u\_nonsym, v\_nonsym, g\%Domain\_aux, direction)}
\DoxyCodeLine{173 }
\DoxyCodeLine{174   \textcolor{keywordflow}{do} i=isdb,iedb ; \textcolor{keywordflow}{do} j=jsd,jed ; u\_resym(i,j) = u\_comp(i,j) ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{175   \textcolor{keywordflow}{do} i=isd,ied ; \textcolor{keywordflow}{do} j=jsdb,jedb ; v\_resym(i,j) = v\_comp(i,j) ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{176   \textcolor{keywordflow}{do} i=isd,ied ; \textcolor{keywordflow}{do} j=jsd,jed}
\DoxyCodeLine{177     u\_resym(i,j) = u\_nonsym(i,j) ; v\_resym(i,j) = v\_nonsym(i,j)}
\DoxyCodeLine{178 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{179   \textcolor{keyword}{call }pass\_vector(u\_resym, v\_resym, g\%Domain, direction)}
\DoxyCodeLine{180 }
\DoxyCodeLine{181   is\_ch = isq ; ie\_ch = ieq ; js\_ch = jsq ; je\_ch = jeq}
\DoxyCodeLine{182   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(is)) is\_ch = is ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(ie)) ie\_ch = ie}
\DoxyCodeLine{183   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(js)) js\_ch = js ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(js)) je\_ch = je}
\DoxyCodeLine{184 }
\DoxyCodeLine{185   \textcolor{keywordflow}{do} i=is\_ch,ie\_ch ; \textcolor{keywordflow}{do} j=js\_ch+1,je\_ch}
\DoxyCodeLine{186     \textcolor{keywordflow}{if} (u\_resym(i,j) /= u\_comp(i,j) .and. \&}
\DoxyCodeLine{187         redundant\_prints(3) < max\_redundant\_prints) \textcolor{keywordflow}{then}}
\DoxyCodeLine{188       \textcolor{keyword}{write}(mesg2,\textcolor{stringliteral}{'(" redundant u-components",2(1pe12.4)," differ by ", \&}}
\DoxyCodeLine{189 \textcolor{stringliteral}{}\textcolor{stringliteral}{                    \& 1pe12.4," at i,j = ",2i4," on pe ",i4)'}) \&}
\DoxyCodeLine{190            u\_comp(i,j), u\_resym(i,j),u\_comp(i,j)-u\_resym(i,j),i,j,pe\_here()}
\DoxyCodeLine{191       \textcolor{keyword}{write}(0,\textcolor{stringliteral}{'(A130)'}) trim(mesg)//trim(mesg2)}
\DoxyCodeLine{192       redundant\_prints(3) = redundant\_prints(3) + 1}
\DoxyCodeLine{193 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{194 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{195   \textcolor{keywordflow}{do} i=is\_ch+1,ie\_ch ; \textcolor{keywordflow}{do} j=js\_ch,je\_ch}
\DoxyCodeLine{196     \textcolor{keywordflow}{if} (v\_resym(i,j) /= v\_comp(i,j) .and. \&}
\DoxyCodeLine{197         redundant\_prints(3) < max\_redundant\_prints) \textcolor{keywordflow}{then}}
\DoxyCodeLine{198       \textcolor{keyword}{write}(mesg2,\textcolor{stringliteral}{'(" redundant v-comps",2(1pe12.4)," differ by ", \&}}
\DoxyCodeLine{199 \textcolor{stringliteral}{}\textcolor{stringliteral}{                    \& 1pe12.4," at i,j = ",2i4," x,y = ",2(1pe12.4)" on pe ",i4)'}) \&}
\DoxyCodeLine{200            v\_comp(i,j), v\_resym(i,j),v\_comp(i,j)-v\_resym(i,j),i,j, \&}
\DoxyCodeLine{201            g\%geoLonBu(i,j), g\%geoLatBu(i,j), pe\_here()}
\DoxyCodeLine{202       \textcolor{keyword}{write}(0,\textcolor{stringliteral}{'(A155)'}) trim(mesg)//trim(mesg2)}
\DoxyCodeLine{203       redundant\_prints(3) = redundant\_prints(3) + 1}
\DoxyCodeLine{204 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{205 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{206 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__debugging_a810c5bc7956b4735d2d6c0fa30cf1ef6}\label{namespacemom__debugging_a810c5bc7956b4735d2d6c0fa30cf1ef6}} 
\index{mom\_debugging@{mom\_debugging}!check\_redundant\_vc3d@{check\_redundant\_vc3d}}
\index{check\_redundant\_vc3d@{check\_redundant\_vc3d}!mom\_debugging@{mom\_debugging}}
\subsubsection{\texorpdfstring{check\_redundant\_vc3d()}{check\_redundant\_vc3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+debugging\+::check\+\_\+redundant\+\_\+vc3d (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{mesg,  }\item[{real, dimension(g\%isdb\+:,g\%jsd\+:,\+:), intent(in)}]{u\+\_\+comp,  }\item[{real, dimension(g\%isd\+:,g\%jsdb\+:,\+:), intent(in)}]{v\+\_\+comp,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(inout)}]{G,  }\item[{integer, intent(in), optional}]{is,  }\item[{integer, intent(in), optional}]{ie,  }\item[{integer, intent(in), optional}]{js,  }\item[{integer, intent(in), optional}]{je,  }\item[{integer, intent(in), optional}]{direction }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Check for consistency between the duplicated points of a 3-\/D C-\/grid vector. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em mesg} & An identifying message \\
\hline
\mbox{\texttt{ in,out}}  & {\em g} & The ocean\textquotesingle{}s grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em u\+\_\+comp} & The u-\/component of the vector to be checked for consistency \\
\hline
\mbox{\texttt{ in}}  & {\em v\+\_\+comp} & The u-\/component of the vector to be checked for consistency \\
\hline
\mbox{\texttt{ in}}  & {\em is} & The starting i-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em ie} & The ending i-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em js} & The starting j-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em je} & The ending j-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em direction} & the direction flag to be passed to pass\+\_\+vector \\
\hline
\end{DoxyParams}


Definition at line 106 of file M\+O\+M\+\_\+debugging.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{106   \textcolor{keywordtype}{character(len=*)},                    \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{   !< An identifying message}}
\DoxyCodeLine{107   \textcolor{keywordtype}{type}(ocean\_grid\_type),               \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{      !< The ocean's grid structure}}
\DoxyCodeLine{108 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%IsdB:,G\%jsd:,:)},   \textcolor{keywordtype}{intent(in)}    :: u\_comp\textcolor{comment}{ !< The u-component of the vector}}
\DoxyCodeLine{109 \textcolor{comment}{                                                               !! to be checked for consistency}}
\DoxyCodeLine{110 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%isd:,G\%JsdB:,:)},   \textcolor{keywordtype}{intent(in)}    :: v\_comp\textcolor{comment}{ !< The u-component of the vector}}
\DoxyCodeLine{111 \textcolor{comment}{                                                               !! to be checked for consistency}}
\DoxyCodeLine{112   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: is\textcolor{comment}{     !< The starting i-index to check}}
\DoxyCodeLine{113   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: ie\textcolor{comment}{     !< The ending i-index to check}}
\DoxyCodeLine{114   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: js\textcolor{comment}{     !< The starting j-index to check}}
\DoxyCodeLine{115   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: je\textcolor{comment}{     !< The ending j-index to check}}
\DoxyCodeLine{116   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< the direction flag to be}}
\DoxyCodeLine{117 \textcolor{comment}{                                                               !! passed to pass\_vector}}
\DoxyCodeLine{118   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{119   \textcolor{keywordtype}{character(len=24)} :: mesg\_k}
\DoxyCodeLine{120   \textcolor{keywordtype}{integer} :: k}
\DoxyCodeLine{121 }
\DoxyCodeLine{122   \textcolor{keywordflow}{do} k=1,\textcolor{keyword}{size}(u\_comp,3)}
\DoxyCodeLine{123     \textcolor{keywordflow}{if} (k < 10) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i2," ")'}) k}
\DoxyCodeLine{124     \textcolor{keywordflow}{elseif} (k < 100) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i3," ")'}) k}
\DoxyCodeLine{125     \textcolor{keywordflow}{elseif} (k < 1000) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i4," ")'}) k}
\DoxyCodeLine{126     \textcolor{keywordflow}{else} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i9," ")'}) k ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{127 }
\DoxyCodeLine{128     \textcolor{keyword}{call }check\_redundant\_vc2d(trim(mesg)//trim(mesg\_k), u\_comp(:,:,k), \&}
\DoxyCodeLine{129              v\_comp(:,:,k), g, is, ie, js, je, direction)}
\DoxyCodeLine{130 \textcolor{keywordflow}{  enddo}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__debugging_ad30d2c18e907363c1f62dff0106c2fee}\label{namespacemom__debugging_ad30d2c18e907363c1f62dff0106c2fee}} 
\index{mom\_debugging@{mom\_debugging}!check\_redundant\_vt2d@{check\_redundant\_vt2d}}
\index{check\_redundant\_vt2d@{check\_redundant\_vt2d}!mom\_debugging@{mom\_debugging}}
\subsubsection{\texorpdfstring{check\_redundant\_vt2d()}{check\_redundant\_vt2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+debugging\+::check\+\_\+redundant\+\_\+vt2d (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{mesg,  }\item[{real, dimension(g\%isd\+:,g\%jsd\+:), intent(in)}]{u\+\_\+comp,  }\item[{real, dimension(g\%isd\+:,g\%jsd\+:), intent(in)}]{v\+\_\+comp,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(inout)}]{G,  }\item[{integer, intent(in), optional}]{is,  }\item[{integer, intent(in), optional}]{ie,  }\item[{integer, intent(in), optional}]{js,  }\item[{integer, intent(in), optional}]{je,  }\item[{integer, intent(in), optional}]{direction }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Check for consistency between the duplicated points of a 2-\/D A-\/grid vector. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em mesg} & An identifying message \\
\hline
\mbox{\texttt{ in,out}}  & {\em g} & The ocean\textquotesingle{}s grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em u\+\_\+comp} & The u-\/component of the vector to be checked for consistency \\
\hline
\mbox{\texttt{ in}}  & {\em v\+\_\+comp} & The v-\/component of the vector to be checked for consistency \\
\hline
\mbox{\texttt{ in}}  & {\em is} & The starting i-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em ie} & The ending i-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em js} & The starting j-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em je} & The ending j-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em direction} & the direction flag to be passed to pass\+\_\+vector \\
\hline
\end{DoxyParams}


Definition at line 501 of file M\+O\+M\+\_\+debugging.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{501   \textcolor{keywordtype}{character(len=*)},                \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{   !< An identifying message}}
\DoxyCodeLine{502   \textcolor{keywordtype}{type}(ocean\_grid\_type),           \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{      !< The ocean's grid structure}}
\DoxyCodeLine{503 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%isd:,G\%jsd:)},  \textcolor{keywordtype}{intent(in)}    :: u\_comp\textcolor{comment}{ !< The u-component of the vector}}
\DoxyCodeLine{504 \textcolor{comment}{                                                           !! to be checked for consistency}}
\DoxyCodeLine{505 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%isd:,G\%jsd:)},  \textcolor{keywordtype}{intent(in)}    :: v\_comp\textcolor{comment}{ !< The v-component of the vector}}
\DoxyCodeLine{506 \textcolor{comment}{                                                           !! to be checked for consistency}}
\DoxyCodeLine{507   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: is\textcolor{comment}{     !< The starting i-index to check}}
\DoxyCodeLine{508   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: ie\textcolor{comment}{     !< The ending i-index to check}}
\DoxyCodeLine{509   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: js\textcolor{comment}{     !< The starting j-index to check}}
\DoxyCodeLine{510   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: je\textcolor{comment}{     !< The ending j-index to check}}
\DoxyCodeLine{511   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< the direction flag to be}}
\DoxyCodeLine{512 \textcolor{comment}{                                                           !! passed to pass\_vector}}
\DoxyCodeLine{513   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{514 \textcolor{keywordtype}{  real} :: u\_nonsym(G\%isd:G\%ied,G\%jsd:G\%jed)}
\DoxyCodeLine{515 \textcolor{keywordtype}{  real} :: v\_nonsym(G\%isd:G\%ied,G\%jsd:G\%jed)}
\DoxyCodeLine{516   \textcolor{keywordtype}{character(len=128)} :: mesg2}
\DoxyCodeLine{517 }
\DoxyCodeLine{518   \textcolor{keywordtype}{integer} :: i, j, is\_ch, ie\_ch, js\_ch, je\_ch}
\DoxyCodeLine{519   \textcolor{keywordtype}{integer} :: Isq, Ieq, Jsq, Jeq, isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB}
\DoxyCodeLine{520   isq = g\%IscB ; ieq = g\%IecB ; jsq = g\%JscB ; jeq = g\%JecB}
\DoxyCodeLine{521   isd = g\%isd ; ied = g\%ied ; jsd = g\%jsd ; jed = g\%jed}
\DoxyCodeLine{522   isdb = g\%IsdB ; iedb = g\%IedB ; jsdb = g\%JsdB ; jedb = g\%JedB}
\DoxyCodeLine{523 }
\DoxyCodeLine{524   is\_ch = g\%isc ; ie\_ch = g\%iec ; js\_ch = g\%jsc ; je\_ch = g\%jec}
\DoxyCodeLine{525   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(is)) is\_ch = is ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(ie)) ie\_ch = ie}
\DoxyCodeLine{526   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(js)) js\_ch = js ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(js)) je\_ch = je}
\DoxyCodeLine{527 }
\DoxyCodeLine{528   \textcolor{comment}{! This only works on points outside of the standard computational domain.}}
\DoxyCodeLine{529   \textcolor{keywordflow}{if} ((is\_ch == g\%isc) .and. (ie\_ch == g\%iec) .and. \&}
\DoxyCodeLine{530       (js\_ch == g\%jsc) .and. (je\_ch == g\%jec)) \textcolor{keywordflow}{return}}
\DoxyCodeLine{531 }
\DoxyCodeLine{532   \textcolor{keywordflow}{do} i=isd,ied ; \textcolor{keywordflow}{do} j=jsd,jed}
\DoxyCodeLine{533     u\_nonsym(i,j) = u\_comp(i,j) ; v\_nonsym(i,j) = v\_comp(i,j)}
\DoxyCodeLine{534 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{535 }
\DoxyCodeLine{536   \textcolor{keyword}{call }pass\_vector(u\_nonsym, v\_nonsym, g\%Domain, direction, stagger=agrid)}
\DoxyCodeLine{537 }
\DoxyCodeLine{538   \textcolor{keywordflow}{do} i=is\_ch,ie\_ch ; \textcolor{keywordflow}{do} j=js\_ch+1,je\_ch}
\DoxyCodeLine{539     \textcolor{keywordflow}{if} (u\_nonsym(i,j) /= u\_comp(i,j) .and. \&}
\DoxyCodeLine{540         redundant\_prints(1) < max\_redundant\_prints) \textcolor{keywordflow}{then}}
\DoxyCodeLine{541       \textcolor{keyword}{write}(mesg2,\textcolor{stringliteral}{'(" redundant u-components",2(1pe12.4)," differ by ", \&}}
\DoxyCodeLine{542 \textcolor{stringliteral}{}\textcolor{stringliteral}{                    \& 1pe12.4," at i,j = ",2i4," on pe ",i4)'}) \&}
\DoxyCodeLine{543            u\_comp(i,j), u\_nonsym(i,j),u\_comp(i,j)-u\_nonsym(i,j),i,j,pe\_here()}
\DoxyCodeLine{544       \textcolor{keyword}{write}(0,\textcolor{stringliteral}{'(A130)'}) trim(mesg)//trim(mesg2)}
\DoxyCodeLine{545       redundant\_prints(1) = redundant\_prints(1) + 1}
\DoxyCodeLine{546 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{547 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{548   \textcolor{keywordflow}{do} i=is\_ch+1,ie\_ch ; \textcolor{keywordflow}{do} j=js\_ch,je\_ch}
\DoxyCodeLine{549     \textcolor{keywordflow}{if} (v\_nonsym(i,j) /= v\_comp(i,j) .and. \&}
\DoxyCodeLine{550         redundant\_prints(1) < max\_redundant\_prints) \textcolor{keywordflow}{then}}
\DoxyCodeLine{551       \textcolor{keyword}{write}(mesg2,\textcolor{stringliteral}{'(" redundant v-comps",2(1pe12.4)," differ by ", \&}}
\DoxyCodeLine{552 \textcolor{stringliteral}{}\textcolor{stringliteral}{                    \& 1pe12.4," at i,j = ",2i4," x,y = ",2(1pe12.4)" on pe ",i4)'}) \&}
\DoxyCodeLine{553            v\_comp(i,j), v\_nonsym(i,j),v\_comp(i,j)-v\_nonsym(i,j),i,j, \&}
\DoxyCodeLine{554            g\%geoLonBu(i,j), g\%geoLatBu(i,j), pe\_here()}
\DoxyCodeLine{555       \textcolor{keyword}{write}(0,\textcolor{stringliteral}{'(A155)'}) trim(mesg)//trim(mesg2)}
\DoxyCodeLine{556       redundant\_prints(1) = redundant\_prints(1) + 1}
\DoxyCodeLine{557 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{558 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{559 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__debugging_aaa0097c89c865d9f226f895c7bb19904}\label{namespacemom__debugging_aaa0097c89c865d9f226f895c7bb19904}} 
\index{mom\_debugging@{mom\_debugging}!check\_redundant\_vt3d@{check\_redundant\_vt3d}}
\index{check\_redundant\_vt3d@{check\_redundant\_vt3d}!mom\_debugging@{mom\_debugging}}
\subsubsection{\texorpdfstring{check\_redundant\_vt3d()}{check\_redundant\_vt3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+debugging\+::check\+\_\+redundant\+\_\+vt3d (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{mesg,  }\item[{real, dimension(g\%isd\+:,g\%jsd\+:,\+:), intent(in)}]{u\+\_\+comp,  }\item[{real, dimension(g\%isd\+:,g\%jsd\+:,\+:), intent(in)}]{v\+\_\+comp,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(inout)}]{G,  }\item[{integer, intent(in), optional}]{is,  }\item[{integer, intent(in), optional}]{ie,  }\item[{integer, intent(in), optional}]{js,  }\item[{integer, intent(in), optional}]{je,  }\item[{integer, intent(in), optional}]{direction }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Check for consistency between the duplicated points of a 3-\/D A-\/grid vector. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em mesg} & An identifying message \\
\hline
\mbox{\texttt{ in,out}}  & {\em g} & The ocean\textquotesingle{}s grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em u\+\_\+comp} & The u-\/component of the vector to be checked for consistency \\
\hline
\mbox{\texttt{ in}}  & {\em v\+\_\+comp} & The v-\/component of the vector to be checked for consistency \\
\hline
\mbox{\texttt{ in}}  & {\em is} & The starting i-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em ie} & The ending i-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em js} & The starting j-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em je} & The ending j-\/index to check \\
\hline
\mbox{\texttt{ in}}  & {\em direction} & the direction flag to be passed to pass\+\_\+vector \\
\hline
\end{DoxyParams}


Definition at line 471 of file M\+O\+M\+\_\+debugging.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{471   \textcolor{keywordtype}{character(len=*)},                    \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{   !< An identifying message}}
\DoxyCodeLine{472   \textcolor{keywordtype}{type}(ocean\_grid\_type),               \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{      !< The ocean's grid structure}}
\DoxyCodeLine{473 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%isd:,G\%jsd:,:)},    \textcolor{keywordtype}{intent(in)}    :: u\_comp\textcolor{comment}{ !< The u-component of the vector}}
\DoxyCodeLine{474 \textcolor{comment}{                                                           !! to be checked for consistency}}
\DoxyCodeLine{475 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%isd:,G\%jsd:,:)},    \textcolor{keywordtype}{intent(in)}    :: v\_comp\textcolor{comment}{ !< The v-component of the vector}}
\DoxyCodeLine{476 \textcolor{comment}{                                                           !! to be checked for consistency}}
\DoxyCodeLine{477   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: is\textcolor{comment}{     !< The starting i-index to check}}
\DoxyCodeLine{478   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: ie\textcolor{comment}{     !< The ending i-index to check}}
\DoxyCodeLine{479   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: js\textcolor{comment}{     !< The starting j-index to check}}
\DoxyCodeLine{480   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: je\textcolor{comment}{     !< The ending j-index to check}}
\DoxyCodeLine{481   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< the direction flag to be}}
\DoxyCodeLine{482 \textcolor{comment}{                                                           !! passed to pass\_vector}}
\DoxyCodeLine{483   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{484   \textcolor{keywordtype}{character(len=24)} :: mesg\_k}
\DoxyCodeLine{485   \textcolor{keywordtype}{integer} :: k}
\DoxyCodeLine{486 }
\DoxyCodeLine{487   \textcolor{keywordflow}{do} k=1,\textcolor{keyword}{size}(u\_comp,3)}
\DoxyCodeLine{488     \textcolor{keywordflow}{if} (k < 10) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i2," ")'}) k}
\DoxyCodeLine{489     \textcolor{keywordflow}{elseif} (k < 100) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i3," ")'}) k}
\DoxyCodeLine{490     \textcolor{keywordflow}{elseif} (k < 1000) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i4," ")'}) k}
\DoxyCodeLine{491     \textcolor{keywordflow}{else} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i9," ")'}) k ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{492 }
\DoxyCodeLine{493     \textcolor{keyword}{call }check\_redundant\_vt2d(trim(mesg)//trim(mesg\_k), u\_comp(:,:,k), \&}
\DoxyCodeLine{494              v\_comp(:,:,k), g, is, ie, js, je, direction)}
\DoxyCodeLine{495 \textcolor{keywordflow}{  enddo}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__debugging_a8a9901e010cdb264dbd8f8b3513eba1d}\label{namespacemom__debugging_a8a9901e010cdb264dbd8f8b3513eba1d}} 
\index{mom\_debugging@{mom\_debugging}!chksum\_vec\_a2d@{chksum\_vec\_a2d}}
\index{chksum\_vec\_a2d@{chksum\_vec\_a2d}!mom\_debugging@{mom\_debugging}}
\subsubsection{\texorpdfstring{chksum\_vec\_a2d()}{chksum\_vec\_a2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+debugging\+::chksum\+\_\+vec\+\_\+a2d (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{mesg,  }\item[{real, dimension(g\%isd\+:,g\%jsd\+:), intent(in)}]{u\+\_\+comp,  }\item[{real, dimension(g\%isd\+:,g\%jsd\+:), intent(in)}]{v\+\_\+comp,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(inout)}]{G,  }\item[{integer, intent(in), optional}]{halos,  }\item[{logical, intent(in), optional}]{scalars }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Do a checksum and redundant point check on a 2d C-\/grid vector. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em mesg} & An identifying message \\
\hline
\mbox{\texttt{ in,out}}  & {\em g} & The ocean\textquotesingle{}s grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em u\+\_\+comp} & The u-\/component of the vector \\
\hline
\mbox{\texttt{ in}}  & {\em v\+\_\+comp} & The v-\/component of the vector \\
\hline
\mbox{\texttt{ in}}  & {\em halos} & The width of halos to check (default 0) \\
\hline
\mbox{\texttt{ in}}  & {\em scalars} & If true this is a pair of scalars that are being checked. \\
\hline
\end{DoxyParams}


Definition at line 699 of file M\+O\+M\+\_\+debugging.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{699   \textcolor{keywordtype}{character(len=*)},               \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{   !< An identifying message}}
\DoxyCodeLine{700   \textcolor{keywordtype}{type}(ocean\_grid\_type),          \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{      !< The ocean's grid structure}}
\DoxyCodeLine{701 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%isd:,G\%jsd:)}, \textcolor{keywordtype}{intent(in)}    :: u\_comp\textcolor{comment}{ !< The u-component of the vector}}
\DoxyCodeLine{702 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%isd:,G\%jsd:)}, \textcolor{keywordtype}{intent(in)}    :: v\_comp\textcolor{comment}{ !< The v-component of the vector}}
\DoxyCodeLine{703   \textcolor{keywordtype}{integer},              \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halos\textcolor{comment}{  !< The width of halos to check (default 0)}}
\DoxyCodeLine{704   \textcolor{keywordtype}{logical},              \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scalars\textcolor{comment}{ !< If true this is a pair of}}
\DoxyCodeLine{705 \textcolor{comment}{                                                          !! scalars that are being checked.}}
\DoxyCodeLine{706   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{707   \textcolor{keywordtype}{logical} :: are\_scalars}
\DoxyCodeLine{708   are\_scalars = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scalars)) are\_scalars = scalars}
\DoxyCodeLine{709 }
\DoxyCodeLine{710   \textcolor{keywordflow}{if} (debug\_chksums) \textcolor{keywordflow}{then}}
\DoxyCodeLine{711     \textcolor{keyword}{call }hchksum(u\_comp, mesg//\textcolor{stringliteral}{"(u)"}, g\%HI, halos)}
\DoxyCodeLine{712     \textcolor{keyword}{call }hchksum(v\_comp, mesg//\textcolor{stringliteral}{"(v)"}, g\%HI, halos)}
\DoxyCodeLine{713 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{714   \textcolor{keywordflow}{if} (debug\_redundant) \textcolor{keywordflow}{then}}
\DoxyCodeLine{715     \textcolor{keywordflow}{if} (are\_scalars) \textcolor{keywordflow}{then}}
\DoxyCodeLine{716       \textcolor{keyword}{call }check\_redundant\_t(mesg, u\_comp, v\_comp, g, direction=to\_all+scalar\_pair)}
\DoxyCodeLine{717     \textcolor{keywordflow}{else}}
\DoxyCodeLine{718       \textcolor{keyword}{call }check\_redundant\_t(mesg, u\_comp, v\_comp, g)}
\DoxyCodeLine{719 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{720 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{721 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__debugging_aab19ba6d8d509d831102929dc636ea4e}\label{namespacemom__debugging_aab19ba6d8d509d831102929dc636ea4e}} 
\index{mom\_debugging@{mom\_debugging}!chksum\_vec\_a3d@{chksum\_vec\_a3d}}
\index{chksum\_vec\_a3d@{chksum\_vec\_a3d}!mom\_debugging@{mom\_debugging}}
\subsubsection{\texorpdfstring{chksum\_vec\_a3d()}{chksum\_vec\_a3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+debugging\+::chksum\+\_\+vec\+\_\+a3d (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{mesg,  }\item[{real, dimension(g\%isd\+:,g\%jsd\+:,\+:), intent(in)}]{u\+\_\+comp,  }\item[{real, dimension(g\%isd\+:,g\%jsd\+:,\+:), intent(in)}]{v\+\_\+comp,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(inout)}]{G,  }\item[{integer, intent(in), optional}]{halos,  }\item[{logical, intent(in), optional}]{scalars }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Do a checksum and redundant point check on a 3d C-\/grid vector. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em mesg} & An identifying message \\
\hline
\mbox{\texttt{ in,out}}  & {\em g} & The ocean\textquotesingle{}s grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em u\+\_\+comp} & The u-\/component of the vector \\
\hline
\mbox{\texttt{ in}}  & {\em v\+\_\+comp} & The v-\/component of the vector \\
\hline
\mbox{\texttt{ in}}  & {\em halos} & The width of halos to check (default 0) \\
\hline
\mbox{\texttt{ in}}  & {\em scalars} & If true this is a pair of scalars that are being checked. \\
\hline
\end{DoxyParams}


Definition at line 672 of file M\+O\+M\+\_\+debugging.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{672   \textcolor{keywordtype}{character(len=*)},                 \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{   !< An identifying message}}
\DoxyCodeLine{673   \textcolor{keywordtype}{type}(ocean\_grid\_type),            \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{      !< The ocean's grid structure}}
\DoxyCodeLine{674 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%isd:,G\%jsd:,:)}, \textcolor{keywordtype}{intent(in)}    :: u\_comp\textcolor{comment}{ !< The u-component of the vector}}
\DoxyCodeLine{675 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%isd:,G\%jsd:,:)}, \textcolor{keywordtype}{intent(in)}    :: v\_comp\textcolor{comment}{ !< The v-component of the vector}}
\DoxyCodeLine{676   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halos\textcolor{comment}{  !< The width of halos to check (default 0)}}
\DoxyCodeLine{677   \textcolor{keywordtype}{logical},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scalars\textcolor{comment}{ !< If true this is a pair of}}
\DoxyCodeLine{678 \textcolor{comment}{                                                            !! scalars that are being checked.}}
\DoxyCodeLine{679   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{680   \textcolor{keywordtype}{logical} :: are\_scalars}
\DoxyCodeLine{681   are\_scalars = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scalars)) are\_scalars = scalars}
\DoxyCodeLine{682 }
\DoxyCodeLine{683   \textcolor{keywordflow}{if} (debug\_chksums) \textcolor{keywordflow}{then}}
\DoxyCodeLine{684     \textcolor{keyword}{call }hchksum(u\_comp, mesg//\textcolor{stringliteral}{"(u)"}, g\%HI, halos)}
\DoxyCodeLine{685     \textcolor{keyword}{call }hchksum(v\_comp, mesg//\textcolor{stringliteral}{"(v)"}, g\%HI, halos)}
\DoxyCodeLine{686 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{687   \textcolor{keywordflow}{if} (debug\_redundant) \textcolor{keywordflow}{then}}
\DoxyCodeLine{688     \textcolor{keywordflow}{if} (are\_scalars) \textcolor{keywordflow}{then}}
\DoxyCodeLine{689       \textcolor{keyword}{call }check\_redundant\_t(mesg, u\_comp, v\_comp, g, direction=to\_all+scalar\_pair)}
\DoxyCodeLine{690     \textcolor{keywordflow}{else}}
\DoxyCodeLine{691       \textcolor{keyword}{call }check\_redundant\_t(mesg, u\_comp, v\_comp, g)}
\DoxyCodeLine{692 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{693 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{694 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__debugging_ab480752dac4d519fb8b37438c7a696da}\label{namespacemom__debugging_ab480752dac4d519fb8b37438c7a696da}} 
\index{mom\_debugging@{mom\_debugging}!chksum\_vec\_b2d@{chksum\_vec\_b2d}}
\index{chksum\_vec\_b2d@{chksum\_vec\_b2d}!mom\_debugging@{mom\_debugging}}
\subsubsection{\texorpdfstring{chksum\_vec\_b2d()}{chksum\_vec\_b2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+debugging\+::chksum\+\_\+vec\+\_\+b2d (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{mesg,  }\item[{real, dimension(g\%isdb\+:,g\%jsdb\+:), intent(in)}]{u\+\_\+comp,  }\item[{real, dimension(g\%isdb\+:,g\%jsdb\+:), intent(in)}]{v\+\_\+comp,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(inout)}]{G,  }\item[{integer, intent(in), optional}]{halos,  }\item[{logical, intent(in), optional}]{scalars,  }\item[{logical, intent(in), optional}]{symmetric }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em mesg} & An identifying message\\
\hline
\mbox{\texttt{ in,out}}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\texttt{ in}}  & {\em u\+\_\+comp} & The u-\/component of the vector\\
\hline
\mbox{\texttt{ in}}  & {\em v\+\_\+comp} & The v-\/component of the vector\\
\hline
\mbox{\texttt{ in}}  & {\em halos} & The width of halos to check (default 0)\\
\hline
\mbox{\texttt{ in}}  & {\em scalars} & If true this is a pair of scalars that are being checked.\\
\hline
\mbox{\texttt{ in}}  & {\em symmetric} & If true, do the checksums on the full symmetric computational domain. \\
\hline
\end{DoxyParams}


Definition at line 643 of file M\+O\+M\+\_\+debugging.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{643   \textcolor{keywordtype}{character(len=*)},                 \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{   !< An identifying message}}
\DoxyCodeLine{644   \textcolor{keywordtype}{type}(ocean\_grid\_type),            \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{      !< The ocean's grid structure}}
\DoxyCodeLine{645 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%IsdB:,G\%JsdB:)}, \textcolor{keywordtype}{intent(in)}    :: u\_comp\textcolor{comment}{ !< The u-component of the vector}}
\DoxyCodeLine{646 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%IsdB:,G\%JsdB:)}, \textcolor{keywordtype}{intent(in)}    :: v\_comp\textcolor{comment}{ !< The v-component of the vector}}
\DoxyCodeLine{647   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halos\textcolor{comment}{  !< The width of halos to check (default 0)}}
\DoxyCodeLine{648   \textcolor{keywordtype}{logical},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scalars\textcolor{comment}{ !< If true this is a pair of}}
\DoxyCodeLine{649 \textcolor{comment}{                                                            !! scalars that are being checked.}}
\DoxyCodeLine{650   \textcolor{keywordtype}{logical},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: symmetric\textcolor{comment}{ !< If true, do the checksums on the}}
\DoxyCodeLine{651 \textcolor{comment}{                                                            !! full symmetric computational domain.}}
\DoxyCodeLine{652   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{653   \textcolor{keywordtype}{logical} :: are\_scalars}
\DoxyCodeLine{654   are\_scalars = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scalars)) are\_scalars = scalars}
\DoxyCodeLine{655 }
\DoxyCodeLine{656   \textcolor{keywordflow}{if} (debug\_chksums) \textcolor{keywordflow}{then}}
\DoxyCodeLine{657     \textcolor{keyword}{call }bchksum(u\_comp, mesg//\textcolor{stringliteral}{"(u)"}, g\%HI, halos, symmetric=symmetric)}
\DoxyCodeLine{658     \textcolor{keyword}{call }bchksum(v\_comp, mesg//\textcolor{stringliteral}{"(v)"}, g\%HI, halos, symmetric=symmetric)}
\DoxyCodeLine{659 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{660   \textcolor{keywordflow}{if} (debug\_redundant) \textcolor{keywordflow}{then}}
\DoxyCodeLine{661     \textcolor{keywordflow}{if} (are\_scalars) \textcolor{keywordflow}{then}}
\DoxyCodeLine{662       \textcolor{keyword}{call }check\_redundant\_b(mesg, u\_comp, v\_comp, g, direction=to\_all+scalar\_pair)}
\DoxyCodeLine{663     \textcolor{keywordflow}{else}}
\DoxyCodeLine{664       \textcolor{keyword}{call }check\_redundant\_b(mesg, u\_comp, v\_comp, g)}
\DoxyCodeLine{665 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{666 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{667 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__debugging_ad66ab7451d216eb9f8136e10142d9b22}\label{namespacemom__debugging_ad66ab7451d216eb9f8136e10142d9b22}} 
\index{mom\_debugging@{mom\_debugging}!chksum\_vec\_b3d@{chksum\_vec\_b3d}}
\index{chksum\_vec\_b3d@{chksum\_vec\_b3d}!mom\_debugging@{mom\_debugging}}
\subsubsection{\texorpdfstring{chksum\_vec\_b3d()}{chksum\_vec\_b3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+debugging\+::chksum\+\_\+vec\+\_\+b3d (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{mesg,  }\item[{real, dimension(g\%isdb\+:,g\%jsdb\+:,\+:), intent(in)}]{u\+\_\+comp,  }\item[{real, dimension(g\%isdb\+:,g\%jsdb\+:,\+:), intent(in)}]{v\+\_\+comp,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(inout)}]{G,  }\item[{integer, intent(in), optional}]{halos,  }\item[{logical, intent(in), optional}]{scalars }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Do a checksum and redundant point check on a 3d B-\/grid vector. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em mesg} & An identifying message \\
\hline
\mbox{\texttt{ in,out}}  & {\em g} & The ocean\textquotesingle{}s grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em u\+\_\+comp} & The u-\/component of the vector \\
\hline
\mbox{\texttt{ in}}  & {\em v\+\_\+comp} & The v-\/component of the vector \\
\hline
\mbox{\texttt{ in}}  & {\em halos} & The width of halos to check (default 0) \\
\hline
\mbox{\texttt{ in}}  & {\em scalars} & If true this is a pair of scalars that are being checked. \\
\hline
\end{DoxyParams}


Definition at line 616 of file M\+O\+M\+\_\+debugging.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{616   \textcolor{keywordtype}{character(len=*)},                   \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{   !< An identifying message}}
\DoxyCodeLine{617   \textcolor{keywordtype}{type}(ocean\_grid\_type),              \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{      !< The ocean's grid structure}}
\DoxyCodeLine{618 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%IsdB:,G\%JsdB:,:)}, \textcolor{keywordtype}{intent(in)}    :: u\_comp\textcolor{comment}{ !< The u-component of the vector}}
\DoxyCodeLine{619 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%IsdB:,G\%JsdB:,:)}, \textcolor{keywordtype}{intent(in)}    :: v\_comp\textcolor{comment}{ !< The v-component of the vector}}
\DoxyCodeLine{620   \textcolor{keywordtype}{integer},                  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halos\textcolor{comment}{  !< The width of halos to check (default 0)}}
\DoxyCodeLine{621   \textcolor{keywordtype}{logical},                  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scalars\textcolor{comment}{ !< If true this is a pair of}}
\DoxyCodeLine{622 \textcolor{comment}{                                                              !! scalars that are being checked.}}
\DoxyCodeLine{623   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{624   \textcolor{keywordtype}{logical} :: are\_scalars}
\DoxyCodeLine{625   are\_scalars = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scalars)) are\_scalars = scalars}
\DoxyCodeLine{626 }
\DoxyCodeLine{627   \textcolor{keywordflow}{if} (debug\_chksums) \textcolor{keywordflow}{then}}
\DoxyCodeLine{628     \textcolor{keyword}{call }bchksum(u\_comp, mesg//\textcolor{stringliteral}{"(u)"}, g\%HI, halos)}
\DoxyCodeLine{629     \textcolor{keyword}{call }bchksum(v\_comp, mesg//\textcolor{stringliteral}{"(v)"}, g\%HI, halos)}
\DoxyCodeLine{630 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{631   \textcolor{keywordflow}{if} (debug\_redundant) \textcolor{keywordflow}{then}}
\DoxyCodeLine{632     \textcolor{keywordflow}{if} (are\_scalars) \textcolor{keywordflow}{then}}
\DoxyCodeLine{633       \textcolor{keyword}{call }check\_redundant\_b(mesg, u\_comp, v\_comp, g, direction=to\_all+scalar\_pair)}
\DoxyCodeLine{634     \textcolor{keywordflow}{else}}
\DoxyCodeLine{635       \textcolor{keyword}{call }check\_redundant\_b(mesg, u\_comp, v\_comp, g)}
\DoxyCodeLine{636 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{637 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{638 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__debugging_a0ec85b9298cb751749a46c33a5415a69}\label{namespacemom__debugging_a0ec85b9298cb751749a46c33a5415a69}} 
\index{mom\_debugging@{mom\_debugging}!chksum\_vec\_c2d@{chksum\_vec\_c2d}}
\index{chksum\_vec\_c2d@{chksum\_vec\_c2d}!mom\_debugging@{mom\_debugging}}
\subsubsection{\texorpdfstring{chksum\_vec\_c2d()}{chksum\_vec\_c2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+debugging\+::chksum\+\_\+vec\+\_\+c2d (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{mesg,  }\item[{real, dimension(g\%isdb\+:,g\%jsd\+:), intent(in)}]{u\+\_\+comp,  }\item[{real, dimension(g\%isd\+:,g\%jsdb\+:), intent(in)}]{v\+\_\+comp,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(inout)}]{G,  }\item[{integer, intent(in), optional}]{halos,  }\item[{logical, intent(in), optional}]{scalars }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Do a checksum and redundant point check on a 2d C-\/grid vector. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em mesg} & An identifying message \\
\hline
\mbox{\texttt{ in,out}}  & {\em g} & The ocean\textquotesingle{}s grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em u\+\_\+comp} & The u-\/component of the vector \\
\hline
\mbox{\texttt{ in}}  & {\em v\+\_\+comp} & The v-\/component of the vector \\
\hline
\mbox{\texttt{ in}}  & {\em halos} & The width of halos to check (default 0) \\
\hline
\mbox{\texttt{ in}}  & {\em scalars} & If true this is a pair of scalars that are being checked. \\
\hline
\end{DoxyParams}


Definition at line 590 of file M\+O\+M\+\_\+debugging.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{590   \textcolor{keywordtype}{character(len=*)},                \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{   !< An identifying message}}
\DoxyCodeLine{591   \textcolor{keywordtype}{type}(ocean\_grid\_type),           \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{      !< The ocean's grid structure}}
\DoxyCodeLine{592 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%IsdB:,G\%jsd:)}, \textcolor{keywordtype}{intent(in)}    :: u\_comp\textcolor{comment}{ !< The u-component of the vector}}
\DoxyCodeLine{593 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%isd:,G\%JsdB:)}, \textcolor{keywordtype}{intent(in)}    :: v\_comp\textcolor{comment}{ !< The v-component of the vector}}
\DoxyCodeLine{594   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halos\textcolor{comment}{  !< The width of halos to check (default 0)}}
\DoxyCodeLine{595   \textcolor{keywordtype}{logical},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scalars\textcolor{comment}{ !< If true this is a pair of}}
\DoxyCodeLine{596 \textcolor{comment}{                                                           !! scalars that are being checked.}}
\DoxyCodeLine{597   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{598   \textcolor{keywordtype}{logical} :: are\_scalars}
\DoxyCodeLine{599   are\_scalars = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scalars)) are\_scalars = scalars}
\DoxyCodeLine{600 }
\DoxyCodeLine{601   \textcolor{keywordflow}{if} (debug\_chksums) \textcolor{keywordflow}{then}}
\DoxyCodeLine{602     \textcolor{keyword}{call }uvchksum(mesg, u\_comp, v\_comp, g\%HI, halos)}
\DoxyCodeLine{603 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{604   \textcolor{keywordflow}{if} (debug\_redundant) \textcolor{keywordflow}{then}}
\DoxyCodeLine{605     \textcolor{keywordflow}{if} (are\_scalars) \textcolor{keywordflow}{then}}
\DoxyCodeLine{606       \textcolor{keyword}{call }check\_redundant\_c(mesg, u\_comp, v\_comp, g, direction=to\_all+scalar\_pair)}
\DoxyCodeLine{607     \textcolor{keywordflow}{else}}
\DoxyCodeLine{608       \textcolor{keyword}{call }check\_redundant\_c(mesg, u\_comp, v\_comp, g)}
\DoxyCodeLine{609 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{610 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{611 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__debugging_a6ff3e4eeb933a992d78dbc771d62bfc1}\label{namespacemom__debugging_a6ff3e4eeb933a992d78dbc771d62bfc1}} 
\index{mom\_debugging@{mom\_debugging}!chksum\_vec\_c3d@{chksum\_vec\_c3d}}
\index{chksum\_vec\_c3d@{chksum\_vec\_c3d}!mom\_debugging@{mom\_debugging}}
\subsubsection{\texorpdfstring{chksum\_vec\_c3d()}{chksum\_vec\_c3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+debugging\+::chksum\+\_\+vec\+\_\+c3d (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{mesg,  }\item[{real, dimension(g\%isdb\+:,g\%jsd\+:,\+:), intent(in)}]{u\+\_\+comp,  }\item[{real, dimension(g\%isd\+:,g\%jsdb\+:,\+:), intent(in)}]{v\+\_\+comp,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(inout)}]{G,  }\item[{integer, intent(in), optional}]{halos,  }\item[{logical, intent(in), optional}]{scalars }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Do a checksum and redundant point check on a 3d C-\/grid vector. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em mesg} & An identifying message \\
\hline
\mbox{\texttt{ in,out}}  & {\em g} & The ocean\textquotesingle{}s grid structure \\
\hline
\mbox{\texttt{ in}}  & {\em u\+\_\+comp} & The u-\/component of the vector \\
\hline
\mbox{\texttt{ in}}  & {\em v\+\_\+comp} & The v-\/component of the vector \\
\hline
\mbox{\texttt{ in}}  & {\em halos} & The width of halos to check (default 0) \\
\hline
\mbox{\texttt{ in}}  & {\em scalars} & If true this is a pair of scalars that are being checked. \\
\hline
\end{DoxyParams}


Definition at line 564 of file M\+O\+M\+\_\+debugging.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{564   \textcolor{keywordtype}{character(len=*)},                  \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{   !< An identifying message}}
\DoxyCodeLine{565   \textcolor{keywordtype}{type}(ocean\_grid\_type),             \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{      !< The ocean's grid structure}}
\DoxyCodeLine{566 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%IsdB:,G\%jsd:,:)}, \textcolor{keywordtype}{intent(in)}    :: u\_comp\textcolor{comment}{ !< The u-component of the vector}}
\DoxyCodeLine{567 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(G\%isd:,G\%JsdB:,:)}, \textcolor{keywordtype}{intent(in)}    :: v\_comp\textcolor{comment}{ !< The v-component of the vector}}
\DoxyCodeLine{568   \textcolor{keywordtype}{integer},                 \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halos\textcolor{comment}{  !< The width of halos to check (default 0)}}
\DoxyCodeLine{569   \textcolor{keywordtype}{logical},                 \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scalars\textcolor{comment}{ !< If true this is a pair of}}
\DoxyCodeLine{570 \textcolor{comment}{                                                             !! scalars that are being checked.}}
\DoxyCodeLine{571   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{572   \textcolor{keywordtype}{logical} :: are\_scalars}
\DoxyCodeLine{573   are\_scalars = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scalars)) are\_scalars = scalars}
\DoxyCodeLine{574 }
\DoxyCodeLine{575   \textcolor{keywordflow}{if} (debug\_chksums) \textcolor{keywordflow}{then}}
\DoxyCodeLine{576     \textcolor{keyword}{call }uvchksum(mesg, u\_comp, v\_comp, g\%HI, halos)}
\DoxyCodeLine{577 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{578   \textcolor{keywordflow}{if} (debug\_redundant) \textcolor{keywordflow}{then}}
\DoxyCodeLine{579     \textcolor{keywordflow}{if} (are\_scalars) \textcolor{keywordflow}{then}}
\DoxyCodeLine{580       \textcolor{keyword}{call }check\_redundant\_c(mesg, u\_comp, v\_comp, g, direction=to\_all+scalar\_pair)}
\DoxyCodeLine{581     \textcolor{keywordflow}{else}}
\DoxyCodeLine{582       \textcolor{keyword}{call }check\_redundant\_c(mesg, u\_comp, v\_comp, g)}
\DoxyCodeLine{583 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{584 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{585 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__debugging_a6b65b94cacf1435ce1a593c2b03f40c8}\label{namespacemom__debugging_a6b65b94cacf1435ce1a593c2b03f40c8}} 
\index{mom\_debugging@{mom\_debugging}!mom\_debugging\_init@{mom\_debugging\_init}}
\index{mom\_debugging\_init@{mom\_debugging\_init}!mom\_debugging@{mom\_debugging}}
\subsubsection{\texorpdfstring{mom\_debugging\_init()}{mom\_debugging\_init()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+debugging\+::mom\+\_\+debugging\+\_\+init (\begin{DoxyParamCaption}\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file }\end{DoxyParamCaption})}



M\+O\+M\+\_\+debugging\+\_\+init initializes the M\+O\+M\+\_\+debugging module, and sets the parameterts that control which checks are active for M\+O\+M6. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em param\+\_\+file} & A structure to parse for run-\/time parameters \\
\hline
\end{DoxyParams}


Definition at line 81 of file M\+O\+M\+\_\+debugging.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{81   \textcolor{keywordtype}{type}(param\_file\_type),   \textcolor{keywordtype}{intent(in)}    :: param\_file\textcolor{comment}{ !< A structure to parse for run-time parameters}}
\DoxyCodeLine{82 \textcolor{comment}{! This include declares and sets the variable "version".}}
\DoxyCodeLine{83 \textcolor{preprocessor}{\#include "version\_variable.h"}}
\DoxyCodeLine{84 \textcolor{preprocessor}{}  \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"MOM\_debugging"} \textcolor{comment}{! This module's name.}}
\DoxyCodeLine{85 }
\DoxyCodeLine{86   \textcolor{keyword}{call }log\_version(param\_file, mdl, version, debugging=.true.)}
\DoxyCodeLine{87   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"DEBUG"}, debug, \&}
\DoxyCodeLine{88                  \textcolor{stringliteral}{"If true, write out verbose debugging data."}, \&}
\DoxyCodeLine{89                  default=.false., debuggingparam=.true.)}
\DoxyCodeLine{90   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"DEBUG\_CHKSUMS"}, debug\_chksums, \&}
\DoxyCodeLine{91                  \textcolor{stringliteral}{"If true, checksums are performed on arrays in the "}//\&}
\DoxyCodeLine{92                  \textcolor{stringliteral}{"various vec\_chksum routines."}, default=debug, \&}
\DoxyCodeLine{93                  debuggingparam=.true.)}
\DoxyCodeLine{94   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"DEBUG\_REDUNDANT"}, debug\_redundant, \&}
\DoxyCodeLine{95                  \textcolor{stringliteral}{"If true, debug redundant data points during calls to "}//\&}
\DoxyCodeLine{96                  \textcolor{stringliteral}{"the various vec\_chksum routines."}, default=debug, \&}
\DoxyCodeLine{97                  debuggingparam=.true.)}
\DoxyCodeLine{98 }
\DoxyCodeLine{99   \textcolor{keyword}{call }mom\_checksums\_init(param\_file)}
\DoxyCodeLine{100 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__debugging_a2fef51731d0369bea648bd7c39936940}\label{namespacemom__debugging_a2fef51731d0369bea648bd7c39936940}} 
\index{mom\_debugging@{mom\_debugging}!totalstuff@{totalstuff}}
\index{totalstuff@{totalstuff}!mom\_debugging@{mom\_debugging}}
\subsubsection{\texorpdfstring{totalstuff()}{totalstuff()}}
{\footnotesize\ttfamily real function, public mom\+\_\+debugging\+::totalstuff (\begin{DoxyParamCaption}\item[{type(hor\+\_\+index\+\_\+type), intent(in)}]{HI,  }\item[{real, dimension(hi\%isd\+:,hi\%jsd\+:,\+:), intent(in)}]{h\+Thick,  }\item[{real, dimension(hi\%isd\+:,hi\%jsd\+:), intent(in)}]{areaT,  }\item[{real, dimension(hi\%isd\+:,hi\%jsd\+:,\+:), intent(in)}]{stuff }\end{DoxyParamCaption})}



This function returns the sum over computational domain of all processors of h\+Thick$\ast$stuff, where stuff is a 3-\/d array at tracer points. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em hi} & A horizontal index type \\
\hline
\mbox{\texttt{ in}}  & {\em hthick} & The array of thicknesses to use as weights \\
\hline
\mbox{\texttt{ in}}  & {\em areat} & The array of cell areas \mbox{[}m2\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em stuff} & The array of stuff to be summed \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the globally integrated amoutn of stuff 
\end{DoxyReturn}


Definition at line 727 of file M\+O\+M\+\_\+debugging.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{727   \textcolor{keywordtype}{type}(hor\_index\_type),               \textcolor{keywordtype}{intent(in)} :: HI\textcolor{comment}{     !< A horizontal index type}}
\DoxyCodeLine{728 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(HI\%isd:,HI\%jsd:,:)}, \textcolor{keywordtype}{intent(in)} :: hThick\textcolor{comment}{ !< The array of thicknesses to use as weights}}
\DoxyCodeLine{729 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(HI\%isd:,HI\%jsd:)},   \textcolor{keywordtype}{intent(in)} :: areaT\textcolor{comment}{  !< The array of cell areas [m2]}}
\DoxyCodeLine{730 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(HI\%isd:,HI\%jsd:,:)}, \textcolor{keywordtype}{intent(in)} :: stuff\textcolor{comment}{  !< The array of stuff to be summed}}
\DoxyCodeLine{731 \textcolor{keywordtype}{  real}                                         :: totalStuff\textcolor{comment}{ !< the globally integrated amoutn of stuff}}
\DoxyCodeLine{732   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{733 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(HI\%isc:HI\%iec, HI\%jsc:HI\%jec)} :: tmp\_for\_sum}
\DoxyCodeLine{734   \textcolor{keywordtype}{integer} :: i, j, k, nz}
\DoxyCodeLine{735 }
\DoxyCodeLine{736   nz = \textcolor{keyword}{size}(hthick,3)}
\DoxyCodeLine{737   tmp\_for\_sum(:,:) = 0.0}
\DoxyCodeLine{738   \textcolor{keywordflow}{do} k=1,nz ; \textcolor{keywordflow}{do} j=hi\%jsc,hi\%jec ; \textcolor{keywordflow}{do} i=hi\%isc,hi\%iec}
\DoxyCodeLine{739     tmp\_for\_sum(i,j) = tmp\_for\_sum(i,j) + hthick(i,j,k) * stuff(i,j,k) * areat(i,j)}
\DoxyCodeLine{740 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{741   totalstuff = reproducing\_sum(tmp\_for\_sum)}
\DoxyCodeLine{742 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__debugging_af436163fcb320db3d9b34e86d0e33e86}\label{namespacemom__debugging_af436163fcb320db3d9b34e86d0e33e86}} 
\index{mom\_debugging@{mom\_debugging}!totaltands@{totaltands}}
\index{totaltands@{totaltands}!mom\_debugging@{mom\_debugging}}
\subsubsection{\texorpdfstring{totaltands()}{totaltands()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+debugging\+::totaltands (\begin{DoxyParamCaption}\item[{type(hor\+\_\+index\+\_\+type), intent(in)}]{HI,  }\item[{real, dimension(hi\%isd\+:,hi\%jsd\+:,\+:), intent(in)}]{h\+Thick,  }\item[{real, dimension(hi\%isd\+:,hi\%jsd\+:), intent(in)}]{areaT,  }\item[{real, dimension(hi\%isd\+:,hi\%jsd\+:,\+:), intent(in)}]{temperature,  }\item[{real, dimension(hi\%isd\+:,hi\%jsd\+:,\+:), intent(in)}]{salinity,  }\item[{character(len=$\ast$), intent(in)}]{mesg }\end{DoxyParamCaption})}



This subroutine display the total thickness, temperature and salinity as well as the change since the last call. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em hi} & A horizontal index type \\
\hline
\mbox{\texttt{ in}}  & {\em hthick} & The array of thicknesses to use as weights \\
\hline
\mbox{\texttt{ in}}  & {\em areat} & The array of cell areas \mbox{[}m2\mbox{]} \\
\hline
\mbox{\texttt{ in}}  & {\em temperature} & The temperature field to sum \\
\hline
\mbox{\texttt{ in}}  & {\em salinity} & The salinity field to sum \\
\hline
\mbox{\texttt{ in}}  & {\em mesg} & An identifying message \\
\hline
\end{DoxyParams}


Definition at line 748 of file M\+O\+M\+\_\+debugging.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{748   \textcolor{keywordtype}{type}(hor\_index\_type),               \textcolor{keywordtype}{intent(in)} :: HI\textcolor{comment}{     !< A horizontal index type}}
\DoxyCodeLine{749 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(HI\%isd:,HI\%jsd:,:)}, \textcolor{keywordtype}{intent(in)} :: hThick\textcolor{comment}{ !< The array of thicknesses to use as weights}}
\DoxyCodeLine{750 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(HI\%isd:,HI\%jsd:)},   \textcolor{keywordtype}{intent(in)} :: areaT\textcolor{comment}{  !< The array of cell areas [m2]}}
\DoxyCodeLine{751 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(HI\%isd:,HI\%jsd:,:)}, \textcolor{keywordtype}{intent(in)} :: temperature\textcolor{comment}{ !< The temperature field to sum}}
\DoxyCodeLine{752 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(HI\%isd:,HI\%jsd:,:)}, \textcolor{keywordtype}{intent(in)} :: salinity\textcolor{comment}{    !< The salinity field to sum}}
\DoxyCodeLine{753   \textcolor{keywordtype}{character(len=*)},                   \textcolor{keywordtype}{intent(in)} :: mesg\textcolor{comment}{        !< An identifying message}}
\DoxyCodeLine{754   \textcolor{comment}{! NOTE: This subroutine uses "save" data which is not thread safe and is purely for}}
\DoxyCodeLine{755   \textcolor{comment}{! extreme debugging without a proper debugger.}}
\DoxyCodeLine{756 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{save} :: totalH = 0., totalt = 0., totals = 0.}
\DoxyCodeLine{757   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{758   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{save} :: firstCall = .true.}
\DoxyCodeLine{759 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(HI\%isc:HI\%iec, HI\%jsc:HI\%jec)} :: tmp\_for\_sum}
\DoxyCodeLine{760 \textcolor{keywordtype}{  real} :: thisH, thisT, thisS, delH, delT, delS}
\DoxyCodeLine{761   \textcolor{keywordtype}{integer} :: i, j, k, nz}
\DoxyCodeLine{762 }
\DoxyCodeLine{763   nz = \textcolor{keyword}{size}(hthick,3)}
\DoxyCodeLine{764   tmp\_for\_sum(:,:) = 0.0}
\DoxyCodeLine{765   \textcolor{keywordflow}{do} k=1,nz ; \textcolor{keywordflow}{do} j=hi\%jsc,hi\%jec ; \textcolor{keywordflow}{do} i=hi\%isc,hi\%iec}
\DoxyCodeLine{766     tmp\_for\_sum(i,j) = tmp\_for\_sum(i,j) + hthick(i,j,k) * areat(i,j)}
\DoxyCodeLine{767 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{768   thish = reproducing\_sum(tmp\_for\_sum)}
\DoxyCodeLine{769   thist = totalstuff(hi, hthick, areat, temperature)}
\DoxyCodeLine{770   thiss = totalstuff(hi, hthick, areat, salinity)}
\DoxyCodeLine{771 }
\DoxyCodeLine{772   \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}}
\DoxyCodeLine{773     \textcolor{keywordflow}{if} (firstcall) \textcolor{keywordflow}{then}}
\DoxyCodeLine{774       totalh = thish ; totalt = thist ; totals = thiss}
\DoxyCodeLine{775       \textcolor{keyword}{write}(0,*) \textcolor{stringliteral}{'Totals H,T,S:'},thish,thist,thiss,\textcolor{stringliteral}{' '},mesg}
\DoxyCodeLine{776       firstcall = .false.}
\DoxyCodeLine{777     \textcolor{keywordflow}{else}}
\DoxyCodeLine{778       delh = thish - totalh}
\DoxyCodeLine{779       delt = thist - totalt}
\DoxyCodeLine{780       dels = thiss - totals}
\DoxyCodeLine{781       totalh = thish ; totalt = thist ; totals = thiss}
\DoxyCodeLine{782       \textcolor{keyword}{write}(0,*) \textcolor{stringliteral}{'Tot/del H,T,S:'},thish,thist,thiss,delh,delt,dels,\textcolor{stringliteral}{' '},mesg}
\DoxyCodeLine{783 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{784 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{785 }

\end{DoxyCode}
