\hypertarget{namespacemom__obsolete__diagnostics}{}\doxysection{mom\+\_\+obsolete\+\_\+diagnostics Module Reference}
\label{namespacemom__obsolete__diagnostics}\index{mom\_obsolete\_diagnostics@{mom\_obsolete\_diagnostics}}


\doxysubsection{Detailed Description}
Provides a mechanism for recording diagnostic variables that are no longer valid, along with their replacement name if appropriate. \doxysubsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \mbox{\hyperlink{namespacemom__obsolete__diagnostics_ad5e890c09abd2c650beb9ac36bbb49b4}{register\+\_\+obsolete\+\_\+diagnostics}} (param\+\_\+file, diag)
\begin{DoxyCompactList}\small\item\em Scan through the diag\+\_\+table searching for obsolete parameters and issue informational messages and optionallly a F\+A\+T\+AL error. \end{DoxyCompactList}\item 
logical function \mbox{\hyperlink{namespacemom__obsolete__diagnostics_a137ff7cb882b715d0ccf915fef52386c}{found\+\_\+in\+\_\+diagtable}} (diag, var\+Name, new\+Var\+Name)
\begin{DoxyCompactList}\small\item\em Fakes a register of a diagnostic to find out if an obsolete parameter appears in the diag\+\_\+table. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacemom__obsolete__diagnostics_a137ff7cb882b715d0ccf915fef52386c}\label{namespacemom__obsolete__diagnostics_a137ff7cb882b715d0ccf915fef52386c}} 
\index{mom\_obsolete\_diagnostics@{mom\_obsolete\_diagnostics}!found\_in\_diagtable@{found\_in\_diagtable}}
\index{found\_in\_diagtable@{found\_in\_diagtable}!mom\_obsolete\_diagnostics@{mom\_obsolete\_diagnostics}}
\doxysubsubsection{\texorpdfstring{found\_in\_diagtable()}{found\_in\_diagtable()}}
{\footnotesize\ttfamily logical function mom\+\_\+obsolete\+\_\+diagnostics\+::found\+\_\+in\+\_\+diagtable (\begin{DoxyParamCaption}\item[{type(diag\+\_\+ctrl), intent(in)}]{diag,  }\item[{character(len=$\ast$), intent(in)}]{var\+Name,  }\item[{character(len=$\ast$), intent(in), optional}]{new\+Var\+Name }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Fakes a register of a diagnostic to find out if an obsolete parameter appears in the diag\+\_\+table. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em diag} & A structure used to control diagnostics. \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The obsolete diagnostic name \\
\hline
\mbox{\texttt{ in}}  & {\em newvarname} & The valid name of this diagnostic \\
\hline
\end{DoxyParams}


Definition at line 67 of file M\+O\+M\+\_\+obsolete\+\_\+diagnostics.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{67   \textcolor{keywordtype}{type}(diag\_ctrl),            \textcolor{keywordtype}{intent(in)} :: diag\textcolor{comment}{       !< A structure used to control diagnostics.}}
\DoxyCodeLine{68   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: varName\textcolor{comment}{    !< The obsolete diagnostic name}}
\DoxyCodeLine{69   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: newVarName\textcolor{comment}{ !< The valid name of this diagnostic}}
\DoxyCodeLine{70   \textcolor{comment}{! Local}}
\DoxyCodeLine{71   \textcolor{keywordtype}{integer} :: handle \textcolor{comment}{! Integer handle returned from diag\_manager}}
\DoxyCodeLine{72 }
\DoxyCodeLine{73   \textcolor{comment}{! We use register\_static\_field\_fms() instead of register\_static\_field() so}}
\DoxyCodeLine{74   \textcolor{comment}{! that the diagnostic does not appear in the available diagnostics list.}}
\DoxyCodeLine{75   handle = register\_static\_field\_fms(\textcolor{stringliteral}{'ocean\_model'}, varname, \&}
\DoxyCodeLine{76             diag\%axesT1\%handles, \textcolor{stringliteral}{'Obsolete parameter'}, \textcolor{stringliteral}{'N/A'})}
\DoxyCodeLine{77 }
\DoxyCodeLine{78   found\_in\_diagtable = (handle>0)}
\DoxyCodeLine{79 }
\DoxyCodeLine{80   \textcolor{keywordflow}{if} (handle>0 .and. is\_root\_pe()) \textcolor{keywordflow}{then}}
\DoxyCodeLine{81     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(newvarname)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{82       \textcolor{keyword}{call }mom\_error(warning, \textcolor{stringliteral}{'MOM\_obsolete\_params: '}//                        \&}
\DoxyCodeLine{83           \textcolor{stringliteral}{'diag\_table entry "'}//trim(varname)//\textcolor{stringliteral}{'" found. Use '}// \&}
\DoxyCodeLine{84           \textcolor{stringliteral}{'"'}//trim(newvarname)//\textcolor{stringliteral}{'" instead.'} )}
\DoxyCodeLine{85     \textcolor{keywordflow}{else}}
\DoxyCodeLine{86       \textcolor{keyword}{call }mom\_error(warning, \textcolor{stringliteral}{'MOM\_obsolete\_params: '}//                        \&}
\DoxyCodeLine{87           \textcolor{stringliteral}{'diag\_table entry "'}//trim(varname)//\textcolor{stringliteral}{'" is obsolete.'} )}
\DoxyCodeLine{88 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{89 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{90 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__obsolete__diagnostics_ad5e890c09abd2c650beb9ac36bbb49b4}\label{namespacemom__obsolete__diagnostics_ad5e890c09abd2c650beb9ac36bbb49b4}} 
\index{mom\_obsolete\_diagnostics@{mom\_obsolete\_diagnostics}!register\_obsolete\_diagnostics@{register\_obsolete\_diagnostics}}
\index{register\_obsolete\_diagnostics@{register\_obsolete\_diagnostics}!mom\_obsolete\_diagnostics@{mom\_obsolete\_diagnostics}}
\doxysubsubsection{\texorpdfstring{register\_obsolete\_diagnostics()}{register\_obsolete\_diagnostics()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+obsolete\+\_\+diagnostics\+::register\+\_\+obsolete\+\_\+diagnostics (\begin{DoxyParamCaption}\item[{type(param\+\_\+file\+\_\+type), intent(in)}]{param\+\_\+file,  }\item[{type(diag\+\_\+ctrl), intent(in)}]{diag }\end{DoxyParamCaption})}



Scan through the diag\+\_\+table searching for obsolete parameters and issue informational messages and optionallly a F\+A\+T\+AL error. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em param\+\_\+file} & The parameter file handle. \\
\hline
\mbox{\texttt{ in}}  & {\em diag} & A structure used to control diagnostics. \\
\hline
\end{DoxyParams}


Definition at line 23 of file M\+O\+M\+\_\+obsolete\+\_\+diagnostics.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{23   \textcolor{keywordtype}{type}(param\_file\_type),       \textcolor{keywordtype}{intent(in)}    :: param\_file\textcolor{comment}{ !< The parameter file handle.}}
\DoxyCodeLine{24   \textcolor{keywordtype}{type}(diag\_ctrl),             \textcolor{keywordtype}{intent(in)}    :: diag\textcolor{comment}{       !< A structure used to control diagnostics.}}
\DoxyCodeLine{25 \textcolor{comment}{! This include declares and sets the variable "version".}}
\DoxyCodeLine{26 \textcolor{preprocessor}{\#include "version\_variable.h"}}
\DoxyCodeLine{27 \textcolor{preprocessor}{}  \textcolor{comment}{! Local variables}}
\DoxyCodeLine{28   \textcolor{keywordtype}{character(len=40)}  :: mdl = \textcolor{stringliteral}{"MOM\_obsolete\_diagnostics"}\textcolor{comment}{  !< This module's name.}}
\DoxyCodeLine{29   \textcolor{keywordtype}{logical} :: foundEntry, causeFatal}
\DoxyCodeLine{30   \textcolor{keywordtype}{integer} :: errType}
\DoxyCodeLine{31 }
\DoxyCodeLine{32   \textcolor{keyword}{call }log\_version(param\_file, mdl, version)}
\DoxyCodeLine{33   \textcolor{keyword}{call }get\_param(param\_file, mdl, \textcolor{stringliteral}{"OBSOLETE\_DIAGNOSTIC\_IS\_FATAL"}, causefatal,              \&}
\DoxyCodeLine{34                  \textcolor{stringliteral}{"If an obsolete diagnostic variable appears in the diag\_table, "}//        \&}
\DoxyCodeLine{35                  \textcolor{stringliteral}{"cause a FATAL error rather than issue a WARNING."}, default=.true.)}
\DoxyCodeLine{36 }
\DoxyCodeLine{37   foundentry = .false.}
\DoxyCodeLine{38   \textcolor{comment}{! Each obsolete entry, with replacement name is available.}}
\DoxyCodeLine{39   \textcolor{keywordflow}{if} (found\_in\_diagtable(diag, \textcolor{stringliteral}{'Net\_Heat'}, \textcolor{stringliteral}{'net\_heat\_surface or net\_heat\_coupler'})) foundentry = .true.}
\DoxyCodeLine{40   \textcolor{keywordflow}{if} (found\_in\_diagtable(diag, \textcolor{stringliteral}{'PmE'}, \textcolor{stringliteral}{'PRCmE'}))                                     foundentry = .true.}
\DoxyCodeLine{41   \textcolor{keywordflow}{if} (found\_in\_diagtable(diag, \textcolor{stringliteral}{'froz\_precip'}, \textcolor{stringliteral}{'fprec'}))                             foundentry = .true.}
\DoxyCodeLine{42   \textcolor{keywordflow}{if} (found\_in\_diagtable(diag, \textcolor{stringliteral}{'liq\_precip'}, \textcolor{stringliteral}{'lprec'}))                              foundentry = .true.}
\DoxyCodeLine{43   \textcolor{keywordflow}{if} (found\_in\_diagtable(diag, \textcolor{stringliteral}{'virt\_precip'}, \textcolor{stringliteral}{'vprec'}))                             foundentry = .true.}
\DoxyCodeLine{44   \textcolor{keywordflow}{if} (found\_in\_diagtable(diag, \textcolor{stringliteral}{'froz\_runoff'}, \textcolor{stringliteral}{'frunoff'}))                           foundentry = .true.}
\DoxyCodeLine{45   \textcolor{keywordflow}{if} (found\_in\_diagtable(diag, \textcolor{stringliteral}{'liq\_runoff'}, \textcolor{stringliteral}{'lrunoff'}))                            foundentry = .true.}
\DoxyCodeLine{46   \textcolor{keywordflow}{if} (found\_in\_diagtable(diag, \textcolor{stringliteral}{'calving\_heat\_content'}, \textcolor{stringliteral}{'heat\_content\_frunoff'}))     foundentry = .true.}
\DoxyCodeLine{47   \textcolor{keywordflow}{if} (found\_in\_diagtable(diag, \textcolor{stringliteral}{'precip\_heat\_content'}, \textcolor{stringliteral}{'heat\_content\_lprec'}))        foundentry = .true.}
\DoxyCodeLine{48   \textcolor{keywordflow}{if} (found\_in\_diagtable(diag, \textcolor{stringliteral}{'evap\_heat\_content'}, \textcolor{stringliteral}{'heat\_content\_massout'}))        foundentry = .true.}
\DoxyCodeLine{49   \textcolor{keywordflow}{if} (found\_in\_diagtable(diag, \textcolor{stringliteral}{'runoff\_heat\_content'}, \textcolor{stringliteral}{'heat\_content\_lrunoff'}))      foundentry = .true.}
\DoxyCodeLine{50   \textcolor{keywordflow}{if} (found\_in\_diagtable(diag, \textcolor{stringliteral}{'latent\_fprec'}))                                     foundentry = .true.}
\DoxyCodeLine{51   \textcolor{keywordflow}{if} (found\_in\_diagtable(diag, \textcolor{stringliteral}{'latent\_calve'}))                                     foundentry = .true.}
\DoxyCodeLine{52   \textcolor{keywordflow}{if} (found\_in\_diagtable(diag, \textcolor{stringliteral}{'heat\_rest'}, \textcolor{stringliteral}{'heat\_restore'}))                        foundentry = .true.}
\DoxyCodeLine{53   \textcolor{keywordflow}{if} (found\_in\_diagtable(diag, \textcolor{stringliteral}{'KPP\_dTdt'}, \textcolor{stringliteral}{'KPP\_NLT\_dTdt'}))                         foundentry = .true.}
\DoxyCodeLine{54   \textcolor{keywordflow}{if} (found\_in\_diagtable(diag, \textcolor{stringliteral}{'KPP\_dSdt'}, \textcolor{stringliteral}{'KPP\_NLT\_dSdt'}))                         foundentry = .true.}
\DoxyCodeLine{55 }
\DoxyCodeLine{56   \textcolor{keywordflow}{if} (causefatal) then; errtype = fatal}
\DoxyCodeLine{57   \textcolor{keywordflow}{else} ; errtype = warning ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{58   \textcolor{keywordflow}{if} (foundentry .and. is\_root\_pe()) \&}
\DoxyCodeLine{59     \textcolor{keyword}{call }mom\_error(errtype, \textcolor{stringliteral}{'MOM\_obsolete\_diagnostics: '}//\&}
\DoxyCodeLine{60                             \textcolor{stringliteral}{'Obsolete diagnostics found in diag\_table'})}
\DoxyCodeLine{61 }

\end{DoxyCode}
