\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 \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 \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 \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 \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 \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 \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 \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 \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 \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 \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 \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 \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 \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 \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 \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 \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 \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 \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 \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 \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 \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 \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 \hyperlink{namespacemom__debugging_ab480752dac4d519fb8b37438c7a696da}{chksum\+\_\+vec\+\_\+b2d} (mesg, u\+\_\+comp, v\+\_\+comp, G, halos, scalars, symmetric)
\item 
subroutine \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 \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 \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 \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 \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 \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 \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) \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 \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 \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 \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{\tt in}  & {\em nk} & Number of levels in column\\
\hline
\mbox{\tt in}  & {\em field} & Field to be summed\\
\hline
\mbox{\tt 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}
790   \textcolor{keywordtype}{integer},             \textcolor{keywordtype}{intent(in)} :: nk\textcolor{comment}{           !< Number of levels in column}
791   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(nk)}, \textcolor{keywordtype}{intent(in)} :: field\textcolor{comment}{        !< Field to be summed}
792   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{optional},      \textcolor{keywordtype}{intent(in)} :: known\_answer\textcolor{comment}{ !< If present is the expected sum,}
793 \textcolor{comment}{                                                  !! If missing, assumed zero}
794   \textcolor{comment}{! Local variables}
795   \textcolor{keywordtype}{real}    :: u\_sum, error, expected
796   \textcolor{keywordtype}{integer} :: k
797 
798   u\_sum = field(1)
799   error = 0.
800 
801   \textcolor{comment}{! Reintegrate and sum roundoff errors}
802   \textcolor{keywordflow}{do} k=2,nk
803     u\_sum = u\_sum + field(k)
804     error = error + epsilon(u\_sum)*max(abs(u\_sum),abs(field(k)))
805 \textcolor{keywordflow}{  enddo}
806 
807   \textcolor{comment}{! Assign expected answer to either the optional input or 0}
808   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(known\_answer)) \textcolor{keywordflow}{then}
809     expected = known\_answer
810   \textcolor{keywordflow}{else}
811     expected = 0.
812 \textcolor{keywordflow}{  endif}
813 
814   \textcolor{comment}{! Compare the column integrals against calculated roundoff error}
815   \textcolor{keywordflow}{if} (abs(u\_sum-expected) > error) \textcolor{keywordflow}{then}
816     check\_column\_integral = .true.
817   \textcolor{keywordflow}{else}
818     check\_column\_integral = .false.
819 \textcolor{keywordflow}{  endif}
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{\tt in}  & {\em nk\+\_\+1} & Number of levels in field 1\\
\hline
\mbox{\tt in}  & {\em nk\+\_\+2} & Number of levels in field 2\\
\hline
\mbox{\tt in}  & {\em field\+\_\+1} & First field to be summed\\
\hline
\mbox{\tt in}  & {\em field\+\_\+2} & Second field to be summed\\
\hline
\mbox{\tt 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}
825   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{intent(in)} :: nk\_1\textcolor{comment}{           !< Number of levels in field 1}
826   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{intent(in)} :: nk\_2\textcolor{comment}{           !< Number of levels in field 2}
827   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(nk\_1)}, \textcolor{keywordtype}{intent(in)} :: field\_1\textcolor{comment}{        !< First field to be summed}
828   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(nk\_2)}, \textcolor{keywordtype}{intent(in)} :: field\_2\textcolor{comment}{        !< Second field to be summed}
829   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{optional},        \textcolor{keywordtype}{intent(in)} :: missing\_value\textcolor{comment}{  !< If column contains missing values,}
830 \textcolor{comment}{                                                      !! mask them from the sum}
831   \textcolor{comment}{! Local variables}
832   \textcolor{keywordtype}{real}    :: u1\_sum, error1, u2\_sum, error2, misval
833   \textcolor{keywordtype}{integer} :: k
834 
835   \textcolor{comment}{! Assign missing value}
836   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(missing\_value)) \textcolor{keywordflow}{then}
837     misval = missing\_value
838   \textcolor{keywordflow}{else}
839     misval = 0.
840 \textcolor{keywordflow}{  endif}
841 
842   u1\_sum = field\_1(1)
843   error1 = 0.
844 
845   \textcolor{comment}{! Reintegrate and sum roundoff errors}
846   \textcolor{keywordflow}{do} k=2,nk\_1
847     \textcolor{keywordflow}{if} (field\_1(k)/=misval) \textcolor{keywordflow}{then}
848       u1\_sum = u1\_sum + field\_1(k)
849       error1 = error1 + epsilon(u1\_sum)*max(abs(u1\_sum),abs(field\_1(k)))
850 \textcolor{keywordflow}{    endif}
851 \textcolor{keywordflow}{  enddo}
852 
853   u2\_sum = field\_2(1)
854   error2 = 0.
855 
856   \textcolor{comment}{! Reintegrate and sum roundoff errors}
857   \textcolor{keywordflow}{do} k=2,nk\_2
858     \textcolor{keywordflow}{if} (field\_2(k)/=misval) \textcolor{keywordflow}{then}
859       u2\_sum = u2\_sum + field\_2(k)
860       error2 = error2 + epsilon(u2\_sum)*max(abs(u2\_sum),abs(field\_2(k)))
861 \textcolor{keywordflow}{    endif}
862 \textcolor{keywordflow}{  enddo}
863 
864   \textcolor{comment}{! Compare the column integrals against calculated roundoff error}
865   \textcolor{keywordflow}{if} (abs(u1\_sum-u2\_sum) > (error1+error2)) \textcolor{keywordflow}{then}
866     check\_column\_integrals = .true.
867   \textcolor{keywordflow}{else}
868     check\_column\_integrals = .false.
869 \textcolor{keywordflow}{  endif}
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{\tt in}  & {\em mesg} & An identifying message\\
\hline
\mbox{\tt in,out}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\tt in}  & {\em array} & The array to be checked for consistency\\
\hline
\mbox{\tt in}  & {\em is} & The starting i-\/index to check\\
\hline
\mbox{\tt in}  & {\em ie} & The ending i-\/index to check\\
\hline
\mbox{\tt in}  & {\em js} & The starting j-\/index to check\\
\hline
\mbox{\tt 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}
236   \textcolor{keywordtype}{character(len=*)},                 \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{  !< An identifying message}
237   \textcolor{keywordtype}{type}(ocean\_grid\_type),            \textcolor{keywordtype}{intent(inout)} :: g\textcolor{comment}{     !< The ocean's grid structure}
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}
239   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: is\textcolor{comment}{    !< The starting i-index to check}
240   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: ie\textcolor{comment}{    !< The ending i-index to check}
241   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: js\textcolor{comment}{    !< The starting j-index to check}
242   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: je\textcolor{comment}{    !< The ending j-index to check}
243   \textcolor{comment}{! Local variables}
244   \textcolor{keywordtype}{real} :: a\_nonsym(g%isd:g%ied,g%jsd:g%jed)
245   \textcolor{keywordtype}{real} :: a\_resym(g%isdb:g%iedb,g%jsdb:g%jedb)
246   \textcolor{keywordtype}{character(len=128)} :: mesg2
247   \textcolor{keywordtype}{integer} :: i, j, is\_ch, ie\_ch, js\_ch, je\_ch
248   \textcolor{keywordtype}{integer} :: isq, ieq, jsq, jeq, isd, ied, jsd, jed, isdb, iedb, jsdb, jedb
249 
250   isq = g%IscB ; ieq = g%IecB ; jsq = g%JscB ; jeq = g%JecB
251   isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
252   isdb = g%IsdB ; iedb = g%IedB ; jsdb = g%JsdB ; jedb = g%JedB
253 
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}
255     \textcolor{comment}{! This only works with symmetric memory, so otherwise return.}
256     \textcolor{keywordflow}{if} ((isd == isdb) .and. (jsd == jsdb)) \textcolor{keywordflow}{return}
257 \textcolor{keywordflow}{  endif}
258 
259   \textcolor{keywordflow}{do} i=isd,ied ; \textcolor{keywordflow}{do} j=jsd,jed
260     a\_nonsym(i,j) = array(i,j)
261 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}
262 
263   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(g%Domain\_aux)) \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{" check\_redundant"}//&
264     \textcolor{stringliteral}{" called with a non-associated auxiliary domain the grid type."})
265   \textcolor{keyword}{call }pass\_vector(a\_nonsym, a\_nonsym, g%Domain\_aux, &
266                    direction=to\_all+scalar\_pair, stagger=bgrid\_ne)
267 
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}
269   \textcolor{keywordflow}{do} i=isd,ied ; \textcolor{keywordflow}{do} j=jsd,jed
270     a\_resym(i,j) = a\_nonsym(i,j)
271 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}
272   \textcolor{keyword}{call }pass\_vector(a\_resym, a\_resym, g%Domain, direction=to\_all+scalar\_pair, &
273                    stagger=bgrid\_ne)
274 
275   is\_ch = isq ; ie\_ch = ieq ; js\_ch = jsq ; je\_ch = jeq
276   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(is)) is\_ch = is ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(ie)) ie\_ch = ie
277   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(js)) js\_ch = js ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(js)) je\_ch = je
278 
279   \textcolor{keywordflow}{do} i=is\_ch,ie\_ch ; \textcolor{keywordflow}{do} j=js\_ch,je\_ch
280     \textcolor{keywordflow}{if} (a\_resym(i,j) /= array(i,j) .and. &
281         redundant\_prints(2) < max\_redundant\_prints) \textcolor{keywordflow}{then}
282       \textcolor{keyword}{write}(mesg2,\textcolor{stringliteral}{'(" Redundant points",2(1pe12.4)," differ by ", &}
283 \textcolor{stringliteral}{}\textcolor{stringliteral}{                    & 1pe12.4," at i,j = ",2i4," on pe ",i4)'}) &
284            array(i,j), a\_resym(i,j),array(i,j)-a\_resym(i,j),i,j,pe\_here()
285       \textcolor{keyword}{write}(0,\textcolor{stringliteral}{'(A130)'}) trim(mesg)//trim(mesg2)
286       redundant\_prints(2) = redundant\_prints(2) + 1
287 \textcolor{keywordflow}{    endif}
288 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}
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{\tt in}  & {\em mesg} & An identifying message\\
\hline
\mbox{\tt in,out}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\tt in}  & {\em array} & The array to be checked for consistency\\
\hline
\mbox{\tt in}  & {\em is} & The starting i-\/index to check\\
\hline
\mbox{\tt in}  & {\em ie} & The ending i-\/index to check\\
\hline
\mbox{\tt in}  & {\em js} & The starting j-\/index to check\\
\hline
\mbox{\tt 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}
211   \textcolor{keywordtype}{character(len=*)},                     \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{  !< An identifying message}
212   \textcolor{keywordtype}{type}(ocean\_grid\_type),                \textcolor{keywordtype}{intent(inout)} :: g\textcolor{comment}{     !< The ocean's grid structure}
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}
214   \textcolor{keywordtype}{integer},                    \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: is\textcolor{comment}{    !< The starting i-index to check}
215   \textcolor{keywordtype}{integer},                    \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: ie\textcolor{comment}{    !< The ending i-index to check}
216   \textcolor{keywordtype}{integer},                    \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: js\textcolor{comment}{    !< The starting j-index to check}
217   \textcolor{keywordtype}{integer},                    \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: je\textcolor{comment}{    !< The ending j-index to check}
218 
219   \textcolor{comment}{! Local variables}
220   \textcolor{keywordtype}{character(len=24)} :: mesg\_k
221   \textcolor{keywordtype}{integer} :: k
222 
223   \textcolor{keywordflow}{do} k=1,\textcolor{keyword}{size}(array,3)
224     \textcolor{keywordflow}{if} (k < 10) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i2," ")'}) k
225     \textcolor{keywordflow}{elseif} (k < 100) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i3," ")'}) k
226     \textcolor{keywordflow}{elseif} (k < 1000) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i4," ")'}) k
227     \textcolor{keywordflow}{else} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i9," ")'}) k ;\textcolor{keywordflow}{ endif}
228 
229     \textcolor{keyword}{call }check\_redundant\_sb2d(trim(mesg)//trim(mesg\_k), array(:,:,k), &
230                               g, is, ie, js, je)
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{\tt in}  & {\em mesg} & An identifying message\\
\hline
\mbox{\tt in,out}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\tt in}  & {\em array} & The array to be checked for consistency\\
\hline
\mbox{\tt in}  & {\em is} & The starting i-\/index to check\\
\hline
\mbox{\tt in}  & {\em ie} & The ending i-\/index to check\\
\hline
\mbox{\tt in}  & {\em js} & The starting j-\/index to check\\
\hline
\mbox{\tt 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}
426   \textcolor{keywordtype}{character(len=*)},                 \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{  !< An identifying message}
427   \textcolor{keywordtype}{type}(ocean\_grid\_type),            \textcolor{keywordtype}{intent(inout)} :: g\textcolor{comment}{     !< The ocean's grid structure}
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}
429   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: is\textcolor{comment}{    !< The starting i-index to check}
430   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: ie\textcolor{comment}{    !< The ending i-index to check}
431   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: js\textcolor{comment}{    !< The starting j-index to check}
432   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: je\textcolor{comment}{    !< The ending j-index to check}
433   \textcolor{comment}{! Local variables}
434   \textcolor{keywordtype}{real} :: a\_nonsym(g%isd:g%ied,g%jsd:g%jed)
435   \textcolor{keywordtype}{character(len=128)} :: mesg2
436 
437   \textcolor{keywordtype}{integer} :: i, j, is\_ch, ie\_ch, js\_ch, je\_ch
438   \textcolor{keywordtype}{integer} :: isq, ieq, jsq, jeq, isd, ied, jsd, jed
439   isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
440 
441   is\_ch = g%isc ; ie\_ch = g%iec ; js\_ch = g%jsc ; je\_ch = g%jec
442   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(is)) is\_ch = is ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(ie)) ie\_ch = ie
443   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(js)) js\_ch = js ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(js)) je\_ch = je
444 
445   \textcolor{comment}{! This only works on points outside of the standard computational domain.}
446   \textcolor{keywordflow}{if} ((is\_ch == g%isc) .and. (ie\_ch == g%iec) .and. &
447       (js\_ch == g%jsc) .and. (je\_ch == g%jec)) \textcolor{keywordflow}{return}
448 
449   \textcolor{keywordflow}{do} i=isd,ied ; \textcolor{keywordflow}{do} j=jsd,jed
450     a\_nonsym(i,j) = array(i,j)
451 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}
452 
453   \textcolor{keyword}{call }pass\_var(a\_nonsym, g%Domain)
454 
455   \textcolor{keywordflow}{do} i=is\_ch,ie\_ch ; \textcolor{keywordflow}{do} j=js\_ch,je\_ch
456     \textcolor{keywordflow}{if} (a\_nonsym(i,j) /= array(i,j) .and. &
457         redundant\_prints(1) < max\_redundant\_prints) \textcolor{keywordflow}{then}
458       \textcolor{keyword}{write}(mesg2,\textcolor{stringliteral}{'(" Redundant points",2(1pe12.4)," differ by ", &}
459 \textcolor{stringliteral}{}\textcolor{stringliteral}{                    & 1pe12.4," at i,j = ",2i4," on pe ",i4)'}) &
460            array(i,j), a\_nonsym(i,j),array(i,j)-a\_nonsym(i,j),i,j,pe\_here()
461       \textcolor{keyword}{write}(0,\textcolor{stringliteral}{'(A130)'}) trim(mesg)//trim(mesg2)
462      redundant\_prints(1) = redundant\_prints(1) + 1
463 \textcolor{keywordflow}{   endif}
464 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}
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{\tt in}  & {\em mesg} & An identifying message\\
\hline
\mbox{\tt in,out}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\tt in}  & {\em array} & The array to be checked for consistency\\
\hline
\mbox{\tt in}  & {\em is} & The starting i-\/index to check\\
\hline
\mbox{\tt in}  & {\em ie} & The ending i-\/index to check\\
\hline
\mbox{\tt in}  & {\em js} & The starting j-\/index to check\\
\hline
\mbox{\tt 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}
401   \textcolor{keywordtype}{character(len=*)},                     \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{  !< An identifying message}
402   \textcolor{keywordtype}{type}(ocean\_grid\_type),                \textcolor{keywordtype}{intent(inout)} :: g\textcolor{comment}{     !< The ocean's grid structure}
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}
404   \textcolor{keywordtype}{integer},                    \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: is\textcolor{comment}{    !< The starting i-index to check}
405   \textcolor{keywordtype}{integer},                    \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: ie\textcolor{comment}{    !< The ending i-index to check}
406   \textcolor{keywordtype}{integer},                    \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: js\textcolor{comment}{    !< The starting j-index to check}
407   \textcolor{keywordtype}{integer},                    \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: je\textcolor{comment}{    !< The ending j-index to check}
408   \textcolor{comment}{! Local variables}
409   \textcolor{keywordtype}{character(len=24)} :: mesg\_k
410   \textcolor{keywordtype}{integer} :: k
411 
412   \textcolor{keywordflow}{do} k=1,\textcolor{keyword}{size}(array,3)
413     \textcolor{keywordflow}{if} (k < 10) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i2," ")'}) k
414     \textcolor{keywordflow}{elseif} (k < 100) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i3," ")'}) k
415     \textcolor{keywordflow}{elseif} (k < 1000) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i4," ")'}) k
416     \textcolor{keywordflow}{else} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i9," ")'}) k ;\textcolor{keywordflow}{ endif}
417 
418     \textcolor{keyword}{call }check\_redundant\_st2d(trim(mesg)//trim(mesg\_k), array(:,:,k), &
419                               g, is, ie, js, je)
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{\tt in}  & {\em mesg} & An identifying message\\
\hline
\mbox{\tt in,out}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\tt in}  & {\em u\+\_\+comp} & The u-\/component of the vector to be checked for consistency\\
\hline
\mbox{\tt in}  & {\em v\+\_\+comp} & The v-\/component of the vector to be checked for consistency\\
\hline
\mbox{\tt in}  & {\em is} & The starting i-\/index to check\\
\hline
\mbox{\tt in}  & {\em ie} & The ending i-\/index to check\\
\hline
\mbox{\tt in}  & {\em js} & The starting j-\/index to check\\
\hline
\mbox{\tt in}  & {\em je} & The ending j-\/index to check\\
\hline
\mbox{\tt 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}
325   \textcolor{keywordtype}{character(len=*)},                 \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{   !< An identifying message}
326   \textcolor{keywordtype}{type}(ocean\_grid\_type),            \textcolor{keywordtype}{intent(inout)} :: g\textcolor{comment}{      !< The ocean's grid structure}
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}
328 \textcolor{comment}{                                                            !! to be checked for consistency}
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}
330 \textcolor{comment}{                                                            !! to be checked for consistency}
331   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: is\textcolor{comment}{     !< The starting i-index to check}
332   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: ie\textcolor{comment}{     !< The ending i-index to check}
333   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: js\textcolor{comment}{     !< The starting j-index to check}
334   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: je\textcolor{comment}{     !< The ending j-index to check}
335   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< the direction flag to be}
336 \textcolor{comment}{                                                            !! passed to pass\_vector}
337   \textcolor{comment}{! Local variables}
338   \textcolor{keywordtype}{real} :: u\_nonsym(g%isd:g%ied,g%jsd:g%jed)
339   \textcolor{keywordtype}{real} :: v\_nonsym(g%isd:g%ied,g%jsd:g%jed)
340   \textcolor{keywordtype}{real} :: u\_resym(g%isdb:g%iedb,g%jsdb:g%jedb)
341   \textcolor{keywordtype}{real} :: v\_resym(g%isdb:g%iedb,g%jsdb:g%jedb)
342   \textcolor{keywordtype}{character(len=128)} :: mesg2
343   \textcolor{keywordtype}{integer} :: i, j, is\_ch, ie\_ch, js\_ch, je\_ch
344   \textcolor{keywordtype}{integer} :: isq, ieq, jsq, jeq, isd, ied, jsd, jed, isdb, iedb, jsdb, jedb
345 
346   isq = g%IscB ; ieq = g%IecB ; jsq = g%JscB ; jeq = g%JecB
347   isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
348   isdb = g%IsdB ; iedb = g%IedB ; jsdb = g%JsdB ; jedb = g%JedB
349 
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}
351     \textcolor{comment}{! This only works with symmetric memory, so otherwise return.}
352     \textcolor{keywordflow}{if} ((isd == isdb) .and. (jsd == jsdb)) \textcolor{keywordflow}{return}
353 \textcolor{keywordflow}{  endif}
354 
355   \textcolor{keywordflow}{do} i=isd,ied ; \textcolor{keywordflow}{do} j=jsd,jed
356     u\_nonsym(i,j) = u\_comp(i,j) ; v\_nonsym(i,j) = v\_comp(i,j)
357 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}
358 
359   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(g%Domain\_aux)) \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{" check\_redundant"}//&
360     \textcolor{stringliteral}{" called with a non-associated auxiliary domain the grid type."})
361   \textcolor{keyword}{call }pass\_vector(u\_nonsym, v\_nonsym, g%Domain\_aux, direction, stagger=bgrid\_ne)
362 
363   \textcolor{keywordflow}{do} i=isdb,iedb ; \textcolor{keywordflow}{do} j=jsdb,jedb
364     u\_resym(i,j) = u\_comp(i,j) ; v\_resym(i,j) = v\_comp(i,j)
365 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}
366   \textcolor{keywordflow}{do} i=isd,ied ; \textcolor{keywordflow}{do} j=jsd,jed
367     u\_resym(i,j) = u\_nonsym(i,j) ; v\_resym(i,j) = v\_nonsym(i,j)
368 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}
369   \textcolor{keyword}{call }pass\_vector(u\_resym, v\_resym, g%Domain, direction, stagger=bgrid\_ne)
370 
371   is\_ch = isq ; ie\_ch = ieq ; js\_ch = jsq ; je\_ch = jeq
372   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(is)) is\_ch = is ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(ie)) ie\_ch = ie
373   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(js)) js\_ch = js ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(js)) je\_ch = je
374 
375   \textcolor{keywordflow}{do} i=is\_ch,ie\_ch ; \textcolor{keywordflow}{do} j=js\_ch,je\_ch
376     \textcolor{keywordflow}{if} (u\_resym(i,j) /= u\_comp(i,j) .and. &
377         redundant\_prints(2) < max\_redundant\_prints) \textcolor{keywordflow}{then}
378       \textcolor{keyword}{write}(mesg2,\textcolor{stringliteral}{'(" redundant u-components",2(1pe12.4)," differ by ", &}
379 \textcolor{stringliteral}{}\textcolor{stringliteral}{                    & 1pe12.4," at i,j = ",2i4," on pe ",i4)'}) &
380            u\_comp(i,j), u\_resym(i,j),u\_comp(i,j)-u\_resym(i,j),i,j,pe\_here()
381       \textcolor{keyword}{write}(0,\textcolor{stringliteral}{'(A130)'}) trim(mesg)//trim(mesg2)
382       redundant\_prints(2) = redundant\_prints(2) + 1
383 \textcolor{keywordflow}{    endif}
384 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}
385   \textcolor{keywordflow}{do} i=is\_ch,ie\_ch ; \textcolor{keywordflow}{do} j=js\_ch,je\_ch
386     \textcolor{keywordflow}{if} (v\_resym(i,j) /= v\_comp(i,j) .and. &
387         redundant\_prints(2) < max\_redundant\_prints) \textcolor{keywordflow}{then}
388       \textcolor{keyword}{write}(mesg2,\textcolor{stringliteral}{'(" redundant v-comps",2(1pe12.4)," differ by ", &}
389 \textcolor{stringliteral}{}\textcolor{stringliteral}{                    & 1pe12.4," at i,j = ",2i4," x,y = ",2(1pe12.4)" on pe ",i4)'}) &
390            v\_comp(i,j), v\_resym(i,j),v\_comp(i,j)-v\_resym(i,j),i,j, &
391            g%geoLonBu(i,j), g%geoLatBu(i,j), pe\_here()
392       \textcolor{keyword}{write}(0,\textcolor{stringliteral}{'(A155)'}) trim(mesg)//trim(mesg2)
393       redundant\_prints(2) = redundant\_prints(2) + 1
394 \textcolor{keywordflow}{    endif}
395 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}
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{\tt in}  & {\em mesg} & An identifying message\\
\hline
\mbox{\tt in,out}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\tt in}  & {\em u\+\_\+comp} & The u-\/component of the vector to be checked for consistency\\
\hline
\mbox{\tt in}  & {\em v\+\_\+comp} & The v-\/component of the vector to be checked for consistency\\
\hline
\mbox{\tt in}  & {\em is} & The starting i-\/index to check\\
\hline
\mbox{\tt in}  & {\em ie} & The ending i-\/index to check\\
\hline
\mbox{\tt in}  & {\em js} & The starting j-\/index to check\\
\hline
\mbox{\tt in}  & {\em je} & The ending j-\/index to check\\
\hline
\mbox{\tt 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}
295   \textcolor{keywordtype}{character(len=*)},                    \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{   !< An identifying message}
296   \textcolor{keywordtype}{type}(ocean\_grid\_type),               \textcolor{keywordtype}{intent(inout)} :: g\textcolor{comment}{      !< The ocean's grid structure}
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}
298 \textcolor{comment}{                                                           !! to be checked for consistency}
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}
300 \textcolor{comment}{                                                           !! to be checked for consistency}
301   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: is\textcolor{comment}{     !< The starting i-index to check}
302   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: ie\textcolor{comment}{     !< The ending i-index to check}
303   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: js\textcolor{comment}{     !< The starting j-index to check}
304   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: je\textcolor{comment}{     !< The ending j-index to check}
305   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< the direction flag to be}
306 \textcolor{comment}{                                                               !! passed to pass\_vector}
307   \textcolor{comment}{! Local variables}
308   \textcolor{keywordtype}{character(len=24)} :: mesg\_k
309   \textcolor{keywordtype}{integer} :: k
310 
311   \textcolor{keywordflow}{do} k=1,\textcolor{keyword}{size}(u\_comp,3)
312     \textcolor{keywordflow}{if} (k < 10) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i2," ")'}) k
313     \textcolor{keywordflow}{elseif} (k < 100) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i3," ")'}) k
314     \textcolor{keywordflow}{elseif} (k < 1000) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i4," ")'}) k
315     \textcolor{keywordflow}{else} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i9," ")'}) k ;\textcolor{keywordflow}{ endif}
316 
317     \textcolor{keyword}{call }check\_redundant\_vb2d(trim(mesg)//trim(mesg\_k), u\_comp(:,:,k), &
318              v\_comp(:,:,k), g, is, ie, js, je, direction)
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{\tt in}  & {\em mesg} & An identifying message\\
\hline
\mbox{\tt in,out}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\tt in}  & {\em u\+\_\+comp} & The u-\/component of the vector to be checked for consistency\\
\hline
\mbox{\tt in}  & {\em v\+\_\+comp} & The u-\/component of the vector to be checked for consistency\\
\hline
\mbox{\tt in}  & {\em is} & The starting i-\/index to check\\
\hline
\mbox{\tt in}  & {\em ie} & The ending i-\/index to check\\
\hline
\mbox{\tt in}  & {\em js} & The starting j-\/index to check\\
\hline
\mbox{\tt in}  & {\em je} & The ending j-\/index to check\\
\hline
\mbox{\tt 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}
136   \textcolor{keywordtype}{character(len=*)},                \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{   !< An identifying message}
137   \textcolor{keywordtype}{type}(ocean\_grid\_type),           \textcolor{keywordtype}{intent(inout)} :: g\textcolor{comment}{      !< The ocean's grid structure}
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}
139 \textcolor{comment}{                                                           !! to be checked for consistency}
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}
141 \textcolor{comment}{                                                           !! to be checked for consistency}
142   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: is\textcolor{comment}{     !< The starting i-index to check}
143   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: ie\textcolor{comment}{     !< The ending i-index to check}
144   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: js\textcolor{comment}{     !< The starting j-index to check}
145   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: je\textcolor{comment}{     !< The ending j-index to check}
146   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< the direction flag to be}
147 \textcolor{comment}{                                                           !! passed to pass\_vector}
148   \textcolor{comment}{! Local variables}
149   \textcolor{keywordtype}{real} :: u\_nonsym(g%isd:g%ied,g%jsd:g%jed)
150   \textcolor{keywordtype}{real} :: v\_nonsym(g%isd:g%ied,g%jsd:g%jed)
151   \textcolor{keywordtype}{real} :: u\_resym(g%isdb:g%iedb,g%jsd:g%jed)
152   \textcolor{keywordtype}{real} :: v\_resym(g%isd:g%ied,g%jsdb:g%jedb)
153   \textcolor{keywordtype}{character(len=128)} :: mesg2
154   \textcolor{keywordtype}{integer} :: i, j, is\_ch, ie\_ch, js\_ch, je\_ch
155   \textcolor{keywordtype}{integer} :: isq, ieq, jsq, jeq, isd, ied, jsd, jed, isdb, iedb, jsdb, jedb
156 
157   isq = g%IscB ; ieq = g%IecB ; jsq = g%JscB ; jeq = g%JecB
158   isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
159   isdb = g%IsdB ; iedb = g%IedB ; jsdb = g%JsdB ; jedb = g%JedB
160 
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}
162     \textcolor{comment}{! This only works with symmetric memory, so otherwise return.}
163     \textcolor{keywordflow}{if} ((isd == isdb) .and. (jsd == jsdb)) \textcolor{keywordflow}{return}
164 \textcolor{keywordflow}{  endif}
165 
166   \textcolor{keywordflow}{do} i=isd,ied ; \textcolor{keywordflow}{do} j=jsd,jed
167     u\_nonsym(i,j) = u\_comp(i,j) ; v\_nonsym(i,j) = v\_comp(i,j)
168 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}
169 
170   \textcolor{keywordflow}{if} (.not.\textcolor{keyword}{associated}(g%Domain\_aux)) \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{" check\_redundant"}//&
171     \textcolor{stringliteral}{" called with a non-associated auxiliary domain the grid type."})
172   \textcolor{keyword}{call }pass\_vector(u\_nonsym, v\_nonsym, g%Domain\_aux, direction)
173 
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}
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}
176   \textcolor{keywordflow}{do} i=isd,ied ; \textcolor{keywordflow}{do} j=jsd,jed
177     u\_resym(i,j) = u\_nonsym(i,j) ; v\_resym(i,j) = v\_nonsym(i,j)
178 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}
179   \textcolor{keyword}{call }pass\_vector(u\_resym, v\_resym, g%Domain, direction)
180 
181   is\_ch = isq ; ie\_ch = ieq ; js\_ch = jsq ; je\_ch = jeq
182   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(is)) is\_ch = is ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(ie)) ie\_ch = ie
183   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(js)) js\_ch = js ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(js)) je\_ch = je
184 
185   \textcolor{keywordflow}{do} i=is\_ch,ie\_ch ; \textcolor{keywordflow}{do} j=js\_ch+1,je\_ch
186     \textcolor{keywordflow}{if} (u\_resym(i,j) /= u\_comp(i,j) .and. &
187         redundant\_prints(3) < max\_redundant\_prints) \textcolor{keywordflow}{then}
188       \textcolor{keyword}{write}(mesg2,\textcolor{stringliteral}{'(" redundant u-components",2(1pe12.4)," differ by ", &}
189 \textcolor{stringliteral}{}\textcolor{stringliteral}{                    & 1pe12.4," at i,j = ",2i4," on pe ",i4)'}) &
190            u\_comp(i,j), u\_resym(i,j),u\_comp(i,j)-u\_resym(i,j),i,j,pe\_here()
191       \textcolor{keyword}{write}(0,\textcolor{stringliteral}{'(A130)'}) trim(mesg)//trim(mesg2)
192       redundant\_prints(3) = redundant\_prints(3) + 1
193 \textcolor{keywordflow}{    endif}
194 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}
195   \textcolor{keywordflow}{do} i=is\_ch+1,ie\_ch ; \textcolor{keywordflow}{do} j=js\_ch,je\_ch
196     \textcolor{keywordflow}{if} (v\_resym(i,j) /= v\_comp(i,j) .and. &
197         redundant\_prints(3) < max\_redundant\_prints) \textcolor{keywordflow}{then}
198       \textcolor{keyword}{write}(mesg2,\textcolor{stringliteral}{'(" redundant v-comps",2(1pe12.4)," differ by ", &}
199 \textcolor{stringliteral}{}\textcolor{stringliteral}{                    & 1pe12.4," at i,j = ",2i4," x,y = ",2(1pe12.4)" on pe ",i4)'}) &
200            v\_comp(i,j), v\_resym(i,j),v\_comp(i,j)-v\_resym(i,j),i,j, &
201            g%geoLonBu(i,j), g%geoLatBu(i,j), pe\_here()
202       \textcolor{keyword}{write}(0,\textcolor{stringliteral}{'(A155)'}) trim(mesg)//trim(mesg2)
203       redundant\_prints(3) = redundant\_prints(3) + 1
204 \textcolor{keywordflow}{    endif}
205 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}
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{\tt in}  & {\em mesg} & An identifying message\\
\hline
\mbox{\tt in,out}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\tt in}  & {\em u\+\_\+comp} & The u-\/component of the vector to be checked for consistency\\
\hline
\mbox{\tt in}  & {\em v\+\_\+comp} & The u-\/component of the vector to be checked for consistency\\
\hline
\mbox{\tt in}  & {\em is} & The starting i-\/index to check\\
\hline
\mbox{\tt in}  & {\em ie} & The ending i-\/index to check\\
\hline
\mbox{\tt in}  & {\em js} & The starting j-\/index to check\\
\hline
\mbox{\tt in}  & {\em je} & The ending j-\/index to check\\
\hline
\mbox{\tt 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}
106   \textcolor{keywordtype}{character(len=*)},                    \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{   !< An identifying message}
107   \textcolor{keywordtype}{type}(ocean\_grid\_type),               \textcolor{keywordtype}{intent(inout)} :: g\textcolor{comment}{      !< The ocean's grid structure}
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}
109 \textcolor{comment}{                                                               !! to be checked for consistency}
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}
111 \textcolor{comment}{                                                               !! to be checked for consistency}
112   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: is\textcolor{comment}{     !< The starting i-index to check}
113   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: ie\textcolor{comment}{     !< The ending i-index to check}
114   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: js\textcolor{comment}{     !< The starting j-index to check}
115   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: je\textcolor{comment}{     !< The ending j-index to check}
116   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< the direction flag to be}
117 \textcolor{comment}{                                                               !! passed to pass\_vector}
118   \textcolor{comment}{! Local variables}
119   \textcolor{keywordtype}{character(len=24)} :: mesg\_k
120   \textcolor{keywordtype}{integer} :: k
121 
122   \textcolor{keywordflow}{do} k=1,\textcolor{keyword}{size}(u\_comp,3)
123     \textcolor{keywordflow}{if} (k < 10) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i2," ")'}) k
124     \textcolor{keywordflow}{elseif} (k < 100) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i3," ")'}) k
125     \textcolor{keywordflow}{elseif} (k < 1000) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i4," ")'}) k
126     \textcolor{keywordflow}{else} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i9," ")'}) k ;\textcolor{keywordflow}{ endif}
127 
128     \textcolor{keyword}{call }check\_redundant\_vc2d(trim(mesg)//trim(mesg\_k), u\_comp(:,:,k), &
129              v\_comp(:,:,k), g, is, ie, js, je, direction)
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{\tt in}  & {\em mesg} & An identifying message\\
\hline
\mbox{\tt in,out}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\tt in}  & {\em u\+\_\+comp} & The u-\/component of the vector to be checked for consistency\\
\hline
\mbox{\tt in}  & {\em v\+\_\+comp} & The v-\/component of the vector to be checked for consistency\\
\hline
\mbox{\tt in}  & {\em is} & The starting i-\/index to check\\
\hline
\mbox{\tt in}  & {\em ie} & The ending i-\/index to check\\
\hline
\mbox{\tt in}  & {\em js} & The starting j-\/index to check\\
\hline
\mbox{\tt in}  & {\em je} & The ending j-\/index to check\\
\hline
\mbox{\tt 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}
501   \textcolor{keywordtype}{character(len=*)},                \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{   !< An identifying message}
502   \textcolor{keywordtype}{type}(ocean\_grid\_type),           \textcolor{keywordtype}{intent(inout)} :: g\textcolor{comment}{      !< The ocean's grid structure}
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}
504 \textcolor{comment}{                                                           !! to be checked for consistency}
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}
506 \textcolor{comment}{                                                           !! to be checked for consistency}
507   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: is\textcolor{comment}{     !< The starting i-index to check}
508   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: ie\textcolor{comment}{     !< The ending i-index to check}
509   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: js\textcolor{comment}{     !< The starting j-index to check}
510   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: je\textcolor{comment}{     !< The ending j-index to check}
511   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< the direction flag to be}
512 \textcolor{comment}{                                                           !! passed to pass\_vector}
513   \textcolor{comment}{! Local variables}
514   \textcolor{keywordtype}{real} :: u\_nonsym(g%isd:g%ied,g%jsd:g%jed)
515   \textcolor{keywordtype}{real} :: v\_nonsym(g%isd:g%ied,g%jsd:g%jed)
516   \textcolor{keywordtype}{character(len=128)} :: mesg2
517 
518   \textcolor{keywordtype}{integer} :: i, j, is\_ch, ie\_ch, js\_ch, je\_ch
519   \textcolor{keywordtype}{integer} :: isq, ieq, jsq, jeq, isd, ied, jsd, jed, isdb, iedb, jsdb, jedb
520   isq = g%IscB ; ieq = g%IecB ; jsq = g%JscB ; jeq = g%JecB
521   isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
522   isdb = g%IsdB ; iedb = g%IedB ; jsdb = g%JsdB ; jedb = g%JedB
523 
524   is\_ch = g%isc ; ie\_ch = g%iec ; js\_ch = g%jsc ; je\_ch = g%jec
525   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(is)) is\_ch = is ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(ie)) ie\_ch = ie
526   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(js)) js\_ch = js ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(js)) je\_ch = je
527 
528   \textcolor{comment}{! This only works on points outside of the standard computational domain.}
529   \textcolor{keywordflow}{if} ((is\_ch == g%isc) .and. (ie\_ch == g%iec) .and. &
530       (js\_ch == g%jsc) .and. (je\_ch == g%jec)) \textcolor{keywordflow}{return}
531 
532   \textcolor{keywordflow}{do} i=isd,ied ; \textcolor{keywordflow}{do} j=jsd,jed
533     u\_nonsym(i,j) = u\_comp(i,j) ; v\_nonsym(i,j) = v\_comp(i,j)
534 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}
535 
536   \textcolor{keyword}{call }pass\_vector(u\_nonsym, v\_nonsym, g%Domain, direction, stagger=agrid)
537 
538   \textcolor{keywordflow}{do} i=is\_ch,ie\_ch ; \textcolor{keywordflow}{do} j=js\_ch+1,je\_ch
539     \textcolor{keywordflow}{if} (u\_nonsym(i,j) /= u\_comp(i,j) .and. &
540         redundant\_prints(1) < max\_redundant\_prints) \textcolor{keywordflow}{then}
541       \textcolor{keyword}{write}(mesg2,\textcolor{stringliteral}{'(" redundant u-components",2(1pe12.4)," differ by ", &}
542 \textcolor{stringliteral}{}\textcolor{stringliteral}{                    & 1pe12.4," at i,j = ",2i4," on pe ",i4)'}) &
543            u\_comp(i,j), u\_nonsym(i,j),u\_comp(i,j)-u\_nonsym(i,j),i,j,pe\_here()
544       \textcolor{keyword}{write}(0,\textcolor{stringliteral}{'(A130)'}) trim(mesg)//trim(mesg2)
545       redundant\_prints(1) = redundant\_prints(1) + 1
546 \textcolor{keywordflow}{    endif}
547 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}
548   \textcolor{keywordflow}{do} i=is\_ch+1,ie\_ch ; \textcolor{keywordflow}{do} j=js\_ch,je\_ch
549     \textcolor{keywordflow}{if} (v\_nonsym(i,j) /= v\_comp(i,j) .and. &
550         redundant\_prints(1) < max\_redundant\_prints) \textcolor{keywordflow}{then}
551       \textcolor{keyword}{write}(mesg2,\textcolor{stringliteral}{'(" redundant v-comps",2(1pe12.4)," differ by ", &}
552 \textcolor{stringliteral}{}\textcolor{stringliteral}{                    & 1pe12.4," at i,j = ",2i4," x,y = ",2(1pe12.4)" on pe ",i4)'}) &
553            v\_comp(i,j), v\_nonsym(i,j),v\_comp(i,j)-v\_nonsym(i,j),i,j, &
554            g%geoLonBu(i,j), g%geoLatBu(i,j), pe\_here()
555       \textcolor{keyword}{write}(0,\textcolor{stringliteral}{'(A155)'}) trim(mesg)//trim(mesg2)
556       redundant\_prints(1) = redundant\_prints(1) + 1
557 \textcolor{keywordflow}{    endif}
558 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}
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{\tt in}  & {\em mesg} & An identifying message\\
\hline
\mbox{\tt in,out}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\tt in}  & {\em u\+\_\+comp} & The u-\/component of the vector to be checked for consistency\\
\hline
\mbox{\tt in}  & {\em v\+\_\+comp} & The v-\/component of the vector to be checked for consistency\\
\hline
\mbox{\tt in}  & {\em is} & The starting i-\/index to check\\
\hline
\mbox{\tt in}  & {\em ie} & The ending i-\/index to check\\
\hline
\mbox{\tt in}  & {\em js} & The starting j-\/index to check\\
\hline
\mbox{\tt in}  & {\em je} & The ending j-\/index to check\\
\hline
\mbox{\tt 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}
471   \textcolor{keywordtype}{character(len=*)},                    \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{   !< An identifying message}
472   \textcolor{keywordtype}{type}(ocean\_grid\_type),               \textcolor{keywordtype}{intent(inout)} :: g\textcolor{comment}{      !< The ocean's grid structure}
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}
474 \textcolor{comment}{                                                           !! to be checked for consistency}
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}
476 \textcolor{comment}{                                                           !! to be checked for consistency}
477   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: is\textcolor{comment}{     !< The starting i-index to check}
478   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: ie\textcolor{comment}{     !< The ending i-index to check}
479   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: js\textcolor{comment}{     !< The starting j-index to check}
480   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: je\textcolor{comment}{     !< The ending j-index to check}
481   \textcolor{keywordtype}{integer},                   \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: direction\textcolor{comment}{ !< the direction flag to be}
482 \textcolor{comment}{                                                           !! passed to pass\_vector}
483   \textcolor{comment}{! Local variables}
484   \textcolor{keywordtype}{character(len=24)} :: mesg\_k
485   \textcolor{keywordtype}{integer} :: k
486 
487   \textcolor{keywordflow}{do} k=1,\textcolor{keyword}{size}(u\_comp,3)
488     \textcolor{keywordflow}{if} (k < 10) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i2," ")'}) k
489     \textcolor{keywordflow}{elseif} (k < 100) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i3," ")'}) k
490     \textcolor{keywordflow}{elseif} (k < 1000) \textcolor{keywordflow}{then} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i4," ")'}) k
491     \textcolor{keywordflow}{else} ; \textcolor{keyword}{write}(mesg\_k,\textcolor{stringliteral}{'(" Layer",i9," ")'}) k ;\textcolor{keywordflow}{ endif}
492 
493     \textcolor{keyword}{call }check\_redundant\_vt2d(trim(mesg)//trim(mesg\_k), u\_comp(:,:,k), &
494              v\_comp(:,:,k), g, is, ie, js, je, direction)
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{\tt in}  & {\em mesg} & An identifying message\\
\hline
\mbox{\tt in,out}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\tt in}  & {\em u\+\_\+comp} & The u-\/component of the vector\\
\hline
\mbox{\tt in}  & {\em v\+\_\+comp} & The v-\/component of the vector\\
\hline
\mbox{\tt in}  & {\em halos} & The width of halos to check (default 0)\\
\hline
\mbox{\tt 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}
699   \textcolor{keywordtype}{character(len=*)},               \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{   !< An identifying message}
700   \textcolor{keywordtype}{type}(ocean\_grid\_type),          \textcolor{keywordtype}{intent(inout)} :: g\textcolor{comment}{      !< The ocean's grid structure}
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}
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}
703   \textcolor{keywordtype}{integer},              \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halos\textcolor{comment}{  !< The width of halos to check (default 0)}
704   \textcolor{keywordtype}{logical},              \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scalars\textcolor{comment}{ !< If true this is a pair of}
705 \textcolor{comment}{                                                          !! scalars that are being checked.}
706   \textcolor{comment}{! Local variables}
707   \textcolor{keywordtype}{logical} :: are\_scalars
708   are\_scalars = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scalars)) are\_scalars = scalars
709 
710   \textcolor{keywordflow}{if} (debug\_chksums) \textcolor{keywordflow}{then}
711     \textcolor{keyword}{call }hchksum(u\_comp, mesg//\textcolor{stringliteral}{"(u)"}, g%HI, halos)
712     \textcolor{keyword}{call }hchksum(v\_comp, mesg//\textcolor{stringliteral}{"(v)"}, g%HI, halos)
713 \textcolor{keywordflow}{  endif}
714   \textcolor{keywordflow}{if} (debug\_redundant) \textcolor{keywordflow}{then}
715     \textcolor{keywordflow}{if} (are\_scalars) \textcolor{keywordflow}{then}
716       \textcolor{keyword}{call }check\_redundant\_t(mesg, u\_comp, v\_comp, g, direction=to\_all+scalar\_pair)
717     \textcolor{keywordflow}{else}
718       \textcolor{keyword}{call }check\_redundant\_t(mesg, u\_comp, v\_comp, g)
719 \textcolor{keywordflow}{    endif}
720 \textcolor{keywordflow}{  endif}
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{\tt in}  & {\em mesg} & An identifying message\\
\hline
\mbox{\tt in,out}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\tt in}  & {\em u\+\_\+comp} & The u-\/component of the vector\\
\hline
\mbox{\tt in}  & {\em v\+\_\+comp} & The v-\/component of the vector\\
\hline
\mbox{\tt in}  & {\em halos} & The width of halos to check (default 0)\\
\hline
\mbox{\tt 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}
672   \textcolor{keywordtype}{character(len=*)},                 \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{   !< An identifying message}
673   \textcolor{keywordtype}{type}(ocean\_grid\_type),            \textcolor{keywordtype}{intent(inout)} :: g\textcolor{comment}{      !< The ocean's grid structure}
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}
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}
676   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halos\textcolor{comment}{  !< The width of halos to check (default 0)}
677   \textcolor{keywordtype}{logical},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scalars\textcolor{comment}{ !< If true this is a pair of}
678 \textcolor{comment}{                                                            !! scalars that are being checked.}
679   \textcolor{comment}{! Local variables}
680   \textcolor{keywordtype}{logical} :: are\_scalars
681   are\_scalars = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scalars)) are\_scalars = scalars
682 
683   \textcolor{keywordflow}{if} (debug\_chksums) \textcolor{keywordflow}{then}
684     \textcolor{keyword}{call }hchksum(u\_comp, mesg//\textcolor{stringliteral}{"(u)"}, g%HI, halos)
685     \textcolor{keyword}{call }hchksum(v\_comp, mesg//\textcolor{stringliteral}{"(v)"}, g%HI, halos)
686 \textcolor{keywordflow}{  endif}
687   \textcolor{keywordflow}{if} (debug\_redundant) \textcolor{keywordflow}{then}
688     \textcolor{keywordflow}{if} (are\_scalars) \textcolor{keywordflow}{then}
689       \textcolor{keyword}{call }check\_redundant\_t(mesg, u\_comp, v\_comp, g, direction=to\_all+scalar\_pair)
690     \textcolor{keywordflow}{else}
691       \textcolor{keyword}{call }check\_redundant\_t(mesg, u\_comp, v\_comp, g)
692 \textcolor{keywordflow}{    endif}
693 \textcolor{keywordflow}{  endif}
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{\tt in}  & {\em mesg} & An identifying message\\
\hline
\mbox{\tt in,out}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\tt in}  & {\em u\+\_\+comp} & The u-\/component of the vector\\
\hline
\mbox{\tt in}  & {\em v\+\_\+comp} & The v-\/component of the vector\\
\hline
\mbox{\tt in}  & {\em halos} & The width of halos to check (default 0)\\
\hline
\mbox{\tt in}  & {\em scalars} & If true this is a pair of scalars that are being checked.\\
\hline
\mbox{\tt 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}
643   \textcolor{keywordtype}{character(len=*)},                 \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{   !< An identifying message}
644   \textcolor{keywordtype}{type}(ocean\_grid\_type),            \textcolor{keywordtype}{intent(inout)} :: g\textcolor{comment}{      !< The ocean's grid structure}
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}
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}
647   \textcolor{keywordtype}{integer},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halos\textcolor{comment}{  !< The width of halos to check (default 0)}
648   \textcolor{keywordtype}{logical},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scalars\textcolor{comment}{ !< If true this is a pair of}
649 \textcolor{comment}{                                                            !! scalars that are being checked.}
650   \textcolor{keywordtype}{logical},                \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: symmetric\textcolor{comment}{ !< If true, do the checksums on the}
651 \textcolor{comment}{                                                            !! full symmetric computational domain.}
652   \textcolor{comment}{! Local variables}
653   \textcolor{keywordtype}{logical} :: are\_scalars
654   are\_scalars = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scalars)) are\_scalars = scalars
655 
656   \textcolor{keywordflow}{if} (debug\_chksums) \textcolor{keywordflow}{then}
657     \textcolor{keyword}{call }bchksum(u\_comp, mesg//\textcolor{stringliteral}{"(u)"}, g%HI, halos, symmetric=symmetric)
658     \textcolor{keyword}{call }bchksum(v\_comp, mesg//\textcolor{stringliteral}{"(v)"}, g%HI, halos, symmetric=symmetric)
659 \textcolor{keywordflow}{  endif}
660   \textcolor{keywordflow}{if} (debug\_redundant) \textcolor{keywordflow}{then}
661     \textcolor{keywordflow}{if} (are\_scalars) \textcolor{keywordflow}{then}
662       \textcolor{keyword}{call }check\_redundant\_b(mesg, u\_comp, v\_comp, g, direction=to\_all+scalar\_pair)
663     \textcolor{keywordflow}{else}
664       \textcolor{keyword}{call }check\_redundant\_b(mesg, u\_comp, v\_comp, g)
665 \textcolor{keywordflow}{    endif}
666 \textcolor{keywordflow}{  endif}
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{\tt in}  & {\em mesg} & An identifying message\\
\hline
\mbox{\tt in,out}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\tt in}  & {\em u\+\_\+comp} & The u-\/component of the vector\\
\hline
\mbox{\tt in}  & {\em v\+\_\+comp} & The v-\/component of the vector\\
\hline
\mbox{\tt in}  & {\em halos} & The width of halos to check (default 0)\\
\hline
\mbox{\tt 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}
616   \textcolor{keywordtype}{character(len=*)},                   \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{   !< An identifying message}
617   \textcolor{keywordtype}{type}(ocean\_grid\_type),              \textcolor{keywordtype}{intent(inout)} :: g\textcolor{comment}{      !< The ocean's grid structure}
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}
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}
620   \textcolor{keywordtype}{integer},                  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halos\textcolor{comment}{  !< The width of halos to check (default 0)}
621   \textcolor{keywordtype}{logical},                  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scalars\textcolor{comment}{ !< If true this is a pair of}
622 \textcolor{comment}{                                                              !! scalars that are being checked.}
623   \textcolor{comment}{! Local variables}
624   \textcolor{keywordtype}{logical} :: are\_scalars
625   are\_scalars = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scalars)) are\_scalars = scalars
626 
627   \textcolor{keywordflow}{if} (debug\_chksums) \textcolor{keywordflow}{then}
628     \textcolor{keyword}{call }bchksum(u\_comp, mesg//\textcolor{stringliteral}{"(u)"}, g%HI, halos)
629     \textcolor{keyword}{call }bchksum(v\_comp, mesg//\textcolor{stringliteral}{"(v)"}, g%HI, halos)
630 \textcolor{keywordflow}{  endif}
631   \textcolor{keywordflow}{if} (debug\_redundant) \textcolor{keywordflow}{then}
632     \textcolor{keywordflow}{if} (are\_scalars) \textcolor{keywordflow}{then}
633       \textcolor{keyword}{call }check\_redundant\_b(mesg, u\_comp, v\_comp, g, direction=to\_all+scalar\_pair)
634     \textcolor{keywordflow}{else}
635       \textcolor{keyword}{call }check\_redundant\_b(mesg, u\_comp, v\_comp, g)
636 \textcolor{keywordflow}{    endif}
637 \textcolor{keywordflow}{  endif}
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{\tt in}  & {\em mesg} & An identifying message\\
\hline
\mbox{\tt in,out}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\tt in}  & {\em u\+\_\+comp} & The u-\/component of the vector\\
\hline
\mbox{\tt in}  & {\em v\+\_\+comp} & The v-\/component of the vector\\
\hline
\mbox{\tt in}  & {\em halos} & The width of halos to check (default 0)\\
\hline
\mbox{\tt 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}
590   \textcolor{keywordtype}{character(len=*)},                \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{   !< An identifying message}
591   \textcolor{keywordtype}{type}(ocean\_grid\_type),           \textcolor{keywordtype}{intent(inout)} :: g\textcolor{comment}{      !< The ocean's grid structure}
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}
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}
594   \textcolor{keywordtype}{integer},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halos\textcolor{comment}{  !< The width of halos to check (default 0)}
595   \textcolor{keywordtype}{logical},               \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scalars\textcolor{comment}{ !< If true this is a pair of}
596 \textcolor{comment}{                                                           !! scalars that are being checked.}
597   \textcolor{comment}{! Local variables}
598   \textcolor{keywordtype}{logical} :: are\_scalars
599   are\_scalars = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scalars)) are\_scalars = scalars
600 
601   \textcolor{keywordflow}{if} (debug\_chksums) \textcolor{keywordflow}{then}
602     \textcolor{keyword}{call }uvchksum(mesg, u\_comp, v\_comp, g%HI, halos)
603 \textcolor{keywordflow}{  endif}
604   \textcolor{keywordflow}{if} (debug\_redundant) \textcolor{keywordflow}{then}
605     \textcolor{keywordflow}{if} (are\_scalars) \textcolor{keywordflow}{then}
606       \textcolor{keyword}{call }check\_redundant\_c(mesg, u\_comp, v\_comp, g, direction=to\_all+scalar\_pair)
607     \textcolor{keywordflow}{else}
608       \textcolor{keyword}{call }check\_redundant\_c(mesg, u\_comp, v\_comp, g)
609 \textcolor{keywordflow}{    endif}
610 \textcolor{keywordflow}{  endif}
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{\tt in}  & {\em mesg} & An identifying message\\
\hline
\mbox{\tt in,out}  & {\em g} & The ocean\textquotesingle{}s grid structure\\
\hline
\mbox{\tt in}  & {\em u\+\_\+comp} & The u-\/component of the vector\\
\hline
\mbox{\tt in}  & {\em v\+\_\+comp} & The v-\/component of the vector\\
\hline
\mbox{\tt in}  & {\em halos} & The width of halos to check (default 0)\\
\hline
\mbox{\tt 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}
564   \textcolor{keywordtype}{character(len=*)},                  \textcolor{keywordtype}{intent(in)}    :: mesg\textcolor{comment}{   !< An identifying message}
565   \textcolor{keywordtype}{type}(ocean\_grid\_type),             \textcolor{keywordtype}{intent(inout)} :: g\textcolor{comment}{      !< The ocean's grid structure}
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}
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}
568   \textcolor{keywordtype}{integer},                 \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: halos\textcolor{comment}{  !< The width of halos to check (default 0)}
569   \textcolor{keywordtype}{logical},                 \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scalars\textcolor{comment}{ !< If true this is a pair of}
570 \textcolor{comment}{                                                             !! scalars that are being checked.}
571   \textcolor{comment}{! Local variables}
572   \textcolor{keywordtype}{logical} :: are\_scalars
573   are\_scalars = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scalars)) are\_scalars = scalars
574 
575   \textcolor{keywordflow}{if} (debug\_chksums) \textcolor{keywordflow}{then}
576     \textcolor{keyword}{call }uvchksum(mesg, u\_comp, v\_comp, g%HI, halos)
577 \textcolor{keywordflow}{  endif}
578   \textcolor{keywordflow}{if} (debug\_redundant) \textcolor{keywordflow}{then}
579     \textcolor{keywordflow}{if} (are\_scalars) \textcolor{keywordflow}{then}
580       \textcolor{keyword}{call }check\_redundant\_c(mesg, u\_comp, v\_comp, g, direction=to\_all+scalar\_pair)
581     \textcolor{keywordflow}{else}
582       \textcolor{keyword}{call }check\_redundant\_c(mesg, u\_comp, v\_comp, g)
583 \textcolor{keywordflow}{    endif}
584 \textcolor{keywordflow}{  endif}
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{\tt 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}
81   \textcolor{keywordtype}{type}(param\_file\_type),   \textcolor{keywordtype}{intent(in)}    :: param\_file\textcolor{comment}{ !< A structure to parse for run-time parameters}
82 \textcolor{comment}{! This include declares and sets the variable "version".}
83 \textcolor{preprocessor}{#include "version\_variable.h"}
84 \textcolor{preprocessor}{}  \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"MOM\_debugging"} \textcolor{comment}{! This module's name.}
85 
86   \textcolor{keyword}{call }log\_version(param\_file, mdl, version, debugging=.true.)
87   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"DEBUG"}, debug, &
88                  \textcolor{stringliteral}{"If true, write out verbose debugging data."}, &
89                  default=.false., debuggingparam=.true.)
90   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"DEBUG\_CHKSUMS"}, debug\_chksums, &
91                  \textcolor{stringliteral}{"If true, checksums are performed on arrays in the "}//&
92                  \textcolor{stringliteral}{"various vec\_chksum routines."}, default=debug, &
93                  debuggingparam=.true.)
94   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"DEBUG\_REDUNDANT"}, debug\_redundant, &
95                  \textcolor{stringliteral}{"If true, debug redundant data points during calls to "}//&
96                  \textcolor{stringliteral}{"the various vec\_chksum routines."}, default=debug, &
97                  debuggingparam=.true.)
98 
99   \textcolor{keyword}{call }mom\_checksums\_init(param\_file)
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{\tt in}  & {\em hi} & A horizontal index type\\
\hline
\mbox{\tt in}  & {\em hthick} & The array of thicknesses to use as weights\\
\hline
\mbox{\tt in}  & {\em areat} & The array of cell areas \mbox{[}m2\mbox{]}\\
\hline
\mbox{\tt 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}
727   \textcolor{keywordtype}{type}(hor\_index\_type),               \textcolor{keywordtype}{intent(in)} :: hi\textcolor{comment}{     !< A horizontal index type}
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}
729   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(HI%isd:,HI%jsd:)},   \textcolor{keywordtype}{intent(in)} :: areat\textcolor{comment}{  !< The array of cell areas [m2]}
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}
731   \textcolor{keywordtype}{real}                                         :: totalstuff\textcolor{comment}{ !< the globally integrated amoutn of stuff}
732   \textcolor{comment}{! Local variables}
733   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(HI%isc:HI%iec, HI%jsc:HI%jec)} :: tmp\_for\_sum
734   \textcolor{keywordtype}{integer} :: i, j, k, nz
735 
736   nz = \textcolor{keyword}{size}(hthick,3)
737   tmp\_for\_sum(:,:) = 0.0
738   \textcolor{keywordflow}{do} k=1,nz ; \textcolor{keywordflow}{do} j=hi%jsc,hi%jec ; \textcolor{keywordflow}{do} i=hi%isc,hi%iec
739     tmp\_for\_sum(i,j) = tmp\_for\_sum(i,j) + hthick(i,j,k) * stuff(i,j,k) * areat(i,j)
740 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo} ;\textcolor{keywordflow}{ enddo}
741   totalstuff = reproducing\_sum(tmp\_for\_sum)
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{\tt in}  & {\em hi} & A horizontal index type\\
\hline
\mbox{\tt in}  & {\em hthick} & The array of thicknesses to use as weights\\
\hline
\mbox{\tt in}  & {\em areat} & The array of cell areas \mbox{[}m2\mbox{]}\\
\hline
\mbox{\tt in}  & {\em temperature} & The temperature field to sum\\
\hline
\mbox{\tt in}  & {\em salinity} & The salinity field to sum\\
\hline
\mbox{\tt in}  & {\em mesg} & An identifying message \\
\hline
\end{DoxyParams}


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


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