\hypertarget{namespacemom__file__parser}{}\doxysection{mom\+\_\+file\+\_\+parser Module Reference}
\label{namespacemom__file__parser}\index{mom\_file\_parser@{mom\_file\_parser}}


\doxysubsection{Detailed Description}
The M\+O\+M6 facility to parse input files for runtime parameters. 

By Robert Hallberg and Alistair Adcroft, updated 9/2013.

The subroutines here parse a set of input files for the value a named parameter and sets that parameter at run time. Currently these files use use one of several formats\+: \#define V\+AR ! To set the logical V\+AR to true. V\+AR = True ! To set the logical V\+AR to true. \#undef V\+AR ! To set the logical V\+AR to false. V\+AR = False ! To set the logical V\+AR to false. \#define V\+AR 999 ! To set the real or integer V\+AR to 999. V\+AR = 999 ! To set the real or integer V\+AR to 999. \#override V\+AR = 888 ! To override a previously set value. V\+AR = 1.\+1, 2.\+2, 3.\+3 ! To set an array of real values. \doxysubsection*{Data Types}
\begin{DoxyCompactItemize}
\item 
type \mbox{\hyperlink{structmom__file__parser_1_1file__data__type}{file\+\_\+data\+\_\+type}}
\begin{DoxyCompactList}\small\item\em The valid lines extracted from an input parameter file without comments. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__file__parser_1_1get__param}{get\+\_\+param}}
\begin{DoxyCompactList}\small\item\em An overloaded interface to read and log the values of various types of parameters. \end{DoxyCompactList}\item 
type \mbox{\hyperlink{structmom__file__parser_1_1link__parameter}{link\+\_\+parameter}}
\begin{DoxyCompactList}\small\item\em A link in the list of variables that have already had override warnings issued. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__file__parser_1_1log__param}{log\+\_\+param}}
\begin{DoxyCompactList}\small\item\em An overloaded interface to log the values of various types of parameters. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__file__parser_1_1log__version}{log\+\_\+version}}
\begin{DoxyCompactList}\small\item\em An overloaded interface to log version information about modules. \end{DoxyCompactList}\item 
type \mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}
\begin{DoxyCompactList}\small\item\em A structure that can be parsed to read and document run-\/time parameters. \end{DoxyCompactList}\item 
type \mbox{\hyperlink{structmom__file__parser_1_1parameter__block}{parameter\+\_\+block}}
\begin{DoxyCompactList}\small\item\em Specify the active parameter block. \end{DoxyCompactList}\item 
interface \mbox{\hyperlink{interfacemom__file__parser_1_1read__param}{read\+\_\+param}}
\begin{DoxyCompactList}\small\item\em An overloaded interface to read various types of parameters. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \mbox{\hyperlink{namespacemom__file__parser_abecae1b9386aafa17aec927af1f8c448}{open\+\_\+param\+\_\+file}} (filename, CS, checkable, component, doc\+\_\+file\+\_\+dir)
\begin{DoxyCompactList}\small\item\em Make the contents of a parameter input file availalble in a \mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__file__parser_a5b47aa31f8cffc5bf495f8d3f2e9c001}{close\+\_\+param\+\_\+file}} (CS, quiet\+\_\+close, component)
\begin{DoxyCompactList}\small\item\em Close any open input files and deallocate memory associated with this \mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}. To use this type again, open\+\_\+param\+\_\+file would have to be called again. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_a7abfd98d7f0831fc0d1f3747a68f1be9}{populate\+\_\+param\+\_\+data}} (iounit, filename, param\+\_\+data)
\begin{DoxyCompactList}\small\item\em Read the contents of a parameter input file, and store the contents in a \mbox{\hyperlink{structmom__file__parser_1_1file__data__type}{file\+\_\+data\+\_\+type}} after removing comments and simplifying white space. \end{DoxyCompactList}\item 
logical function \mbox{\hyperlink{namespacemom__file__parser_a476a2649ce161e38088588e07f7df130}{openmultilinecomment}} (string)
\begin{DoxyCompactList}\small\item\em Return True if a /$\ast$ appears on this line without a closing $\ast$/. \end{DoxyCompactList}\item 
logical function \mbox{\hyperlink{namespacemom__file__parser_a99c426fd23fc4df0c4d05e33039e0a66}{closemultilinecomment}} (string)
\begin{DoxyCompactList}\small\item\em Return True if a $\ast$/ appears on this line. \end{DoxyCompactList}\item 
integer function \mbox{\hyperlink{namespacemom__file__parser_a000fd0a0681f9e73481ef2663154df78}{lastnoncommentindex}} (string)
\begin{DoxyCompactList}\small\item\em Find position of last character before any comments, As marked by \char`\"{}!\char`\"{}, \char`\"{}//\char`\"{}, or \char`\"{}/$\ast$\char`\"{} following F90, C++, or C syntax. \end{DoxyCompactList}\item 
integer function \mbox{\hyperlink{namespacemom__file__parser_ab4b89d9420e174185db1c6aa3feb948b}{lastnoncommentnonblank}} (string)
\begin{DoxyCompactList}\small\item\em Find position of last non-\/blank character before any comments. \end{DoxyCompactList}\item 
character(len=len(string)) function \mbox{\hyperlink{namespacemom__file__parser_a9813087789e0924f363d7f67768c7f42}{replacetabs}} (string)
\begin{DoxyCompactList}\small\item\em Returns a string with tabs replaced by a blank. \end{DoxyCompactList}\item 
character(len=len(string)) function \mbox{\hyperlink{namespacemom__file__parser_ae0b982cc161173a401291757a6677373}{removecomments}} (string)
\begin{DoxyCompactList}\small\item\em Trims comments and leading blanks from string. \end{DoxyCompactList}\item 
character(len=len(string)+16) function \mbox{\hyperlink{namespacemom__file__parser_a3ad322925f44e8cb48c4e652634f6f93}{simplifywhitespace}} (string)
\begin{DoxyCompactList}\small\item\em Constructs a string with all repeated whitespace replaced with single blanks and insert white space where it helps delineate tokens (e.\+g. around =) \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_a28352549cebdb1f8ed8db3655258d502}{read\+\_\+param\+\_\+int}} (CS, varname, value, fail\+\_\+if\+\_\+missing)
\begin{DoxyCompactList}\small\item\em This subroutine reads the value of an integer model parameter from a parameter file. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_a9f3cacd113743a19df607293b6c30ec7}{read\+\_\+param\+\_\+int\+\_\+array}} (CS, varname, value, fail\+\_\+if\+\_\+missing)
\begin{DoxyCompactList}\small\item\em This subroutine reads the values of an array of integer model parameters from a parameter file. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_a95b28c92ef3603d3fb20b0a6d133d4ad}{read\+\_\+param\+\_\+real}} (CS, varname, value, fail\+\_\+if\+\_\+missing, scale)
\begin{DoxyCompactList}\small\item\em This subroutine reads the value of a real model parameter from a parameter file. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_ae85623b4210b35c5e583d48ff536d596}{read\+\_\+param\+\_\+real\+\_\+array}} (CS, varname, value, fail\+\_\+if\+\_\+missing, scale)
\begin{DoxyCompactList}\small\item\em This subroutine reads the values of an array of real model parameters from a parameter file. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_a14c84db15e417656105f7303ad0ac2a2}{read\+\_\+param\+\_\+char}} (CS, varname, value, fail\+\_\+if\+\_\+missing)
\begin{DoxyCompactList}\small\item\em This subroutine reads the value of a character string model parameter from a parameter file. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_a67808253e247b2542d0810e7c7f598f4}{read\+\_\+param\+\_\+char\+\_\+array}} (CS, varname, value, fail\+\_\+if\+\_\+missing)
\begin{DoxyCompactList}\small\item\em This subroutine reads the values of an array of character string model parameters from a parameter file. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_ae12cfb8a4de90b0454683ba5810c79a2}{read\+\_\+param\+\_\+logical}} (CS, varname, value, fail\+\_\+if\+\_\+missing)
\begin{DoxyCompactList}\small\item\em This subroutine reads the value of a logical model parameter from a parameter file. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_a799f1d8af038c5a64b7496018f03b590}{read\+\_\+param\+\_\+time}} (CS, varname, value, timeunit, fail\+\_\+if\+\_\+missing, date\+\_\+format)
\begin{DoxyCompactList}\small\item\em This subroutine reads the value of a time\+\_\+type model parameter from a parameter file. \end{DoxyCompactList}\item 
character(len=\mbox{\hyperlink{namespacemom__file__parser_ac514a928716bf54e5bd4b64afd024274}{input\+\_\+str\+\_\+length}}) function \mbox{\hyperlink{namespacemom__file__parser_a416b4a2a5b52f526ad1815f3e5a4739e}{strip\+\_\+quotes}} (val\+\_\+str)
\begin{DoxyCompactList}\small\item\em This function removes single and double quotes from a character string. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_af883df6020543889b25986d6ee9701f7}{get\+\_\+variable\+\_\+line}} (CS, varname, found, defined, value\+\_\+string, param\+Is\+Logical)
\begin{DoxyCompactList}\small\item\em This subtoutine extracts the contents of lines in the \mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}} that refer to a named parameter. The value\+\_\+string that is returned must be interepreted in a way that depends on the type of this variable. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_a7803aabff129cc7f56d4516bc24613f0}{flag\+\_\+line\+\_\+as\+\_\+read}} (line\+\_\+used, count)
\begin{DoxyCompactList}\small\item\em Record that a line has been used to set a parameter. \end{DoxyCompactList}\item 
logical function \mbox{\hyperlink{namespacemom__file__parser_a0c9bb1e76b09bc09bae5402e63bd0f99}{overridewarninghasbeenissued}} (chain, var\+Name)
\begin{DoxyCompactList}\small\item\em Returns true if an override warning has been issued for the variable var\+Name. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_a639194f100f2bb42379a1dd84bac7b47}{log\+\_\+version\+\_\+cs}} (CS, modulename, version, desc, log\+\_\+to\+\_\+all, all\+\_\+default, layout, debugging)
\begin{DoxyCompactList}\small\item\em Log the version of a module to a log file and/or stdout, and/or to the parameter documentation file. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_aae4fde48d1b45f8afdd1131a637eb356}{log\+\_\+version\+\_\+plain}} (modulename, version)
\begin{DoxyCompactList}\small\item\em Log the version of a module to a log file and/or stdout. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_a9de0970faa34e6db6f15f526cf305ca4}{log\+\_\+param\+\_\+int}} (CS, modulename, varname, value, desc, units, default, layout\+Param, debugging\+Param, like\+\_\+default)
\begin{DoxyCompactList}\small\item\em Log the name and value of an integer model parameter in documentation files. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_ac3d162a4e2d2240609561675842223aa}{log\+\_\+param\+\_\+int\+\_\+array}} (CS, modulename, varname, value, desc, units, default, layout\+Param, debugging\+Param, like\+\_\+default)
\begin{DoxyCompactList}\small\item\em Log the name and values of an array of integer model parameter in documentation files. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_aa90bbff4e22d9e05ba9a68a350852fd0}{log\+\_\+param\+\_\+real}} (CS, modulename, varname, value, desc, units, default, debugging\+Param, like\+\_\+default)
\begin{DoxyCompactList}\small\item\em Log the name and value of a real model parameter in documentation files. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_a299e3cf82ae37f14ca38dc9323238621}{log\+\_\+param\+\_\+real\+\_\+array}} (CS, modulename, varname, value, desc, units, default, debugging\+Param, like\+\_\+default)
\begin{DoxyCompactList}\small\item\em Log the name and values of an array of real model parameter in documentation files. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_af40b11dca775343525981f4c5521478f}{log\+\_\+param\+\_\+logical}} (CS, modulename, varname, value, desc, units, default, layout\+Param, debugging\+Param, like\+\_\+default)
\begin{DoxyCompactList}\small\item\em Log the name and value of a logical model parameter in documentation files. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_afc8a86933730879e4ba4d28ec9736c30}{log\+\_\+param\+\_\+char}} (CS, modulename, varname, value, desc, units, default, layout\+Param, debugging\+Param, like\+\_\+default)
\begin{DoxyCompactList}\small\item\em Log the name and value of a character string model parameter in documentation files. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_ae26a3a3f39d3ef66de55aea6ac27a681}{log\+\_\+param\+\_\+time}} (CS, modulename, varname, value, desc, units, default, timeunit, layout\+Param, debugging\+Param, log\+\_\+date, like\+\_\+default)
\begin{DoxyCompactList}\small\item\em This subroutine writes the value of a time-\/type parameter to a log file, along with its name and the module it came from. \end{DoxyCompactList}\item 
character(len=40) function \mbox{\hyperlink{namespacemom__file__parser_a4e4202d8779a697aff0f521104e38786}{convert\+\_\+date\+\_\+to\+\_\+string}} (date)
\begin{DoxyCompactList}\small\item\em This function converts a date into a string, valid with ticks and for dates up to year 99,999,999. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_ac9428b418b2382019d418c0e30c97734}{get\+\_\+param\+\_\+int}} (CS, modulename, varname, value, desc, units, default, fail\+\_\+if\+\_\+missing, do\+\_\+not\+\_\+read, do\+\_\+not\+\_\+log, static\+\_\+value, layout\+Param, debugging\+Param)
\begin{DoxyCompactList}\small\item\em This subroutine reads the value of an integer model parameter from a parameter file and logs it in documentation files. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_a07b858dc2b7ce18929501b4738e96c3a}{get\+\_\+param\+\_\+int\+\_\+array}} (CS, modulename, varname, value, desc, units, default, fail\+\_\+if\+\_\+missing, do\+\_\+not\+\_\+read, do\+\_\+not\+\_\+log, static\+\_\+value, layout\+Param, debugging\+Param)
\begin{DoxyCompactList}\small\item\em This subroutine reads the values of an array of integer model parameters from a parameter file and logs them in documentation files. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_a2d6fb93c7802322c2ed145413aacaf30}{get\+\_\+param\+\_\+real}} (CS, modulename, varname, value, desc, units, default, fail\+\_\+if\+\_\+missing, do\+\_\+not\+\_\+read, do\+\_\+not\+\_\+log, static\+\_\+value, debugging\+Param, scale, unscaled)
\begin{DoxyCompactList}\small\item\em This subroutine reads the value of a real model parameter from a parameter file and logs it in documentation files. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_aaea9c54ad3bb4ad7a6e41a5f9715fb34}{get\+\_\+param\+\_\+real\+\_\+array}} (CS, modulename, varname, value, desc, units, default, fail\+\_\+if\+\_\+missing, do\+\_\+not\+\_\+read, do\+\_\+not\+\_\+log, debugging\+Param, static\+\_\+value, scale, unscaled)
\begin{DoxyCompactList}\small\item\em This subroutine reads the values of an array of real model parameters from a parameter file and logs them in documentation files. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_ad4bee0d73cd5df0bb017180f354f514b}{get\+\_\+param\+\_\+char}} (CS, modulename, varname, value, desc, units, default, fail\+\_\+if\+\_\+missing, do\+\_\+not\+\_\+read, do\+\_\+not\+\_\+log, static\+\_\+value, layout\+Param, debugging\+Param)
\begin{DoxyCompactList}\small\item\em This subroutine reads the value of a character string model parameter from a parameter file and logs it in documentation files. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_aa3f8a251fb4f7bbae28b136ebc17a8f3}{get\+\_\+param\+\_\+char\+\_\+array}} (CS, modulename, varname, value, desc, units, default, fail\+\_\+if\+\_\+missing, do\+\_\+not\+\_\+read, do\+\_\+not\+\_\+log, static\+\_\+value)
\begin{DoxyCompactList}\small\item\em This subroutine reads the values of an array of character string model parameters from a parameter file and logs them in documentation files. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_a470b3af82a8b146f375e4ca13c58e70f}{get\+\_\+param\+\_\+logical}} (CS, modulename, varname, value, desc, units, default, fail\+\_\+if\+\_\+missing, do\+\_\+not\+\_\+read, do\+\_\+not\+\_\+log, static\+\_\+value, layout\+Param, debugging\+Param)
\begin{DoxyCompactList}\small\item\em This subroutine reads the value of a logical model parameter from a parameter file and logs it in documentation files. \end{DoxyCompactList}\item 
subroutine \mbox{\hyperlink{namespacemom__file__parser_ab433eff650ddf3ce82d97f1c8432b6a8}{get\+\_\+param\+\_\+time}} (CS, modulename, varname, value, desc, units, default, fail\+\_\+if\+\_\+missing, do\+\_\+not\+\_\+read, do\+\_\+not\+\_\+log, timeunit, static\+\_\+value, layout\+Param, debugging\+Param, log\+\_\+as\+\_\+date)
\begin{DoxyCompactList}\small\item\em This subroutine reads the value of a time-\/type model parameter from a parameter file and logs it in documentation files. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__file__parser_ac5f9784f44db42cae5f3550b4742d290}{clearparameterblock}} (CS)
\begin{DoxyCompactList}\small\item\em Resets the parameter block name to blank. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__file__parser_a363628fcd8540de780ebeacf24012229}{openparameterblock}} (CS, block\+Name, desc)
\begin{DoxyCompactList}\small\item\em Tags block\+Name onto the end of the active parameter block name. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__file__parser_a0d01b9a66f5ac12b657c00f1295351bb}{closeparameterblock}} (CS)
\begin{DoxyCompactList}\small\item\em Remove the lowest level of recursion from the active block name. \end{DoxyCompactList}\item 
character(len=len(oldblockname)+40) function \mbox{\hyperlink{namespacemom__file__parser_a58777b0faf747d59a793b4e238919dc6}{pushblocklevel}} (oldblock\+Name, new\+Block\+Name)
\begin{DoxyCompactList}\small\item\em Extends block name (deeper level of parameter block) \end{DoxyCompactList}\item 
character(len=len(oldblockname)+40) function \mbox{\hyperlink{namespacemom__file__parser_a73b11b969d303b1fc0ba5235c812fd05}{popblocklevel}} (oldblock\+Name)
\begin{DoxyCompactList}\small\item\em Truncates block name (shallower level of parameter block) \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{namespacemom__file__parser_ab9f0c0f9dd384309c631b7d59242da7f}\label{namespacemom__file__parser_ab9f0c0f9dd384309c631b7d59242da7f}} 
integer, parameter, public \mbox{\hyperlink{namespacemom__file__parser_ab9f0c0f9dd384309c631b7d59242da7f}{max\+\_\+param\+\_\+files}} = 5
\begin{DoxyCompactList}\small\item\em Maximum number of parameter files. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__file__parser_ac514a928716bf54e5bd4b64afd024274}\label{namespacemom__file__parser_ac514a928716bf54e5bd4b64afd024274}} 
integer, parameter \mbox{\hyperlink{namespacemom__file__parser_ac514a928716bf54e5bd4b64afd024274}{input\+\_\+str\+\_\+length}} = 320
\begin{DoxyCompactList}\small\item\em Maximum line length in parameter file. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__file__parser_a24f64b2b5c41a7bb4e72df9546b66894}\label{namespacemom__file__parser_a24f64b2b5c41a7bb4e72df9546b66894}} 
integer, parameter \mbox{\hyperlink{namespacemom__file__parser_a24f64b2b5c41a7bb4e72df9546b66894}{filename\+\_\+length}} = 200
\begin{DoxyCompactList}\small\item\em Maximum number of characters in file names. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__file__parser_aba0503dd7b462b821f4f4f25d286cd1d}\label{namespacemom__file__parser_aba0503dd7b462b821f4f4f25d286cd1d}} 
logical \mbox{\hyperlink{namespacemom__file__parser_aba0503dd7b462b821f4f4f25d286cd1d}{all\+\_\+pes\+\_\+read}} = .false.
\begin{DoxyCompactList}\small\item\em If true, all P\+Es read the input files T\+O\+DO\+: Eliminate this parameter. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacemom__file__parser_ac5f9784f44db42cae5f3550b4742d290}\label{namespacemom__file__parser_ac5f9784f44db42cae5f3550b4742d290}} 
\index{mom\_file\_parser@{mom\_file\_parser}!clearparameterblock@{clearparameterblock}}
\index{clearparameterblock@{clearparameterblock}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{clearparameterblock()}{clearparameterblock()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+file\+\_\+parser\+::clearparameterblock (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS }\end{DoxyParamCaption})}



Resets the parameter block name to blank. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\end{DoxyParams}


Definition at line 2028 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{2028   \textcolor{keywordtype}{type}(param\_file\_type), \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{2029 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{2030 }
\DoxyCodeLine{2031   \textcolor{keywordtype}{type}(parameter\_block), \textcolor{keywordtype}{pointer} :: block => null()}
\DoxyCodeLine{2032   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs\%blockName)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{2033     block => cs\%blockName}
\DoxyCodeLine{2034     block\%name = \textcolor{stringliteral}{''}}
\DoxyCodeLine{2035   \textcolor{keywordflow}{else}}
\DoxyCodeLine{2036     \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{2037       \textcolor{stringliteral}{'clearParameterBlock: A clear was attempted before allocation.'})}
\DoxyCodeLine{2038 \textcolor{keywordflow}{  endif}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a5b47aa31f8cffc5bf495f8d3f2e9c001}\label{namespacemom__file__parser_a5b47aa31f8cffc5bf495f8d3f2e9c001}} 
\index{mom\_file\_parser@{mom\_file\_parser}!close\_param\_file@{close\_param\_file}}
\index{close\_param\_file@{close\_param\_file}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{close\_param\_file()}{close\_param\_file()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+file\+\_\+parser\+::close\+\_\+param\+\_\+file (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(inout)}]{CS,  }\item[{logical, intent(in), optional}]{quiet\+\_\+close,  }\item[{character(len=$\ast$), intent(in), optional}]{component }\end{DoxyParamCaption})}



Close any open input files and deallocate memory associated with this \mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}. To use this type again, open\+\_\+param\+\_\+file would have to be called again. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em quiet\+\_\+close} & if present and true, do not do any logging with this call. \\
\hline
\mbox{\texttt{ in}}  & {\em component} & If present, this component name is used to generate parameter documentation file names \\
\hline
\end{DoxyParams}


Definition at line 242 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{242   \textcolor{keywordtype}{type}(param\_file\_type),   \textcolor{keywordtype}{intent(inout)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{243 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{244   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: quiet\_close\textcolor{comment}{ !< if present and true, do not do any}}
\DoxyCodeLine{245 \textcolor{comment}{                                         !! logging with this call.}}
\DoxyCodeLine{246   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: component\textcolor{comment}{   !< If present, this component name is used}}
\DoxyCodeLine{247 \textcolor{comment}{                                         !! to generate parameter documentation file names}}
\DoxyCodeLine{248   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{249   \textcolor{keywordtype}{logical} :: all\_default}
\DoxyCodeLine{250   \textcolor{keywordtype}{character(len=128)} :: docfile\_default}
\DoxyCodeLine{251   \textcolor{keywordtype}{character(len=40)}  :: mdl   \textcolor{comment}{! This module's name.}}
\DoxyCodeLine{252   \textcolor{comment}{! This include declares and sets the variable "version".}}
\DoxyCodeLine{253 \textcolor{preprocessor}{\# include "version\_variable.h"}}
\DoxyCodeLine{254 \textcolor{preprocessor}{}  \textcolor{keywordtype}{integer} :: i, n, num\_unused}
\DoxyCodeLine{255 }
\DoxyCodeLine{256   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(quiet\_close)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (quiet\_close) \textcolor{keywordflow}{then}}
\DoxyCodeLine{257     \textcolor{keywordflow}{do} i = 1, cs\%nfiles}
\DoxyCodeLine{258       \textcolor{keywordflow}{if} (all\_pes\_read .or. is\_root\_pe()) \textcolor{keyword}{close}(cs\%iounit(i))}
\DoxyCodeLine{259       \textcolor{keyword}{call }mom\_mesg(\textcolor{stringliteral}{"close\_param\_file: "}// trim(cs\%filename(i))// \&}
\DoxyCodeLine{260                     \textcolor{stringliteral}{" has been closed successfully."}, 5)}
\DoxyCodeLine{261       cs\%iounit(i) = -\/1}
\DoxyCodeLine{262       cs\%filename(i) = \textcolor{stringliteral}{''}}
\DoxyCodeLine{263       cs\%NetCDF\_file(i) = .false.}
\DoxyCodeLine{264       \textcolor{keyword}{deallocate} (cs\%param\_data(i)\%line)}
\DoxyCodeLine{265       \textcolor{keyword}{deallocate} (cs\%param\_data(i)\%line\_used)}
\DoxyCodeLine{266 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{267     cs\%log\_open = .false.}
\DoxyCodeLine{268     \textcolor{keyword}{call }doc\_end(cs\%doc)}
\DoxyCodeLine{269     \textcolor{keywordflow}{return}}
\DoxyCodeLine{270 \textcolor{keywordflow}{  endif} ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{271 }
\DoxyCodeLine{272   \textcolor{comment}{! Log the parameters for the parser.}}
\DoxyCodeLine{273   docfile\_default = \textcolor{stringliteral}{"MOM\_parameter\_doc"}}
\DoxyCodeLine{274   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(component)) docfile\_default = trim(component)//\textcolor{stringliteral}{"\_parameter\_doc"}}
\DoxyCodeLine{275 }
\DoxyCodeLine{276   all\_default = (cs\%log\_to\_stdout .eqv. log\_to\_stdout\_default)}
\DoxyCodeLine{277   all\_default = all\_default .and. (trim(cs\%doc\_file) == trim(docfile\_default))}
\DoxyCodeLine{278   \textcolor{keywordflow}{if} (len\_trim(cs\%doc\_file) > 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{279     all\_default = all\_default .and. (cs\%complete\_doc .eqv. complete\_doc\_default)}
\DoxyCodeLine{280     all\_default = all\_default .and. (cs\%minimal\_doc .eqv. minimal\_doc\_default)}
\DoxyCodeLine{281 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{282 }
\DoxyCodeLine{283   mdl = \textcolor{stringliteral}{"MOM\_file\_parser"}}
\DoxyCodeLine{284   \textcolor{keyword}{call }log\_version(cs, mdl, version, \textcolor{stringliteral}{""}, debugging=.true., log\_to\_all=.true., all\_default=all\_default)}
\DoxyCodeLine{285   \textcolor{keyword}{call }log\_param(cs, mdl, \textcolor{stringliteral}{"SEND\_LOG\_TO\_STDOUT"}, cs\%log\_to\_stdout, \&}
\DoxyCodeLine{286                  \textcolor{stringliteral}{"If true, all log messages are also sent to stdout."}, \&}
\DoxyCodeLine{287                  default=log\_to\_stdout\_default)}
\DoxyCodeLine{288   \textcolor{keyword}{call }log\_param(cs, mdl, \textcolor{stringliteral}{"REPORT\_UNUSED\_PARAMS"}, cs\%report\_unused, \&}
\DoxyCodeLine{289                  \textcolor{stringliteral}{"If true, report any parameter lines that are not used "}//\&}
\DoxyCodeLine{290                  \textcolor{stringliteral}{"in the run."}, default=report\_unused\_default, \&}
\DoxyCodeLine{291                  debuggingparam=.true.)}
\DoxyCodeLine{292   \textcolor{keyword}{call }log\_param(cs, mdl, \textcolor{stringliteral}{"FATAL\_UNUSED\_PARAMS"}, cs\%unused\_params\_fatal, \&}
\DoxyCodeLine{293                  \textcolor{stringliteral}{"If true, kill the run if there are any unused "}//\&}
\DoxyCodeLine{294                  \textcolor{stringliteral}{"parameters."}, default=unused\_params\_fatal\_default, \&}
\DoxyCodeLine{295                  debuggingparam=.true.)}
\DoxyCodeLine{296   \textcolor{keyword}{call }log\_param(cs, mdl, \textcolor{stringliteral}{"DOCUMENT\_FILE"}, cs\%doc\_file, \&}
\DoxyCodeLine{297                  \textcolor{stringliteral}{"The basename for files where run-\/time parameters, their "}//\&}
\DoxyCodeLine{298                  \textcolor{stringliteral}{"settings, units and defaults are documented. Blank will "}//\&}
\DoxyCodeLine{299                  \textcolor{stringliteral}{"disable all parameter documentation."}, default=docfile\_default)}
\DoxyCodeLine{300   \textcolor{keywordflow}{if} (len\_trim(cs\%doc\_file) > 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{301     \textcolor{keyword}{call }log\_param(cs, mdl, \textcolor{stringliteral}{"COMPLETE\_DOCUMENTATION"},  cs\%complete\_doc, \&}
\DoxyCodeLine{302                   \textcolor{stringliteral}{"If true, all run-\/time parameters are "}//\&}
\DoxyCodeLine{303                   \textcolor{stringliteral}{"documented in "}//trim(cs\%doc\_file)//\&}
\DoxyCodeLine{304                   \textcolor{stringliteral}{".all ."}, default=complete\_doc\_default)}
\DoxyCodeLine{305     \textcolor{keyword}{call }log\_param(cs, mdl, \textcolor{stringliteral}{"MINIMAL\_DOCUMENTATION"}, cs\%minimal\_doc, \&}
\DoxyCodeLine{306                   \textcolor{stringliteral}{"If true, non-\/default run-\/time parameters are "}//\&}
\DoxyCodeLine{307                   \textcolor{stringliteral}{"documented in "}//trim(cs\%doc\_file)//\&}
\DoxyCodeLine{308                   \textcolor{stringliteral}{".short ."}, default=minimal\_doc\_default)}
\DoxyCodeLine{309 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{310 }
\DoxyCodeLine{311   num\_unused = 0}
\DoxyCodeLine{312   \textcolor{keywordflow}{do} i = 1, cs\%nfiles}
\DoxyCodeLine{313     \textcolor{keywordflow}{if} (is\_root\_pe() .and. (cs\%report\_unused .or. \&}
\DoxyCodeLine{314                             cs\%unused\_params\_fatal)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{315       \textcolor{comment}{! Check for unused lines.}}
\DoxyCodeLine{316       \textcolor{keywordflow}{do} n=1,cs\%param\_data(i)\%num\_lines}
\DoxyCodeLine{317         \textcolor{keywordflow}{if} (.not.cs\%param\_data(i)\%line\_used(n)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{318           num\_unused = num\_unused + 1}
\DoxyCodeLine{319           \textcolor{keywordflow}{if} (cs\%report\_unused) \&}
\DoxyCodeLine{320             \textcolor{keyword}{call }mom\_error(warning, \textcolor{stringliteral}{"Unused line in "}//trim(cs\%filename(i))// \&}
\DoxyCodeLine{321                             \textcolor{stringliteral}{" : "}//trim(cs\%param\_data(i)\%line(n)))}
\DoxyCodeLine{322 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{323 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{324 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{325 }
\DoxyCodeLine{326     \textcolor{keywordflow}{if} (all\_pes\_read .or. is\_root\_pe()) \textcolor{keyword}{close}(cs\%iounit(i))}
\DoxyCodeLine{327     \textcolor{keyword}{call }mom\_mesg(\textcolor{stringliteral}{"close\_param\_file: "}// trim(cs\%filename(i))// \&}
\DoxyCodeLine{328                   \textcolor{stringliteral}{" has been closed successfully."}, 5)}
\DoxyCodeLine{329     cs\%iounit(i) = -\/1}
\DoxyCodeLine{330     cs\%filename(i) = \textcolor{stringliteral}{''}}
\DoxyCodeLine{331     cs\%NetCDF\_file(i) = .false.}
\DoxyCodeLine{332     \textcolor{keyword}{deallocate} (cs\%param\_data(i)\%line)}
\DoxyCodeLine{333     \textcolor{keyword}{deallocate} (cs\%param\_data(i)\%line\_used)}
\DoxyCodeLine{334 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{335 }
\DoxyCodeLine{336   \textcolor{keywordflow}{if} (is\_root\_pe() .and. (num\_unused>0) .and. cs\%unused\_params\_fatal) \&}
\DoxyCodeLine{337     \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"Run stopped because of unused parameter lines."})}
\DoxyCodeLine{338 }
\DoxyCodeLine{339   cs\%log\_open = .false.}
\DoxyCodeLine{340   \textcolor{keyword}{call }doc\_end(cs\%doc)}
\DoxyCodeLine{341 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a99c426fd23fc4df0c4d05e33039e0a66}\label{namespacemom__file__parser_a99c426fd23fc4df0c4d05e33039e0a66}} 
\index{mom\_file\_parser@{mom\_file\_parser}!closemultilinecomment@{closemultilinecomment}}
\index{closemultilinecomment@{closemultilinecomment}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{closemultilinecomment()}{closemultilinecomment()}}
{\footnotesize\ttfamily logical function mom\+\_\+file\+\_\+parser\+::closemultilinecomment (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{string }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Return True if a $\ast$/ appears on this line. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em string} & The input string to process \\
\hline
\end{DoxyParams}


Definition at line 464 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{464   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{intent(in)} :: string\textcolor{comment}{  !< The input string to process}}
\DoxyCodeLine{465   \textcolor{keywordtype}{logical}                      :: closeMultiLineComment}
\DoxyCodeLine{466 \textcolor{comment}{! True if a */ appears on this line}}
\DoxyCodeLine{467   closemultilinecomment = .false.}
\DoxyCodeLine{468   \textcolor{keywordflow}{if} (index(string, \textcolor{stringliteral}{"*/"})>0) closemultilinecomment=.true.}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a0d01b9a66f5ac12b657c00f1295351bb}\label{namespacemom__file__parser_a0d01b9a66f5ac12b657c00f1295351bb}} 
\index{mom\_file\_parser@{mom\_file\_parser}!closeparameterblock@{closeparameterblock}}
\index{closeparameterblock@{closeparameterblock}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{closeparameterblock()}{closeparameterblock()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+file\+\_\+parser\+::closeparameterblock (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS }\end{DoxyParamCaption})}



Remove the lowest level of recursion from the active block name. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\end{DoxyParams}


Definition at line 2061 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{2061   \textcolor{keywordtype}{type}(param\_file\_type), \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{2062 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{2063 }
\DoxyCodeLine{2064   \textcolor{keywordtype}{type}(parameter\_block), \textcolor{keywordtype}{pointer} :: block => null()}
\DoxyCodeLine{2065 }
\DoxyCodeLine{2066   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs\%blockName)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{2067     block => cs\%blockName}
\DoxyCodeLine{2068     \textcolor{keywordflow}{if} (is\_root\_pe().and.len\_trim(block\%name)==0) \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{2069       \textcolor{stringliteral}{'closeParameterBlock: A pop was attempted on an empty stack. ("'}//\&}
\DoxyCodeLine{2070       trim(block\%name)//\textcolor{stringliteral}{'")'})}
\DoxyCodeLine{2071     \textcolor{keyword}{call }doc\_closeblock(cs\%doc,block\%name)}
\DoxyCodeLine{2072   \textcolor{keywordflow}{else}}
\DoxyCodeLine{2073     \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{2074       \textcolor{stringliteral}{'closeParameterBlock: A pop was attempted before allocation.'})}
\DoxyCodeLine{2075 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{2076   block\%name = popblocklevel(block\%name)}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a4e4202d8779a697aff0f521104e38786}\label{namespacemom__file__parser_a4e4202d8779a697aff0f521104e38786}} 
\index{mom\_file\_parser@{mom\_file\_parser}!convert\_date\_to\_string@{convert\_date\_to\_string}}
\index{convert\_date\_to\_string@{convert\_date\_to\_string}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{convert\_date\_to\_string()}{convert\_date\_to\_string()}}
{\footnotesize\ttfamily character(len=40) function mom\+\_\+file\+\_\+parser\+::convert\+\_\+date\+\_\+to\+\_\+string (\begin{DoxyParamCaption}\item[{type(time\+\_\+type), intent(in)}]{date }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This function converts a date into a string, valid with ticks and for dates up to year 99,999,999. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em date} & The date to be translated into a string. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A date string in a format like Y\+Y\+Y\+Y-\/\+M\+M-\/\+DD H\+H\+:\+MM\+:S\+S.\+sss 
\end{DoxyReturn}


Definition at line 1596 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1596   \textcolor{keywordtype}{type}(time\_type), \textcolor{keywordtype}{intent(in)} :: date\textcolor{comment}{ !< The date to be translated into a string.}}
\DoxyCodeLine{1597   \textcolor{keywordtype}{character(len=40)} :: date\_string\textcolor{comment}{    !< A date string in a format like YYYY-\/MM-\/DD HH:MM:SS.sss}}
\DoxyCodeLine{1598 }
\DoxyCodeLine{1599   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{1600   \textcolor{keywordtype}{character(len=40)} :: sub\_string}
\DoxyCodeLine{1601 \textcolor{keywordtype}{  real}    :: real\_secs}
\DoxyCodeLine{1602   \textcolor{keywordtype}{integer} :: yrs, mons, days, hours, mins, secs, ticks, ticks\_per\_sec}
\DoxyCodeLine{1603 }
\DoxyCodeLine{1604   \textcolor{keyword}{call }get\_date(date, yrs, mons, days, hours, mins, secs, ticks)}
\DoxyCodeLine{1605   \textcolor{keyword}{write} (date\_string, \textcolor{stringliteral}{'(i8.4)'}) yrs}
\DoxyCodeLine{1606   \textcolor{keyword}{write} (sub\_string, \textcolor{stringliteral}{'("-\/", i2.2, "-\/", I2.2, " ", i2.2, ":", i2.2, ":")'}) \&}
\DoxyCodeLine{1607          mons, days, hours, mins}
\DoxyCodeLine{1608   date\_string = trim(adjustl(date\_string)) // trim(sub\_string)}
\DoxyCodeLine{1609   \textcolor{keywordflow}{if} (ticks > 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1610     ticks\_per\_sec = get\_ticks\_per\_second()}
\DoxyCodeLine{1611     real\_secs = secs + ticks/ticks\_per\_sec}
\DoxyCodeLine{1612     \textcolor{keywordflow}{if} (ticks\_per\_sec <= 100) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1613       \textcolor{keyword}{write} (sub\_string, \textcolor{stringliteral}{'(F7.3)'}) real\_secs}
\DoxyCodeLine{1614     \textcolor{keywordflow}{else}}
\DoxyCodeLine{1615       \textcolor{keyword}{write} (sub\_string, \textcolor{stringliteral}{'(F10.6)'}) real\_secs}
\DoxyCodeLine{1616 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1617   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1618     \textcolor{keyword}{write} (sub\_string, \textcolor{stringliteral}{'(i2.2)'}) secs}
\DoxyCodeLine{1619 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1620   date\_string = trim(date\_string) // trim(adjustl(sub\_string))}
\DoxyCodeLine{1621 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a7803aabff129cc7f56d4516bc24613f0}\label{namespacemom__file__parser_a7803aabff129cc7f56d4516bc24613f0}} 
\index{mom\_file\_parser@{mom\_file\_parser}!flag\_line\_as\_read@{flag\_line\_as\_read}}
\index{flag\_line\_as\_read@{flag\_line\_as\_read}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{flag\_line\_as\_read()}{flag\_line\_as\_read()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::flag\+\_\+line\+\_\+as\+\_\+read (\begin{DoxyParamCaption}\item[{logical, dimension(\+:), pointer}]{line\+\_\+used,  }\item[{integer, intent(in)}]{count }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Record that a line has been used to set a parameter. 


\begin{DoxyParams}[1]{Parameters}
 & {\em line\+\_\+used} & A structure indicating which lines have been read \\
\hline
\mbox{\texttt{ in}}  & {\em count} & The parameter on this line number has been read \\
\hline
\end{DoxyParams}


Definition at line 1218 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1218   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{pointer} :: line\_used\textcolor{comment}{ !< A structure indicating which lines have been read}}
\DoxyCodeLine{1219   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)} :: count\textcolor{comment}{ !< The parameter on this line number has been read}}
\DoxyCodeLine{1220   line\_used(count) = .true.}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_ad4bee0d73cd5df0bb017180f354f514b}\label{namespacemom__file__parser_ad4bee0d73cd5df0bb017180f354f514b}} 
\index{mom\_file\_parser@{mom\_file\_parser}!get\_param\_char@{get\_param\_char}}
\index{get\_param\_char@{get\_param\_char}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{get\_param\_char()}{get\_param\_char()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::get\+\_\+param\+\_\+char (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{modulename,  }\item[{character(len=$\ast$), intent(in)}]{varname,  }\item[{character(len=$\ast$), intent(inout)}]{value,  }\item[{character(len=$\ast$), intent(in), optional}]{desc,  }\item[{character(len=$\ast$), intent(in), optional}]{units,  }\item[{character(len=$\ast$), intent(in), optional}]{default,  }\item[{logical, intent(in), optional}]{fail\+\_\+if\+\_\+missing,  }\item[{logical, intent(in), optional}]{do\+\_\+not\+\_\+read,  }\item[{logical, intent(in), optional}]{do\+\_\+not\+\_\+log,  }\item[{character(len=$\ast$), intent(in), optional}]{static\+\_\+value,  }\item[{logical, intent(in), optional}]{layout\+Param,  }\item[{logical, intent(in), optional}]{debugging\+Param }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine reads the value of a character string model parameter from a parameter file and logs it in documentation files. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em modulename} & The name of the calling module \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The case-\/sensitive name of the parameter to read \\
\hline
\mbox{\texttt{ in,out}}  & {\em value} & The value of the parameter that may be read from the parameter file and logged \\
\hline
\mbox{\texttt{ in}}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file \\
\hline
\mbox{\texttt{ in}}  & {\em units} & The units of this parameter \\
\hline
\mbox{\texttt{ in}}  & {\em default} & The default value of the parameter \\
\hline
\mbox{\texttt{ in}}  & {\em static\+\_\+value} & If this parameter is static, it takes this value, which can be compared for consistency with what is in the parameter file. \\
\hline
\mbox{\texttt{ in}}  & {\em fail\+\_\+if\+\_\+missing} & If present and true, a fatal error occurs if this variable is not found in the parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em do\+\_\+not\+\_\+read} & If present and true, do not read a value for this parameter, although it might be logged. \\
\hline
\mbox{\texttt{ in}}  & {\em do\+\_\+not\+\_\+log} & If present and true, do not log this parameter to the documentation files \\
\hline
\mbox{\texttt{ in}}  & {\em layoutparam} & If present and true, this parameter is logged in the layout parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em debuggingparam} & If present and true, this parameter is logged in the debugging parameter file \\
\hline
\end{DoxyParams}


Definition at line 1827 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1827   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)}    :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{1828 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{1829   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: modulename\textcolor{comment}{ !< The name of the calling module}}
\DoxyCodeLine{1830   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: varname\textcolor{comment}{ !< The case-\/sensitive name of the parameter to read}}
\DoxyCodeLine{1831   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}}
\DoxyCodeLine{1832 \textcolor{comment}{                                         !! read from the parameter file and logged}}
\DoxyCodeLine{1833   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: desc\textcolor{comment}{    !< A description of this variable; if not}}
\DoxyCodeLine{1834 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}}
\DoxyCodeLine{1835   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: units\textcolor{comment}{   !< The units of this parameter}}
\DoxyCodeLine{1836   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: default\textcolor{comment}{ !< The default value of the parameter}}
\DoxyCodeLine{1837   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: static\_value\textcolor{comment}{ !< If this parameter is static, it takes}}
\DoxyCodeLine{1838 \textcolor{comment}{                                         !! this value, which can be compared for consistency with}}
\DoxyCodeLine{1839 \textcolor{comment}{                                         !! what is in the parameter file.}}
\DoxyCodeLine{1840   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}}
\DoxyCodeLine{1841 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}}
\DoxyCodeLine{1842   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_read\textcolor{comment}{  !< If present and true, do not read a}}
\DoxyCodeLine{1843 \textcolor{comment}{                                         !! value for this parameter, although it might be logged.}}
\DoxyCodeLine{1844   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_log\textcolor{comment}{ !< If present and true, do not log this}}
\DoxyCodeLine{1845 \textcolor{comment}{                                         !! parameter to the documentation files}}
\DoxyCodeLine{1846   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: layoutParam\textcolor{comment}{ !< If present and true, this parameter is}}
\DoxyCodeLine{1847 \textcolor{comment}{                                         !! logged in the layout parameter file}}
\DoxyCodeLine{1848   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}}
\DoxyCodeLine{1849 \textcolor{comment}{                                         !! logged in the debugging parameter file}}
\DoxyCodeLine{1850 }
\DoxyCodeLine{1851   \textcolor{keywordtype}{logical} :: do\_read, do\_log}
\DoxyCodeLine{1852 }
\DoxyCodeLine{1853   do\_read = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_read)) do\_read = .not.do\_not\_read}
\DoxyCodeLine{1854   do\_log  = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_log))  do\_log  = .not.do\_not\_log}
\DoxyCodeLine{1855 }
\DoxyCodeLine{1856   \textcolor{keywordflow}{if} (do\_read) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1857     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) \textcolor{keywordtype}{value} = default}
\DoxyCodeLine{1858     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(static\_value)) \textcolor{keywordtype}{value} = static\_value}
\DoxyCodeLine{1859     \textcolor{keyword}{call }read\_param\_char(cs, varname, \textcolor{keywordtype}{value}, fail\_if\_missing)}
\DoxyCodeLine{1860 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1861 }
\DoxyCodeLine{1862   \textcolor{keywordflow}{if} (do\_log) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1863     \textcolor{keyword}{call }log\_param\_char(cs, modulename, varname, \textcolor{keywordtype}{value}, desc, units, \&}
\DoxyCodeLine{1864                         default, layoutparam, debuggingparam)}
\DoxyCodeLine{1865 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1866 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_aa3f8a251fb4f7bbae28b136ebc17a8f3}\label{namespacemom__file__parser_aa3f8a251fb4f7bbae28b136ebc17a8f3}} 
\index{mom\_file\_parser@{mom\_file\_parser}!get\_param\_char\_array@{get\_param\_char\_array}}
\index{get\_param\_char\_array@{get\_param\_char\_array}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{get\_param\_char\_array()}{get\_param\_char\_array()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::get\+\_\+param\+\_\+char\+\_\+array (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{modulename,  }\item[{character(len=$\ast$), intent(in)}]{varname,  }\item[{character(len=$\ast$), dimension(\+:), intent(inout)}]{value,  }\item[{character(len=$\ast$), intent(in), optional}]{desc,  }\item[{character(len=$\ast$), intent(in), optional}]{units,  }\item[{character(len=$\ast$), intent(in), optional}]{default,  }\item[{logical, intent(in), optional}]{fail\+\_\+if\+\_\+missing,  }\item[{logical, intent(in), optional}]{do\+\_\+not\+\_\+read,  }\item[{logical, intent(in), optional}]{do\+\_\+not\+\_\+log,  }\item[{character(len=$\ast$), intent(in), optional}]{static\+\_\+value }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine reads the values of an array of character string model parameters from a parameter file and logs them in documentation files. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em modulename} & The name of the calling module \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The case-\/sensitive name of the parameter to read \\
\hline
\mbox{\texttt{ in,out}}  & {\em value} & The value of the parameter that may be read from the parameter file and logged \\
\hline
\mbox{\texttt{ in}}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file \\
\hline
\mbox{\texttt{ in}}  & {\em units} & The units of this parameter \\
\hline
\mbox{\texttt{ in}}  & {\em default} & The default value of the parameter \\
\hline
\mbox{\texttt{ in}}  & {\em static\+\_\+value} & If this parameter is static, it takes this value, which can be compared for consistency with what is in the parameter file. \\
\hline
\mbox{\texttt{ in}}  & {\em fail\+\_\+if\+\_\+missing} & If present and true, a fatal error occurs if this variable is not found in the parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em do\+\_\+not\+\_\+read} & If present and true, do not read a value for this parameter, although it might be logged. \\
\hline
\mbox{\texttt{ in}}  & {\em do\+\_\+not\+\_\+log} & If present and true, do not log this parameter to the documentation files \\
\hline
\end{DoxyParams}


Definition at line 1873 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1873   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)}    :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{1874 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{1875   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: modulename\textcolor{comment}{ !< The name of the calling module}}
\DoxyCodeLine{1876   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: varname\textcolor{comment}{ !< The case-\/sensitive name of the parameter to read}}
\DoxyCodeLine{1877   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}}
\DoxyCodeLine{1878 \textcolor{comment}{                                         !! read from the parameter file and logged}}
\DoxyCodeLine{1879   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: desc\textcolor{comment}{    !< A description of this variable; if not}}
\DoxyCodeLine{1880 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}}
\DoxyCodeLine{1881   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: units\textcolor{comment}{   !< The units of this parameter}}
\DoxyCodeLine{1882   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: default\textcolor{comment}{ !< The default value of the parameter}}
\DoxyCodeLine{1883   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: static\_value\textcolor{comment}{ !< If this parameter is static, it takes}}
\DoxyCodeLine{1884 \textcolor{comment}{                                         !! this value, which can be compared for consistency with}}
\DoxyCodeLine{1885 \textcolor{comment}{                                         !! what is in the parameter file.}}
\DoxyCodeLine{1886   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}}
\DoxyCodeLine{1887 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}}
\DoxyCodeLine{1888   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_read\textcolor{comment}{  !< If present and true, do not read a}}
\DoxyCodeLine{1889 \textcolor{comment}{                                         !! value for this parameter, although it might be logged.}}
\DoxyCodeLine{1890   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_log\textcolor{comment}{ !< If present and true, do not log this}}
\DoxyCodeLine{1891 \textcolor{comment}{                                         !! parameter to the documentation files}}
\DoxyCodeLine{1892 }
\DoxyCodeLine{1893   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{1894   \textcolor{keywordtype}{logical} :: do\_read, do\_log}
\DoxyCodeLine{1895   \textcolor{keywordtype}{integer} :: i, len\_tot, len\_val}
\DoxyCodeLine{1896   \textcolor{keywordtype}{character(len=1024)} :: cat\_val}
\DoxyCodeLine{1897 }
\DoxyCodeLine{1898   do\_read = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_read)) do\_read = .not.do\_not\_read}
\DoxyCodeLine{1899   do\_log  = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_log))  do\_log  = .not.do\_not\_log}
\DoxyCodeLine{1900 }
\DoxyCodeLine{1901   \textcolor{keywordflow}{if} (do\_read) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1902     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) \textcolor{keywordflow}{then} ; value(:) = default ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1903     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(static\_value)) \textcolor{keywordflow}{then} ; value(:) = static\_value ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1904     \textcolor{keyword}{call }read\_param\_char\_array(cs, varname, \textcolor{keywordtype}{value}, fail\_if\_missing)}
\DoxyCodeLine{1905 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1906 }
\DoxyCodeLine{1907   \textcolor{keywordflow}{if} (do\_log) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1908     cat\_val = trim(value(1)); len\_tot = len\_trim(value(1))}
\DoxyCodeLine{1909     \textcolor{keywordflow}{do} i=2,\textcolor{keyword}{size}(\textcolor{keywordtype}{value})}
\DoxyCodeLine{1910       len\_val = len\_trim(value(i))}
\DoxyCodeLine{1911       \textcolor{keywordflow}{if} ((len\_val > 0) .and. (len\_tot + len\_val + 2 < 240)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1912         cat\_val = trim(cat\_val)//achar(34)// \textcolor{stringliteral}{", "}//achar(34)//trim(value(i))}
\DoxyCodeLine{1913         len\_tot = len\_tot + len\_val}
\DoxyCodeLine{1914 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{1915 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{1916     \textcolor{keyword}{call }log\_param\_char(cs, modulename, varname, cat\_val, desc, \&}
\DoxyCodeLine{1917                         units, default)}
\DoxyCodeLine{1918 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1919 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_ac9428b418b2382019d418c0e30c97734}\label{namespacemom__file__parser_ac9428b418b2382019d418c0e30c97734}} 
\index{mom\_file\_parser@{mom\_file\_parser}!get\_param\_int@{get\_param\_int}}
\index{get\_param\_int@{get\_param\_int}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{get\_param\_int()}{get\_param\_int()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::get\+\_\+param\+\_\+int (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{modulename,  }\item[{character(len=$\ast$), intent(in)}]{varname,  }\item[{integer, intent(inout)}]{value,  }\item[{character(len=$\ast$), intent(in), optional}]{desc,  }\item[{character(len=$\ast$), intent(in), optional}]{units,  }\item[{integer, intent(in), optional}]{default,  }\item[{logical, intent(in), optional}]{fail\+\_\+if\+\_\+missing,  }\item[{logical, intent(in), optional}]{do\+\_\+not\+\_\+read,  }\item[{logical, intent(in), optional}]{do\+\_\+not\+\_\+log,  }\item[{integer, intent(in), optional}]{static\+\_\+value,  }\item[{logical, intent(in), optional}]{layout\+Param,  }\item[{logical, intent(in), optional}]{debugging\+Param }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine reads the value of an integer model parameter from a parameter file and logs it in documentation files. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em modulename} & The name of the calling module \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The case-\/sensitive name of the parameter to read \\
\hline
\mbox{\texttt{ in,out}}  & {\em value} & The value of the parameter that may be read from the parameter file and logged \\
\hline
\mbox{\texttt{ in}}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file \\
\hline
\mbox{\texttt{ in}}  & {\em units} & The units of this parameter \\
\hline
\mbox{\texttt{ in}}  & {\em default} & The default value of the parameter \\
\hline
\mbox{\texttt{ in}}  & {\em static\+\_\+value} & If this parameter is static, it takes this value, which can be compared for consistency with what is in the parameter file. \\
\hline
\mbox{\texttt{ in}}  & {\em fail\+\_\+if\+\_\+missing} & If present and true, a fatal error occurs if this variable is not found in the parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em do\+\_\+not\+\_\+read} & If present and true, do not read a value for this parameter, although it might be logged. \\
\hline
\mbox{\texttt{ in}}  & {\em do\+\_\+not\+\_\+log} & If present and true, do not log this parameter to the documentation files \\
\hline
\mbox{\texttt{ in}}  & {\em layoutparam} & If present and true, this parameter is logged in the layout parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em debuggingparam} & If present and true, this parameter is logged in the debugging parameter file \\
\hline
\end{DoxyParams}


Definition at line 1629 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1629   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)}    :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{1630 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{1631   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: modulename\textcolor{comment}{ !< The name of the calling module}}
\DoxyCodeLine{1632   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: varname\textcolor{comment}{ !< The case-\/sensitive name of the parameter to read}}
\DoxyCodeLine{1633   \textcolor{keywordtype}{integer},                    \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}}
\DoxyCodeLine{1634 \textcolor{comment}{                                         !! read from the parameter file and logged}}
\DoxyCodeLine{1635   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: desc\textcolor{comment}{    !< A description of this variable; if not}}
\DoxyCodeLine{1636 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}}
\DoxyCodeLine{1637   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: units\textcolor{comment}{   !< The units of this parameter}}
\DoxyCodeLine{1638   \textcolor{keywordtype}{integer},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: default\textcolor{comment}{ !< The default value of the parameter}}
\DoxyCodeLine{1639   \textcolor{keywordtype}{integer},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: static\_value\textcolor{comment}{ !< If this parameter is static, it takes}}
\DoxyCodeLine{1640 \textcolor{comment}{                                         !! this value, which can be compared for consistency with}}
\DoxyCodeLine{1641 \textcolor{comment}{                                         !! what is in the parameter file.}}
\DoxyCodeLine{1642   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}}
\DoxyCodeLine{1643 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}}
\DoxyCodeLine{1644   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_read\textcolor{comment}{  !< If present and true, do not read a}}
\DoxyCodeLine{1645 \textcolor{comment}{                                         !! value for this parameter, although it might be logged.}}
\DoxyCodeLine{1646   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_log\textcolor{comment}{ !< If present and true, do not log this}}
\DoxyCodeLine{1647 \textcolor{comment}{                                         !! parameter to the documentation files}}
\DoxyCodeLine{1648   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: layoutParam\textcolor{comment}{ !< If present and true, this parameter is}}
\DoxyCodeLine{1649 \textcolor{comment}{                                         !! logged in the layout parameter file}}
\DoxyCodeLine{1650   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}}
\DoxyCodeLine{1651 \textcolor{comment}{                                         !! logged in the debugging parameter file}}
\DoxyCodeLine{1652 }
\DoxyCodeLine{1653   \textcolor{keywordtype}{logical} :: do\_read, do\_log}
\DoxyCodeLine{1654 }
\DoxyCodeLine{1655   do\_read = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_read)) do\_read = .not.do\_not\_read}
\DoxyCodeLine{1656   do\_log  = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_log))  do\_log  = .not.do\_not\_log}
\DoxyCodeLine{1657 }
\DoxyCodeLine{1658   \textcolor{keywordflow}{if} (do\_read) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1659     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) \textcolor{keywordtype}{value} = default}
\DoxyCodeLine{1660     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(static\_value)) \textcolor{keywordtype}{value} = static\_value}
\DoxyCodeLine{1661     \textcolor{keyword}{call }read\_param\_int(cs, varname, \textcolor{keywordtype}{value}, fail\_if\_missing)}
\DoxyCodeLine{1662 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1663 }
\DoxyCodeLine{1664   \textcolor{keywordflow}{if} (do\_log) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1665     \textcolor{keyword}{call }log\_param\_int(cs, modulename, varname, \textcolor{keywordtype}{value}, desc, units, \&}
\DoxyCodeLine{1666                        default, layoutparam, debuggingparam)}
\DoxyCodeLine{1667 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1668 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a07b858dc2b7ce18929501b4738e96c3a}\label{namespacemom__file__parser_a07b858dc2b7ce18929501b4738e96c3a}} 
\index{mom\_file\_parser@{mom\_file\_parser}!get\_param\_int\_array@{get\_param\_int\_array}}
\index{get\_param\_int\_array@{get\_param\_int\_array}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{get\_param\_int\_array()}{get\_param\_int\_array()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::get\+\_\+param\+\_\+int\+\_\+array (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{modulename,  }\item[{character(len=$\ast$), intent(in)}]{varname,  }\item[{integer, dimension(\+:), intent(inout)}]{value,  }\item[{character(len=$\ast$), intent(in), optional}]{desc,  }\item[{character(len=$\ast$), intent(in), optional}]{units,  }\item[{integer, intent(in), optional}]{default,  }\item[{logical, intent(in), optional}]{fail\+\_\+if\+\_\+missing,  }\item[{logical, intent(in), optional}]{do\+\_\+not\+\_\+read,  }\item[{logical, intent(in), optional}]{do\+\_\+not\+\_\+log,  }\item[{integer, intent(in), optional}]{static\+\_\+value,  }\item[{logical, intent(in), optional}]{layout\+Param,  }\item[{logical, intent(in), optional}]{debugging\+Param }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine reads the values of an array of integer model parameters from a parameter file and logs them in documentation files. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em modulename} & The name of the calling module \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The case-\/sensitive name of the parameter to read \\
\hline
\mbox{\texttt{ in,out}}  & {\em value} & The value of the parameter that may be reset from the parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file \\
\hline
\mbox{\texttt{ in}}  & {\em units} & The units of this parameter \\
\hline
\mbox{\texttt{ in}}  & {\em default} & The default value of the parameter \\
\hline
\mbox{\texttt{ in}}  & {\em static\+\_\+value} & If this parameter is static, it takes this value, which can be compared for consistency with what is in the parameter file. \\
\hline
\mbox{\texttt{ in}}  & {\em fail\+\_\+if\+\_\+missing} & If present and true, a fatal error occurs if this variable is not found in the parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em do\+\_\+not\+\_\+read} & If present and true, do not read a value for this parameter, although it might be logged. \\
\hline
\mbox{\texttt{ in}}  & {\em do\+\_\+not\+\_\+log} & If present and true, do not log this parameter to the documentation files \\
\hline
\mbox{\texttt{ in}}  & {\em layoutparam} & If present and true, this parameter is logged in the layout parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em debuggingparam} & If present and true, this parameter is logged in the debugging parameter file \\
\hline
\end{DoxyParams}


Definition at line 1676 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1676   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)}    :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{1677 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{1678   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: modulename\textcolor{comment}{ !< The name of the calling module}}
\DoxyCodeLine{1679   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: varname\textcolor{comment}{ !< The case-\/sensitive name of the parameter to read}}
\DoxyCodeLine{1680   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{dimension(:)},      \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be reset}}
\DoxyCodeLine{1681 \textcolor{comment}{                                         !! from the parameter file}}
\DoxyCodeLine{1682   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: desc\textcolor{comment}{    !< A description of this variable; if not}}
\DoxyCodeLine{1683 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}}
\DoxyCodeLine{1684   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: units\textcolor{comment}{   !< The units of this parameter}}
\DoxyCodeLine{1685   \textcolor{keywordtype}{integer},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: default\textcolor{comment}{ !< The default value of the parameter}}
\DoxyCodeLine{1686   \textcolor{keywordtype}{integer},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: static\_value\textcolor{comment}{ !< If this parameter is static, it takes}}
\DoxyCodeLine{1687 \textcolor{comment}{                                         !! this value, which can be compared for consistency with}}
\DoxyCodeLine{1688 \textcolor{comment}{                                         !! what is in the parameter file.}}
\DoxyCodeLine{1689   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}}
\DoxyCodeLine{1690 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}}
\DoxyCodeLine{1691   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_read\textcolor{comment}{  !< If present and true, do not read a}}
\DoxyCodeLine{1692 \textcolor{comment}{                                         !! value for this parameter, although it might be logged.}}
\DoxyCodeLine{1693   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_log\textcolor{comment}{ !< If present and true, do not log this}}
\DoxyCodeLine{1694 \textcolor{comment}{                                         !! parameter to the documentation files}}
\DoxyCodeLine{1695   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: layoutParam\textcolor{comment}{ !< If present and true, this parameter is}}
\DoxyCodeLine{1696 \textcolor{comment}{                                         !! logged in the layout parameter file}}
\DoxyCodeLine{1697   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}}
\DoxyCodeLine{1698 \textcolor{comment}{                                         !! logged in the debugging parameter file}}
\DoxyCodeLine{1699 }
\DoxyCodeLine{1700   \textcolor{keywordtype}{logical} :: do\_read, do\_log}
\DoxyCodeLine{1701 }
\DoxyCodeLine{1702   do\_read = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_read)) do\_read = .not.do\_not\_read}
\DoxyCodeLine{1703   do\_log  = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_log))  do\_log  = .not.do\_not\_log}
\DoxyCodeLine{1704 }
\DoxyCodeLine{1705   \textcolor{keywordflow}{if} (do\_read) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1706     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) \textcolor{keywordflow}{then} ; value(:) = default ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1707     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(static\_value)) \textcolor{keywordflow}{then} ; value(:) = static\_value ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1708     \textcolor{keyword}{call }read\_param\_int\_array(cs, varname, \textcolor{keywordtype}{value}, fail\_if\_missing)}
\DoxyCodeLine{1709 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1710 }
\DoxyCodeLine{1711   \textcolor{keywordflow}{if} (do\_log) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1712     \textcolor{keyword}{call }log\_param\_int\_array(cs, modulename, varname, \textcolor{keywordtype}{value}, desc, \&}
\DoxyCodeLine{1713                              units, default, layoutparam, debuggingparam)}
\DoxyCodeLine{1714 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1715 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a470b3af82a8b146f375e4ca13c58e70f}\label{namespacemom__file__parser_a470b3af82a8b146f375e4ca13c58e70f}} 
\index{mom\_file\_parser@{mom\_file\_parser}!get\_param\_logical@{get\_param\_logical}}
\index{get\_param\_logical@{get\_param\_logical}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{get\_param\_logical()}{get\_param\_logical()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::get\+\_\+param\+\_\+logical (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{modulename,  }\item[{character(len=$\ast$), intent(in)}]{varname,  }\item[{logical, intent(inout)}]{value,  }\item[{character(len=$\ast$), intent(in), optional}]{desc,  }\item[{character(len=$\ast$), intent(in), optional}]{units,  }\item[{logical, intent(in), optional}]{default,  }\item[{logical, intent(in), optional}]{fail\+\_\+if\+\_\+missing,  }\item[{logical, intent(in), optional}]{do\+\_\+not\+\_\+read,  }\item[{logical, intent(in), optional}]{do\+\_\+not\+\_\+log,  }\item[{logical, intent(in), optional}]{static\+\_\+value,  }\item[{logical, intent(in), optional}]{layout\+Param,  }\item[{logical, intent(in), optional}]{debugging\+Param }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine reads the value of a logical model parameter from a parameter file and logs it in documentation files. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em modulename} & The name of the calling module \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The case-\/sensitive name of the parameter to read \\
\hline
\mbox{\texttt{ in,out}}  & {\em value} & The value of the parameter that may be read from the parameter file and logged \\
\hline
\mbox{\texttt{ in}}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file \\
\hline
\mbox{\texttt{ in}}  & {\em units} & The units of this parameter \\
\hline
\mbox{\texttt{ in}}  & {\em default} & The default value of the parameter \\
\hline
\mbox{\texttt{ in}}  & {\em static\+\_\+value} & If this parameter is static, it takes this value, which can be compared for consistency with what is in the parameter file. \\
\hline
\mbox{\texttt{ in}}  & {\em fail\+\_\+if\+\_\+missing} & If present and true, a fatal error occurs if this variable is not found in the parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em do\+\_\+not\+\_\+read} & If present and true, do not read a value for this parameter, although it might be logged. \\
\hline
\mbox{\texttt{ in}}  & {\em do\+\_\+not\+\_\+log} & If present and true, do not log this parameter to the documentation files \\
\hline
\mbox{\texttt{ in}}  & {\em layoutparam} & If present and true, this parameter is logged in the layout parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em debuggingparam} & If present and true, this parameter is logged in the debugging parameter file \\
\hline
\end{DoxyParams}


Definition at line 1927 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1927   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)}    :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{1928 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{1929   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: modulename\textcolor{comment}{ !< The name of the calling module}}
\DoxyCodeLine{1930   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: varname\textcolor{comment}{ !< The case-\/sensitive name of the parameter to read}}
\DoxyCodeLine{1931   \textcolor{keywordtype}{logical},                    \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}}
\DoxyCodeLine{1932 \textcolor{comment}{                                         !! read from the parameter file and logged}}
\DoxyCodeLine{1933   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: desc\textcolor{comment}{    !< A description of this variable; if not}}
\DoxyCodeLine{1934 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}}
\DoxyCodeLine{1935   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: units\textcolor{comment}{   !< The units of this parameter}}
\DoxyCodeLine{1936   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: default\textcolor{comment}{ !< The default value of the parameter}}
\DoxyCodeLine{1937   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: static\_value\textcolor{comment}{ !< If this parameter is static, it takes}}
\DoxyCodeLine{1938 \textcolor{comment}{                                         !! this value, which can be compared for consistency with}}
\DoxyCodeLine{1939 \textcolor{comment}{                                         !! what is in the parameter file.}}
\DoxyCodeLine{1940   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}}
\DoxyCodeLine{1941 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}}
\DoxyCodeLine{1942   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_read\textcolor{comment}{  !< If present and true, do not read a}}
\DoxyCodeLine{1943 \textcolor{comment}{                                         !! value for this parameter, although it might be logged.}}
\DoxyCodeLine{1944   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_log\textcolor{comment}{ !< If present and true, do not log this}}
\DoxyCodeLine{1945 \textcolor{comment}{                                         !! parameter to the documentation files}}
\DoxyCodeLine{1946   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: layoutParam\textcolor{comment}{ !< If present and true, this parameter is}}
\DoxyCodeLine{1947 \textcolor{comment}{                                         !! logged in the layout parameter file}}
\DoxyCodeLine{1948   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}}
\DoxyCodeLine{1949 \textcolor{comment}{                                         !! logged in the debugging parameter file}}
\DoxyCodeLine{1950 }
\DoxyCodeLine{1951   \textcolor{keywordtype}{logical} :: do\_read, do\_log}
\DoxyCodeLine{1952 }
\DoxyCodeLine{1953   do\_read = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_read)) do\_read = .not.do\_not\_read}
\DoxyCodeLine{1954   do\_log  = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_log))  do\_log  = .not.do\_not\_log}
\DoxyCodeLine{1955 }
\DoxyCodeLine{1956   \textcolor{keywordflow}{if} (do\_read) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1957     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) \textcolor{keywordtype}{value} = default}
\DoxyCodeLine{1958     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(static\_value)) \textcolor{keywordtype}{value} = static\_value}
\DoxyCodeLine{1959     \textcolor{keyword}{call }read\_param\_logical(cs, varname, \textcolor{keywordtype}{value}, fail\_if\_missing)}
\DoxyCodeLine{1960 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1961 }
\DoxyCodeLine{1962   \textcolor{keywordflow}{if} (do\_log) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1963     \textcolor{keyword}{call }log\_param\_logical(cs, modulename, varname, \textcolor{keywordtype}{value}, desc, \&}
\DoxyCodeLine{1964                            units, default, layoutparam, debuggingparam)}
\DoxyCodeLine{1965 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1966 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a2d6fb93c7802322c2ed145413aacaf30}\label{namespacemom__file__parser_a2d6fb93c7802322c2ed145413aacaf30}} 
\index{mom\_file\_parser@{mom\_file\_parser}!get\_param\_real@{get\_param\_real}}
\index{get\_param\_real@{get\_param\_real}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{get\_param\_real()}{get\_param\_real()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::get\+\_\+param\+\_\+real (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{modulename,  }\item[{character(len=$\ast$), intent(in)}]{varname,  }\item[{real, intent(inout)}]{value,  }\item[{character(len=$\ast$), intent(in), optional}]{desc,  }\item[{character(len=$\ast$), intent(in), optional}]{units,  }\item[{real, intent(in), optional}]{default,  }\item[{logical, intent(in), optional}]{fail\+\_\+if\+\_\+missing,  }\item[{logical, intent(in), optional}]{do\+\_\+not\+\_\+read,  }\item[{logical, intent(in), optional}]{do\+\_\+not\+\_\+log,  }\item[{real, intent(in), optional}]{static\+\_\+value,  }\item[{logical, intent(in), optional}]{debugging\+Param,  }\item[{real, intent(in), optional}]{scale,  }\item[{real, intent(out), optional}]{unscaled }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine reads the value of a real model parameter from a parameter file and logs it in documentation files. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em modulename} & The name of the calling module \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The case-\/sensitive name of the parameter to read \\
\hline
\mbox{\texttt{ in,out}}  & {\em value} & The value of the parameter that may be read from the parameter file and logged \\
\hline
\mbox{\texttt{ in}}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file \\
\hline
\mbox{\texttt{ in}}  & {\em units} & The units of this parameter \\
\hline
\mbox{\texttt{ in}}  & {\em default} & The default value of the parameter \\
\hline
\mbox{\texttt{ in}}  & {\em static\+\_\+value} & If this parameter is static, it takes this value, which can be compared for consistency with what is in the parameter file. \\
\hline
\mbox{\texttt{ in}}  & {\em fail\+\_\+if\+\_\+missing} & If present and true, a fatal error occurs if this variable is not found in the parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em do\+\_\+not\+\_\+read} & If present and true, do not read a value for this parameter, although it might be logged. \\
\hline
\mbox{\texttt{ in}}  & {\em do\+\_\+not\+\_\+log} & If present and true, do not log this parameter to the documentation files \\
\hline
\mbox{\texttt{ in}}  & {\em debuggingparam} & If present and true, this parameter is logged in the debugging parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em scale} & A scaling factor that the parameter is multiplied by before it is returned. \\
\hline
\mbox{\texttt{ out}}  & {\em unscaled} & The value of the parameter that would be returned without any multiplication by a scaling factor. \\
\hline
\end{DoxyParams}


Definition at line 1723 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1723   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)}    :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{1724 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{1725   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: modulename\textcolor{comment}{ !< The name of the calling module}}
\DoxyCodeLine{1726   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: varname\textcolor{comment}{ !< The case-\/sensitive name of the parameter to read}}
\DoxyCodeLine{1727 \textcolor{keywordtype}{  real},                       \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}}
\DoxyCodeLine{1728 \textcolor{comment}{                                         !! read from the parameter file and logged}}
\DoxyCodeLine{1729   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: desc\textcolor{comment}{    !< A description of this variable; if not}}
\DoxyCodeLine{1730 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}}
\DoxyCodeLine{1731   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: units\textcolor{comment}{   !< The units of this parameter}}
\DoxyCodeLine{1732 \textcolor{keywordtype}{  real},             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: default\textcolor{comment}{ !< The default value of the parameter}}
\DoxyCodeLine{1733 \textcolor{keywordtype}{  real},             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: static\_value\textcolor{comment}{ !< If this parameter is static, it takes}}
\DoxyCodeLine{1734 \textcolor{comment}{                                         !! this value, which can be compared for consistency with}}
\DoxyCodeLine{1735 \textcolor{comment}{                                         !! what is in the parameter file.}}
\DoxyCodeLine{1736   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}}
\DoxyCodeLine{1737 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}}
\DoxyCodeLine{1738   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_read\textcolor{comment}{  !< If present and true, do not read a}}
\DoxyCodeLine{1739 \textcolor{comment}{                                         !! value for this parameter, although it might be logged.}}
\DoxyCodeLine{1740   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_log\textcolor{comment}{ !< If present and true, do not log this}}
\DoxyCodeLine{1741 \textcolor{comment}{                                         !! parameter to the documentation files}}
\DoxyCodeLine{1742   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}}
\DoxyCodeLine{1743 \textcolor{comment}{                                         !! logged in the debugging parameter file}}
\DoxyCodeLine{1744 \textcolor{keywordtype}{  real},             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scale\textcolor{comment}{   !< A scaling factor that the parameter is}}
\DoxyCodeLine{1745 \textcolor{comment}{                                         !! multiplied by before it is returned.}}
\DoxyCodeLine{1746 \textcolor{keywordtype}{  real},             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)}   :: unscaled\textcolor{comment}{ !< The value of the parameter that would be}}
\DoxyCodeLine{1747 \textcolor{comment}{                                         !! returned without any multiplication by a scaling factor.}}
\DoxyCodeLine{1748 }
\DoxyCodeLine{1749   \textcolor{keywordtype}{logical} :: do\_read, do\_log}
\DoxyCodeLine{1750 }
\DoxyCodeLine{1751   do\_read = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_read)) do\_read = .not.do\_not\_read}
\DoxyCodeLine{1752   do\_log  = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_log))  do\_log  = .not.do\_not\_log}
\DoxyCodeLine{1753 }
\DoxyCodeLine{1754   \textcolor{keywordflow}{if} (do\_read) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1755     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) \textcolor{keywordtype}{value} = default}
\DoxyCodeLine{1756     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(static\_value)) \textcolor{keywordtype}{value} = static\_value}
\DoxyCodeLine{1757     \textcolor{keyword}{call }read\_param\_real(cs, varname, \textcolor{keywordtype}{value}, fail\_if\_missing)}
\DoxyCodeLine{1758 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1759 }
\DoxyCodeLine{1760   \textcolor{keywordflow}{if} (do\_log) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1761     \textcolor{keyword}{call }log\_param\_real(cs, modulename, varname, \textcolor{keywordtype}{value}, desc, units, \&}
\DoxyCodeLine{1762                         default, debuggingparam)}
\DoxyCodeLine{1763 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1764 }
\DoxyCodeLine{1765   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(unscaled)) unscaled = \textcolor{keywordtype}{value}}
\DoxyCodeLine{1766   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) \textcolor{keywordtype}{value} = scale*\textcolor{keywordtype}{value}}
\DoxyCodeLine{1767 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_aaea9c54ad3bb4ad7a6e41a5f9715fb34}\label{namespacemom__file__parser_aaea9c54ad3bb4ad7a6e41a5f9715fb34}} 
\index{mom\_file\_parser@{mom\_file\_parser}!get\_param\_real\_array@{get\_param\_real\_array}}
\index{get\_param\_real\_array@{get\_param\_real\_array}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{get\_param\_real\_array()}{get\_param\_real\_array()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::get\+\_\+param\+\_\+real\+\_\+array (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{modulename,  }\item[{character(len=$\ast$), intent(in)}]{varname,  }\item[{real, dimension(\+:), intent(inout)}]{value,  }\item[{character(len=$\ast$), intent(in), optional}]{desc,  }\item[{character(len=$\ast$), intent(in), optional}]{units,  }\item[{real, intent(in), optional}]{default,  }\item[{logical, intent(in), optional}]{fail\+\_\+if\+\_\+missing,  }\item[{logical, intent(in), optional}]{do\+\_\+not\+\_\+read,  }\item[{logical, intent(in), optional}]{do\+\_\+not\+\_\+log,  }\item[{logical, intent(in), optional}]{debugging\+Param,  }\item[{real, intent(in), optional}]{static\+\_\+value,  }\item[{real, intent(in), optional}]{scale,  }\item[{real, dimension(\+:), intent(out), optional}]{unscaled }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine reads the values of an array of real model parameters from a parameter file and logs them in documentation files. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em modulename} & The name of the calling module \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The case-\/sensitive name of the parameter to read \\
\hline
\mbox{\texttt{ in,out}}  & {\em value} & The value of the parameter that may be read from the parameter file and logged \\
\hline
\mbox{\texttt{ in}}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file \\
\hline
\mbox{\texttt{ in}}  & {\em units} & The units of this parameter \\
\hline
\mbox{\texttt{ in}}  & {\em default} & The default value of the parameter \\
\hline
\mbox{\texttt{ in}}  & {\em static\+\_\+value} & If this parameter is static, it takes this value, which can be compared for consistency with what is in the parameter file. \\
\hline
\mbox{\texttt{ in}}  & {\em fail\+\_\+if\+\_\+missing} & If present and true, a fatal error occurs if this variable is not found in the parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em do\+\_\+not\+\_\+read} & If present and true, do not read a value for this parameter, although it might be logged. \\
\hline
\mbox{\texttt{ in}}  & {\em do\+\_\+not\+\_\+log} & If present and true, do not log this parameter to the documentation files \\
\hline
\mbox{\texttt{ in}}  & {\em debuggingparam} & If present and true, this parameter is logged in the debugging parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em scale} & A scaling factor that the parameter is multiplied by before it is returned. \\
\hline
\mbox{\texttt{ out}}  & {\em unscaled} & The value of the parameter that would be returned without any multiplication by a scaling factor. \\
\hline
\end{DoxyParams}


Definition at line 1775 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1775   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)}    :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{1776 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{1777   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: modulename\textcolor{comment}{ !< The name of the calling module}}
\DoxyCodeLine{1778   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: varname\textcolor{comment}{ !< The case-\/sensitive name of the parameter to read}}
\DoxyCodeLine{1779 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)},         \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}}
\DoxyCodeLine{1780 \textcolor{comment}{                                         !! read from the parameter file and logged}}
\DoxyCodeLine{1781   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: desc\textcolor{comment}{    !< A description of this variable; if not}}
\DoxyCodeLine{1782 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}}
\DoxyCodeLine{1783   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: units\textcolor{comment}{   !< The units of this parameter}}
\DoxyCodeLine{1784 \textcolor{keywordtype}{  real},             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: default\textcolor{comment}{ !< The default value of the parameter}}
\DoxyCodeLine{1785 \textcolor{keywordtype}{  real},             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: static\_value\textcolor{comment}{ !< If this parameter is static, it takes}}
\DoxyCodeLine{1786 \textcolor{comment}{                                         !! this value, which can be compared for consistency with}}
\DoxyCodeLine{1787 \textcolor{comment}{                                         !! what is in the parameter file.}}
\DoxyCodeLine{1788   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}}
\DoxyCodeLine{1789 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}}
\DoxyCodeLine{1790   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_read\textcolor{comment}{  !< If present and true, do not read a}}
\DoxyCodeLine{1791 \textcolor{comment}{                                         !! value for this parameter, although it might be logged.}}
\DoxyCodeLine{1792   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_log\textcolor{comment}{ !< If present and true, do not log this}}
\DoxyCodeLine{1793 \textcolor{comment}{                                         !! parameter to the documentation files}}
\DoxyCodeLine{1794   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}}
\DoxyCodeLine{1795 \textcolor{comment}{                                         !! logged in the debugging parameter file}}
\DoxyCodeLine{1796 \textcolor{keywordtype}{  real},             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scale\textcolor{comment}{   !< A scaling factor that the parameter is}}
\DoxyCodeLine{1797 \textcolor{comment}{                                         !! multiplied by before it is returned.}}
\DoxyCodeLine{1798 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)} :: unscaled\textcolor{comment}{ !< The value of the parameter that would be}}
\DoxyCodeLine{1799 \textcolor{comment}{                                         !! returned without any multiplication by a scaling factor.}}
\DoxyCodeLine{1800 }
\DoxyCodeLine{1801   \textcolor{keywordtype}{logical} :: do\_read, do\_log}
\DoxyCodeLine{1802 }
\DoxyCodeLine{1803   do\_read = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_read)) do\_read = .not.do\_not\_read}
\DoxyCodeLine{1804   do\_log  = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_log))  do\_log  = .not.do\_not\_log}
\DoxyCodeLine{1805 }
\DoxyCodeLine{1806   \textcolor{keywordflow}{if} (do\_read) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1807     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) \textcolor{keywordflow}{then} ; value(:) = default ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1808     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(static\_value)) \textcolor{keywordflow}{then} ; value(:) = static\_value ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1809     \textcolor{keyword}{call }read\_param\_real\_array(cs, varname, \textcolor{keywordtype}{value}, fail\_if\_missing)}
\DoxyCodeLine{1810 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1811 }
\DoxyCodeLine{1812   \textcolor{keywordflow}{if} (do\_log) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1813     \textcolor{keyword}{call }log\_param\_real\_array(cs, modulename, varname, \textcolor{keywordtype}{value}, desc, \&}
\DoxyCodeLine{1814                               units, default, debuggingparam)}
\DoxyCodeLine{1815 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1816 }
\DoxyCodeLine{1817   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(unscaled)) unscaled(:) = value(:)}
\DoxyCodeLine{1818   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) value(:) = scale*value(:)}
\DoxyCodeLine{1819 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_ab433eff650ddf3ce82d97f1c8432b6a8}\label{namespacemom__file__parser_ab433eff650ddf3ce82d97f1c8432b6a8}} 
\index{mom\_file\_parser@{mom\_file\_parser}!get\_param\_time@{get\_param\_time}}
\index{get\_param\_time@{get\_param\_time}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{get\_param\_time()}{get\_param\_time()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::get\+\_\+param\+\_\+time (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{modulename,  }\item[{character(len=$\ast$), intent(in)}]{varname,  }\item[{type(time\+\_\+type), intent(inout)}]{value,  }\item[{character(len=$\ast$), intent(in), optional}]{desc,  }\item[{character(len=$\ast$), intent(in), optional}]{units,  }\item[{type(time\+\_\+type), intent(in), optional}]{default,  }\item[{logical, intent(in), optional}]{fail\+\_\+if\+\_\+missing,  }\item[{logical, intent(in), optional}]{do\+\_\+not\+\_\+read,  }\item[{logical, intent(in), optional}]{do\+\_\+not\+\_\+log,  }\item[{real, intent(in), optional}]{timeunit,  }\item[{type(time\+\_\+type), intent(in), optional}]{static\+\_\+value,  }\item[{logical, intent(in), optional}]{layout\+Param,  }\item[{logical, intent(in), optional}]{debugging\+Param,  }\item[{logical, intent(in), optional}]{log\+\_\+as\+\_\+date }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine reads the value of a time-\/type model parameter from a parameter file and logs it in documentation files. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em modulename} & The name of the calling module \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The case-\/sensitive name of the parameter to read \\
\hline
\mbox{\texttt{ in,out}}  & {\em value} & The value of the parameter that may be read from the parameter file and logged \\
\hline
\mbox{\texttt{ in}}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file \\
\hline
\mbox{\texttt{ in}}  & {\em units} & The units of this parameter \\
\hline
\mbox{\texttt{ in}}  & {\em default} & The default value of the parameter \\
\hline
\mbox{\texttt{ in}}  & {\em static\+\_\+value} & If this parameter is static, it takes this value, which can be compared for consistency with what is in the parameter file. \\
\hline
\mbox{\texttt{ in}}  & {\em fail\+\_\+if\+\_\+missing} & If present and true, a fatal error occurs if this variable is not found in the parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em do\+\_\+not\+\_\+read} & If present and true, do not read a value for this parameter, although it might be logged. \\
\hline
\mbox{\texttt{ in}}  & {\em do\+\_\+not\+\_\+log} & If present and true, do not log this parameter to the documentation files \\
\hline
\mbox{\texttt{ in}}  & {\em timeunit} & The number of seconds in a time unit for real-\/number input to be translated to a time. \\
\hline
\mbox{\texttt{ in}}  & {\em layoutparam} & If present and true, this parameter is logged in the layout parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em debuggingparam} & If present and true, this parameter is logged in the debugging parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em log\+\_\+as\+\_\+date} & If true, log the time\+\_\+type in date format. The default is false. \\
\hline
\end{DoxyParams}


Definition at line 1975 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1975   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)}    :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{1976 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{1977   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: modulename\textcolor{comment}{ !< The name of the calling module}}
\DoxyCodeLine{1978   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: varname\textcolor{comment}{ !< The case-\/sensitive name of the parameter to read}}
\DoxyCodeLine{1979   \textcolor{keywordtype}{type}(time\_type),            \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}}
\DoxyCodeLine{1980 \textcolor{comment}{                                         !! read from the parameter file and logged}}
\DoxyCodeLine{1981   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: desc\textcolor{comment}{    !< A description of this variable; if not}}
\DoxyCodeLine{1982 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}}
\DoxyCodeLine{1983   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: units\textcolor{comment}{   !< The units of this parameter}}
\DoxyCodeLine{1984   \textcolor{keywordtype}{type}(time\_type),  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: default\textcolor{comment}{ !< The default value of the parameter}}
\DoxyCodeLine{1985   \textcolor{keywordtype}{type}(time\_type),  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: static\_value\textcolor{comment}{ !< If this parameter is static, it takes}}
\DoxyCodeLine{1986 \textcolor{comment}{                                         !! this value, which can be compared for consistency with}}
\DoxyCodeLine{1987 \textcolor{comment}{                                         !! what is in the parameter file.}}
\DoxyCodeLine{1988   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}}
\DoxyCodeLine{1989 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}}
\DoxyCodeLine{1990   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_read\textcolor{comment}{  !< If present and true, do not read a}}
\DoxyCodeLine{1991 \textcolor{comment}{                                         !! value for this parameter, although it might be logged.}}
\DoxyCodeLine{1992   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_log\textcolor{comment}{ !< If present and true, do not log this}}
\DoxyCodeLine{1993 \textcolor{comment}{                                         !! parameter to the documentation files}}
\DoxyCodeLine{1994 \textcolor{keywordtype}{  real},             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: timeunit\textcolor{comment}{ !< The number of seconds in a time unit for}}
\DoxyCodeLine{1995 \textcolor{comment}{                                         !! real-\/number input to be translated to a time.}}
\DoxyCodeLine{1996   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: layoutParam\textcolor{comment}{ !< If present and true, this parameter is}}
\DoxyCodeLine{1997 \textcolor{comment}{                                         !! logged in the layout parameter file}}
\DoxyCodeLine{1998   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}}
\DoxyCodeLine{1999 \textcolor{comment}{                                         !! logged in the debugging parameter file}}
\DoxyCodeLine{2000   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: log\_as\_date\textcolor{comment}{  !< If true, log the time\_type in date}}
\DoxyCodeLine{2001 \textcolor{comment}{                                         !! format. The default is false.}}
\DoxyCodeLine{2002 }
\DoxyCodeLine{2003   \textcolor{keywordtype}{logical} :: do\_read, do\_log, date\_format, log\_date}
\DoxyCodeLine{2004 }
\DoxyCodeLine{2005   do\_read = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_read)) do\_read = .not.do\_not\_read}
\DoxyCodeLine{2006   do\_log  = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_log))  do\_log  = .not.do\_not\_log}
\DoxyCodeLine{2007   log\_date = .false.}
\DoxyCodeLine{2008 }
\DoxyCodeLine{2009   \textcolor{keywordflow}{if} (do\_read) \textcolor{keywordflow}{then}}
\DoxyCodeLine{2010     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) \textcolor{keywordtype}{value} = default}
\DoxyCodeLine{2011     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(static\_value)) \textcolor{keywordtype}{value} = static\_value}
\DoxyCodeLine{2012     \textcolor{keyword}{call }read\_param\_time(cs, varname, \textcolor{keywordtype}{value}, timeunit, fail\_if\_missing, date\_format=log\_date)}
\DoxyCodeLine{2013 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{2014 }
\DoxyCodeLine{2015   \textcolor{keywordflow}{if} (do\_log) \textcolor{keywordflow}{then}}
\DoxyCodeLine{2016     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(log\_as\_date)) log\_date = log\_as\_date}
\DoxyCodeLine{2017     \textcolor{keyword}{call }log\_param\_time(cs, modulename, varname, \textcolor{keywordtype}{value}, desc, units, default, \&}
\DoxyCodeLine{2018                         timeunit, layoutparam=layoutparam, \&}
\DoxyCodeLine{2019                         debuggingparam=debuggingparam, log\_date=log\_date)}
\DoxyCodeLine{2020 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{2021 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_af883df6020543889b25986d6ee9701f7}\label{namespacemom__file__parser_af883df6020543889b25986d6ee9701f7}} 
\index{mom\_file\_parser@{mom\_file\_parser}!get\_variable\_line@{get\_variable\_line}}
\index{get\_variable\_line@{get\_variable\_line}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{get\_variable\_line()}{get\_variable\_line()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::get\+\_\+variable\+\_\+line (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{varname,  }\item[{logical, intent(out)}]{found,  }\item[{logical, intent(out)}]{defined,  }\item[{character(len=$\ast$), dimension(\+:), intent(out)}]{value\+\_\+string,  }\item[{logical, intent(in), optional}]{param\+Is\+Logical }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subtoutine extracts the contents of lines in the \mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}} that refer to a named parameter. The value\+\_\+string that is returned must be interepreted in a way that depends on the type of this variable. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The case-\/sensitive name of the parameter to read \\
\hline
\mbox{\texttt{ out}}  & {\em found} & If true, this parameter has been found in CS \\
\hline
\mbox{\texttt{ out}}  & {\em defined} & If true, this parameter is set (or true) in the CS \\
\hline
\mbox{\texttt{ out}}  & {\em value\+\_\+string} & A string that encodes the new value \\
\hline
\mbox{\texttt{ in}}  & {\em paramislogical} & If true, this is a logical parameter that can be simply defined without parsing a value\+\_\+string. \\
\hline
\end{DoxyParams}


Definition at line 897 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{897   \textcolor{keywordtype}{type}(param\_file\_type),  \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{898 \textcolor{comment}{                                                !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{899   \textcolor{keywordtype}{character(len=*)},       \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The case-\/sensitive name of the parameter to read}}
\DoxyCodeLine{900   \textcolor{keywordtype}{logical},               \textcolor{keywordtype}{intent(out)} :: found\textcolor{comment}{   !< If true, this parameter has been found in CS}}
\DoxyCodeLine{901   \textcolor{keywordtype}{logical},               \textcolor{keywordtype}{intent(out)} :: defined\textcolor{comment}{ !< If true, this parameter is set (or true) in the CS}}
\DoxyCodeLine{902   \textcolor{keywordtype}{character(len=*)},      \textcolor{keywordtype}{intent(out)} :: value\_string(:)\textcolor{comment}{ !< A string that encodes the new value}}
\DoxyCodeLine{903   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{optional},      \textcolor{keywordtype}{intent(in)} :: paramIsLogical\textcolor{comment}{  !< If true, this is a logical parameter}}
\DoxyCodeLine{904 \textcolor{comment}{                                                !! that can be simply defined without parsing a value\_string.}}
\DoxyCodeLine{905 }
\DoxyCodeLine{906   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{907   \textcolor{keywordtype}{character(len=INPUT\_STR\_LENGTH)} :: val\_str, lname, origLine}
\DoxyCodeLine{908   \textcolor{keywordtype}{character(len=INPUT\_STR\_LENGTH)} :: line, continuationBuffer, blockName}
\DoxyCodeLine{909   \textcolor{keywordtype}{character(len=FILENAME\_LENGTH)}  :: filename}
\DoxyCodeLine{910   \textcolor{keywordtype}{integer}            :: is, id, isd, isu, ise, iso, verbose, ipf}
\DoxyCodeLine{911   \textcolor{keywordtype}{integer}            :: last, last1, ival, oval, max\_vals, count, contBufSize}
\DoxyCodeLine{912   \textcolor{keywordtype}{character(len=52)}  :: set}
\DoxyCodeLine{913   \textcolor{keywordtype}{logical}            :: found\_override, found\_equals}
\DoxyCodeLine{914   \textcolor{keywordtype}{logical}            :: found\_define, found\_undef}
\DoxyCodeLine{915   \textcolor{keywordtype}{logical}            :: force\_cycle, defined\_in\_line, continuedLine}
\DoxyCodeLine{916   \textcolor{keywordtype}{logical}            :: variableKindIsLogical, valueIsSame}
\DoxyCodeLine{917   \textcolor{keywordtype}{logical}            :: inWrongBlock, fullPathParameter}
\DoxyCodeLine{918   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{parameter} :: requireNamedClose = .false.}
\DoxyCodeLine{919   set = \textcolor{stringliteral}{"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"}}
\DoxyCodeLine{920   continuationbuffer = repeat(\textcolor{stringliteral}{" "},input\_str\_length)}
\DoxyCodeLine{921   contbufsize = 0}
\DoxyCodeLine{922   verbose = 1}
\DoxyCodeLine{923 }
\DoxyCodeLine{924   variablekindislogical=.false.}
\DoxyCodeLine{925   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(paramislogical)) variablekindislogical = paramislogical}
\DoxyCodeLine{926 }
\DoxyCodeLine{927   \textcolor{comment}{! Find the first instance (if any) where the named variable is found, and}}
\DoxyCodeLine{928   \textcolor{comment}{! return variables indicating whether this variable is defined and the string}}
\DoxyCodeLine{929   \textcolor{comment}{! that contains the value of this variable.}}
\DoxyCodeLine{930   found = .false.}
\DoxyCodeLine{931   oval = 0; ival = 0}
\DoxyCodeLine{932   max\_vals = \textcolor{keyword}{SIZE}(value\_string)}
\DoxyCodeLine{933   \textcolor{keywordflow}{do} is=1,max\_vals ; value\_string(is) = \textcolor{stringliteral}{" "} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{934 }
\DoxyCodeLine{935   paramfile\_loop: \textcolor{keywordflow}{do} ipf = 1, cs\%nfiles}
\DoxyCodeLine{936     filename = cs\%filename(ipf)}
\DoxyCodeLine{937     continuedline = .false.}
\DoxyCodeLine{938     blockname = \textcolor{stringliteral}{''}}
\DoxyCodeLine{939 }
\DoxyCodeLine{940     \textcolor{comment}{! Scan through each line of the file}}
\DoxyCodeLine{941     \textcolor{keywordflow}{do} count = 1, cs\%param\_data(ipf)\%num\_lines}
\DoxyCodeLine{942       line = cs\%param\_data(ipf)\%line(count)}
\DoxyCodeLine{943       last = len\_trim(line)}
\DoxyCodeLine{944 }
\DoxyCodeLine{945       last1 = max(1,last)}
\DoxyCodeLine{946       \textcolor{comment}{! Check if line ends in continuation character (either \& or \(\backslash\))}}
\DoxyCodeLine{947       \textcolor{comment}{! Note achar(92) is a backslash}}
\DoxyCodeLine{948       \textcolor{keywordflow}{if} (line(last1:last1) == achar(92).or.line(last1:last1) == \textcolor{stringliteral}{"\&"}) \textcolor{keywordflow}{then}}
\DoxyCodeLine{949         continuationbuffer(contbufsize+1:contbufsize+len\_trim(line))=line(:last-\/1)}
\DoxyCodeLine{950         contbufsize=contbufsize + len\_trim(line)-\/1}
\DoxyCodeLine{951         continuedline = .true.}
\DoxyCodeLine{952         \textcolor{keywordflow}{if} (count==cs\%param\_data(ipf)\%num\_lines .and. is\_root\_pe()) \&}
\DoxyCodeLine{953            \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"MOM\_file\_parser : the last line"}// \&}
\DoxyCodeLine{954                  \textcolor{stringliteral}{" of the file ends in a continuation character but"}// \&}
\DoxyCodeLine{955                  \textcolor{stringliteral}{" there are no more lines to read. "}// \&}
\DoxyCodeLine{956                  \textcolor{stringliteral}{" Line: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//\&}
\DoxyCodeLine{957                  \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{"."})}
\DoxyCodeLine{958         cycle \textcolor{comment}{! cycle inorder to append the next line of the file}}
\DoxyCodeLine{959       \textcolor{keywordflow}{elseif} (continuedline) \textcolor{keywordflow}{then}}
\DoxyCodeLine{960         \textcolor{comment}{! If we reached this point then this is the end of line continuation}}
\DoxyCodeLine{961         continuationbuffer(contbufsize+1:contbufsize+len\_trim(line))=line(:last)}
\DoxyCodeLine{962         line = continuationbuffer}
\DoxyCodeLine{963         continuationbuffer=repeat(\textcolor{stringliteral}{" "},input\_str\_length) \textcolor{comment}{! Clear for next use}}
\DoxyCodeLine{964         contbufsize = 0}
\DoxyCodeLine{965         continuedline = .false.}
\DoxyCodeLine{966         last = len\_trim(line)}
\DoxyCodeLine{967 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{968 }
\DoxyCodeLine{969       origline = trim(line) \textcolor{comment}{! Keep original for error messages}}
\DoxyCodeLine{970 }
\DoxyCodeLine{971       \textcolor{comment}{! Check for '\#override' at start of line}}
\DoxyCodeLine{972       found\_override = .false.; found\_define = .false.; found\_undef = .false.}
\DoxyCodeLine{973       iso = index(line(:last), \textcolor{stringliteral}{"\#override "} )\textcolor{comment}{!; if (is > 0) found\_override = .true.}}
\DoxyCodeLine{974       \textcolor{keywordflow}{if} (iso>1) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"MOM\_file\_parser : \#override was found "}// \&}
\DoxyCodeLine{975                  \textcolor{stringliteral}{" but was not the first keyword."}// \&}
\DoxyCodeLine{976                  \textcolor{stringliteral}{" Line: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//\&}
\DoxyCodeLine{977                  \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{"."})}
\DoxyCodeLine{978       \textcolor{keywordflow}{if} (iso==1) \textcolor{keywordflow}{then}}
\DoxyCodeLine{979         found\_override = .true.}
\DoxyCodeLine{980         \textcolor{keywordflow}{if} (index(line(:last), \textcolor{stringliteral}{"\#override define "})==1) found\_define = .true.}
\DoxyCodeLine{981         \textcolor{keywordflow}{if} (index(line(:last), \textcolor{stringliteral}{"\#override undef "})==1) found\_undef = .true.}
\DoxyCodeLine{982         line = trim(adjustl(line(iso+10:last))); last = len\_trim(line)}
\DoxyCodeLine{983 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{984 }
\DoxyCodeLine{985       \textcolor{comment}{! Check for start of fortran namelist, ie. '\&namelist'}}
\DoxyCodeLine{986       \textcolor{keywordflow}{if} (index(line(:last),\textcolor{stringliteral}{'\&'})==1) \textcolor{keywordflow}{then}}
\DoxyCodeLine{987         iso=index(line(:last),\textcolor{stringliteral}{' '})}
\DoxyCodeLine{988         \textcolor{keywordflow}{if} (iso>0) \textcolor{keywordflow}{then} \textcolor{comment}{! possibly simething else on this line}}
\DoxyCodeLine{989           blockname = pushblocklevel(blockname,line(2:iso-\/1))}
\DoxyCodeLine{990           line=trim(adjustl(line(iso:last)))}
\DoxyCodeLine{991           last=len\_trim(line)}
\DoxyCodeLine{992           \textcolor{keywordflow}{if} (last==0) cycle \textcolor{comment}{! nothing else on this line}}
\DoxyCodeLine{993         \textcolor{keywordflow}{else} \textcolor{comment}{! just the namelist on this line}}
\DoxyCodeLine{994           \textcolor{keywordflow}{if} (len\_trim(blockname)>0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{995             blockname = trim(blockname) // \textcolor{stringliteral}{'\%'} //trim(line(2:last))}
\DoxyCodeLine{996           \textcolor{keywordflow}{else}}
\DoxyCodeLine{997             blockname = trim(line(2:last))}
\DoxyCodeLine{998 \textcolor{keywordflow}{          endif}}
\DoxyCodeLine{999           \textcolor{keyword}{call }flag\_line\_as\_read(cs\%param\_data(ipf)\%line\_used,count)}
\DoxyCodeLine{1000           cycle}
\DoxyCodeLine{1001 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{1002 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{1003 }
\DoxyCodeLine{1004       \textcolor{comment}{! Newer form of parameter block, block\%, \%block or block\%param or}}
\DoxyCodeLine{1005       iso=index(line(:last),\textcolor{stringliteral}{'\%'})}
\DoxyCodeLine{1006       fullpathparameter = .false.}
\DoxyCodeLine{1007       \textcolor{keywordflow}{if} (iso==1) \textcolor{keywordflow}{then} \textcolor{comment}{! \% is first character means this is a close}}
\DoxyCodeLine{1008         \textcolor{keywordflow}{if} (len\_trim(blockname)==0 .and. is\_root\_pe()) \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{1009             \textcolor{stringliteral}{'get\_variable\_line: An extra close block was encountered. Line="'}// \&}
\DoxyCodeLine{1010             trim(line(:last))//\textcolor{stringliteral}{'"'} )}
\DoxyCodeLine{1011         \textcolor{keywordflow}{if} (last>1 .and. trim(blockname)/=trim(line(2:last)) .and. is\_root\_pe()) \&}
\DoxyCodeLine{1012             \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{'get\_variable\_line: A named close for a parameter'}// \&}
\DoxyCodeLine{1013             \textcolor{stringliteral}{' block did not match the open block. Line="'}//trim(line(:last))//\textcolor{stringliteral}{'"'} )}
\DoxyCodeLine{1014         \textcolor{keywordflow}{if} (last==1 .and. requirenamedclose) \& \textcolor{comment}{! line = '\%' is a generic (unnamed) close}}
\DoxyCodeLine{1015             \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{'get\_variable\_line: A named close for a parameter'}// \&}
\DoxyCodeLine{1016             \textcolor{stringliteral}{' block is required but found "\%". Block="'}//trim(blockname)//\textcolor{stringliteral}{'"'} )}
\DoxyCodeLine{1017         blockname = popblocklevel(blockname)}
\DoxyCodeLine{1018         \textcolor{keyword}{call }flag\_line\_as\_read(cs\%param\_data(ipf)\%line\_used,count)}
\DoxyCodeLine{1019       \textcolor{keywordflow}{elseif} (iso==last) \textcolor{keywordflow}{then} \textcolor{comment}{! This is a new block if \% is last character}}
\DoxyCodeLine{1020         blockname = pushblocklevel(blockname, line(:iso-\/1))}
\DoxyCodeLine{1021         \textcolor{keyword}{call }flag\_line\_as\_read(cs\%param\_data(ipf)\%line\_used,count)}
\DoxyCodeLine{1022       \textcolor{keywordflow}{else} \textcolor{comment}{! This is of the form block\%parameter = ... (full path parameter)}}
\DoxyCodeLine{1023         iso=index(line(:last),\textcolor{stringliteral}{'\%'},.true.)}
\DoxyCodeLine{1024         \textcolor{comment}{! Check that the parameter block names on the line matches the state set by the caller}}
\DoxyCodeLine{1025         \textcolor{keywordflow}{if} (iso>0 .and. trim(cs\%blockName\%name)==trim(line(:iso-\/1))) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1026           fullpathparameter = .true.}
\DoxyCodeLine{1027           line = trim(line(iso+1:last)) \textcolor{comment}{! Strip away the block name for subsequent processing}}
\DoxyCodeLine{1028           last = len\_trim(line)}
\DoxyCodeLine{1029 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{1030 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{1031 }
\DoxyCodeLine{1032       \textcolor{comment}{! We should only interpret this line if this block is the active block}}
\DoxyCodeLine{1033       inwrongblock = .false.}
\DoxyCodeLine{1034       \textcolor{keywordflow}{if} (len\_trim(blockname)>0) \textcolor{keywordflow}{then} \textcolor{comment}{! In a namelist block in file}}
\DoxyCodeLine{1035         \textcolor{keywordflow}{if} (trim(cs\%blockName\%name)/=trim(blockname)) inwrongblock = .true. \textcolor{comment}{! Not in the required block}}
\DoxyCodeLine{1036 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{1037       \textcolor{keywordflow}{if} (len\_trim(cs\%blockName\%name)>0) \textcolor{keywordflow}{then} \textcolor{comment}{! In a namelist block in the model}}
\DoxyCodeLine{1038         \textcolor{keywordflow}{if} (trim(cs\%blockName\%name)/=trim(blockname)) inwrongblock = .true. \textcolor{comment}{! Not in the required block}}
\DoxyCodeLine{1039 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{1040 }
\DoxyCodeLine{1041       \textcolor{comment}{! Check for termination of a fortran namelist (with a '/')}}
\DoxyCodeLine{1042       \textcolor{keywordflow}{if} (line(last:last)==\textcolor{stringliteral}{'/'}) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1043         \textcolor{keywordflow}{if} (len\_trim(blockname)==0 .and. is\_root\_pe()) \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{1044             \textcolor{stringliteral}{'get\_variable\_line: An extra namelist/block end was encountered. Line="'}// \&}
\DoxyCodeLine{1045             trim(line(:last))//\textcolor{stringliteral}{'"'} )}
\DoxyCodeLine{1046         blockname = popblocklevel(blockname)}
\DoxyCodeLine{1047         last = last -\/ 1 \textcolor{comment}{! Ignore the termination character from here on}}
\DoxyCodeLine{1048 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{1049       \textcolor{keywordflow}{if} (inwrongblock .and. .not. fullpathparameter) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1050         \textcolor{keywordflow}{if} (index(\textcolor{stringliteral}{" "}//line(:last+1), \textcolor{stringliteral}{" "}//trim(varname)//\textcolor{stringliteral}{" "})>0) \&}
\DoxyCodeLine{1051           \textcolor{keyword}{call }mom\_error(warning,\textcolor{stringliteral}{"MOM\_file\_parser : "}//trim(varname)// \&}
\DoxyCodeLine{1052                \textcolor{stringliteral}{' found outside of block '}//trim(cs\%blockName\%name)//\textcolor{stringliteral}{'\%. Ignoring.'})}
\DoxyCodeLine{1053         cycle}
\DoxyCodeLine{1054 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{1055 }
\DoxyCodeLine{1056       \textcolor{comment}{! Determine whether this line mentions the named parameter or not}}
\DoxyCodeLine{1057       \textcolor{keywordflow}{if} (index(\textcolor{stringliteral}{" "}//line(:last)//\textcolor{stringliteral}{" "}, \textcolor{stringliteral}{" "}//trim(varname)//\textcolor{stringliteral}{" "}) == 0) cycle}
\DoxyCodeLine{1058 }
\DoxyCodeLine{1059       \textcolor{comment}{! Detect keywords}}
\DoxyCodeLine{1060       found\_equals = .false.}
\DoxyCodeLine{1061       isd = index(line(:last), \textcolor{stringliteral}{"define"} )\textcolor{comment}{!; if (isd > 0) found\_define = .true.}}
\DoxyCodeLine{1062       isu = index(line(:last), \textcolor{stringliteral}{"undef"} )\textcolor{comment}{!; if (isu > 0) found\_undef = .true.}}
\DoxyCodeLine{1063       ise = index(line(:last), \textcolor{stringliteral}{" = "} ); \textcolor{keywordflow}{if} (ise > 1) found\_equals = .true.}
\DoxyCodeLine{1064       \textcolor{keywordflow}{if} (index(line(:last), \textcolor{stringliteral}{"\#define "})==1) found\_define = .true.}
\DoxyCodeLine{1065       \textcolor{keywordflow}{if} (index(line(:last), \textcolor{stringliteral}{"\#undef "})==1) found\_undef = .true.}
\DoxyCodeLine{1066 }
\DoxyCodeLine{1067       \textcolor{comment}{! Check for missing, mutually exclusive or incomplete keywords}}
\DoxyCodeLine{1068       \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1069         \textcolor{keywordflow}{if} (.not. (found\_define .or. found\_undef .or. found\_equals)) \&}
\DoxyCodeLine{1070                \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"MOM\_file\_parser : the parameter name '"}// \&}
\DoxyCodeLine{1071                  trim(varname)//\textcolor{stringliteral}{"' was found without define or undef."}// \&}
\DoxyCodeLine{1072                  \textcolor{stringliteral}{" Line: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//\&}
\DoxyCodeLine{1073                  \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{"."})}
\DoxyCodeLine{1074         \textcolor{keywordflow}{if} (found\_define .and. found\_undef) \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{1075                  \textcolor{stringliteral}{"MOM\_file\_parser : Both 'undef' and 'define' occur."}// \&}
\DoxyCodeLine{1076                  \textcolor{stringliteral}{" Line: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//\&}
\DoxyCodeLine{1077                  \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{"."})}
\DoxyCodeLine{1078         \textcolor{keywordflow}{if} (found\_equals .and. (found\_define .or. found\_undef)) \&}
\DoxyCodeLine{1079                \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{1080                  \textcolor{stringliteral}{"MOM\_file\_parser : Both 'a=b' and 'undef/define' syntax occur."}// \&}
\DoxyCodeLine{1081                  \textcolor{stringliteral}{" Line: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//\&}
\DoxyCodeLine{1082                  \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{"."})}
\DoxyCodeLine{1083         \textcolor{keywordflow}{if} (found\_override .and. .not. (found\_define .or. found\_undef .or. found\_equals)) \&}
\DoxyCodeLine{1084                \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"MOM\_file\_parser : override was found "}// \&}
\DoxyCodeLine{1085                  \textcolor{stringliteral}{" without a define or undef."}// \&}
\DoxyCodeLine{1086                  \textcolor{stringliteral}{" Line: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//\&}
\DoxyCodeLine{1087                  \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{"."})}
\DoxyCodeLine{1088 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{1089 }
\DoxyCodeLine{1090       \textcolor{comment}{! Interpret the line and collect values, if any}}
\DoxyCodeLine{1091       \textcolor{keywordflow}{if} (found\_define) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1092         \textcolor{comment}{! Move starting pointer to first letter of defined name.}}
\DoxyCodeLine{1093         is = isd + 5 + scan(line(isd+6:last), set)}
\DoxyCodeLine{1094 }
\DoxyCodeLine{1095         id = scan(line(is:last), \textcolor{stringliteral}{' '})  \textcolor{comment}{! Find space between name and value}}
\DoxyCodeLine{1096         \textcolor{keywordflow}{if} ( id == 0 ) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1097           \textcolor{comment}{! There is no space so the name is simply being defined.}}
\DoxyCodeLine{1098           lname = trim(line(is:last))}
\DoxyCodeLine{1099           \textcolor{keywordflow}{if} (trim(lname) /= trim(varname)) cycle}
\DoxyCodeLine{1100           val\_str = \textcolor{stringliteral}{" "}}
\DoxyCodeLine{1101         \textcolor{keywordflow}{else}}
\DoxyCodeLine{1102           \textcolor{comment}{! There is a string or number after the name.}}
\DoxyCodeLine{1103           lname = trim(line(is:is+id-\/1))}
\DoxyCodeLine{1104           \textcolor{keywordflow}{if} (trim(lname) /= trim(varname)) cycle}
\DoxyCodeLine{1105           val\_str = trim(adjustl(line(is+id:last)))}
\DoxyCodeLine{1106 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{1107         found = .true. ; defined\_in\_line = .true.}
\DoxyCodeLine{1108       \textcolor{keywordflow}{elseif} (found\_undef) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1109         \textcolor{comment}{! Move starting pointer to first letter of undefined name.}}
\DoxyCodeLine{1110         is = isu + 4 + scan(line(isu+5:last), set)}
\DoxyCodeLine{1111 }
\DoxyCodeLine{1112         id = scan(line(is:last), \textcolor{stringliteral}{' '})  \textcolor{comment}{! Find the first space after the name.}}
\DoxyCodeLine{1113         \textcolor{keywordflow}{if} (id > 0) last = is + id -\/ 1}
\DoxyCodeLine{1114         lname = trim(line(is:last))}
\DoxyCodeLine{1115         \textcolor{keywordflow}{if} (trim(lname) /= trim(varname)) cycle}
\DoxyCodeLine{1116         val\_str = \textcolor{stringliteral}{" "}}
\DoxyCodeLine{1117         found = .true. ; defined\_in\_line = .false.}
\DoxyCodeLine{1118       \textcolor{keywordflow}{elseif} (found\_equals) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1119         \textcolor{comment}{! Move starting pointer to first letter of defined name.}}
\DoxyCodeLine{1120         is = scan(line(1:ise), set)}
\DoxyCodeLine{1121         lname = trim(line(is:ise-\/1))}
\DoxyCodeLine{1122         \textcolor{keywordflow}{if} (trim(lname) /= trim(varname)) cycle}
\DoxyCodeLine{1123         val\_str = trim(adjustl(line(ise+3:last)))}
\DoxyCodeLine{1124         \textcolor{keywordflow}{if} (variablekindislogical) \textcolor{keywordflow}{then} \textcolor{comment}{! Special handling for logicals}}
\DoxyCodeLine{1125           \textcolor{keyword}{read}(val\_str(:len\_trim(val\_str)),*) defined\_in\_line}
\DoxyCodeLine{1126         \textcolor{keywordflow}{else}}
\DoxyCodeLine{1127           defined\_in\_line = .true.}
\DoxyCodeLine{1128 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{1129         found = .true.}
\DoxyCodeLine{1130       \textcolor{keywordflow}{else}}
\DoxyCodeLine{1131         \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"MOM\_file\_parser (non-\/root PE?): the parameter name '"}// \&}
\DoxyCodeLine{1132            trim(varname)//\textcolor{stringliteral}{"' was found without an assignment, define or undef."}// \&}
\DoxyCodeLine{1133            \textcolor{stringliteral}{" Line: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//\textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{"."})}
\DoxyCodeLine{1134 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{1135 }
\DoxyCodeLine{1136       \textcolor{comment}{! This line has now been used.}}
\DoxyCodeLine{1137       \textcolor{keyword}{call }flag\_line\_as\_read(cs\%param\_data(ipf)\%line\_used,count)}
\DoxyCodeLine{1138 }
\DoxyCodeLine{1139       \textcolor{comment}{! Detect inconsistencies}}
\DoxyCodeLine{1140       force\_cycle = .false.}
\DoxyCodeLine{1141       valueissame = (trim(val\_str) == trim(value\_string(max\_vals)))}
\DoxyCodeLine{1142       \textcolor{keywordflow}{if} (found\_override .and. (oval >= max\_vals)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1143         \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1144           \textcolor{keywordflow}{if} ((defined\_in\_line .neqv. defined) .or. .not. valueissame) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1145             \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"MOM\_file\_parser : "}//trim(varname)// \&}
\DoxyCodeLine{1146                      \textcolor{stringliteral}{" found with multiple inconsistent overrides."}// \&}
\DoxyCodeLine{1147                      \textcolor{stringliteral}{" Line A: '"}//trim(value\_string(max\_vals))//\textcolor{stringliteral}{"'"}//\&}
\DoxyCodeLine{1148                      \textcolor{stringliteral}{" Line B: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//\&}
\DoxyCodeLine{1149                      \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{" caused the model failure."})}
\DoxyCodeLine{1150           \textcolor{keywordflow}{else}}
\DoxyCodeLine{1151             \textcolor{keyword}{call }mom\_error(warning,\textcolor{stringliteral}{"MOM\_file\_parser : "}//trim(varname)// \&}
\DoxyCodeLine{1152                      \textcolor{stringliteral}{" over-\/ridden more times than is permitted."}// \&}
\DoxyCodeLine{1153                      \textcolor{stringliteral}{" Line: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//\&}
\DoxyCodeLine{1154                      \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{" is being ignored."})}
\DoxyCodeLine{1155 \textcolor{keywordflow}{          endif}}
\DoxyCodeLine{1156 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{1157         force\_cycle = .true.}
\DoxyCodeLine{1158 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{1159       \textcolor{keywordflow}{if} (.not.found\_override .and. (oval > 0)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1160         \textcolor{keywordflow}{if} (is\_root\_pe()) \&}
\DoxyCodeLine{1161           \textcolor{keyword}{call }mom\_error(warning,\textcolor{stringliteral}{"MOM\_file\_parser : "}//trim(varname)// \&}
\DoxyCodeLine{1162                    \textcolor{stringliteral}{" has already been over-\/ridden."}// \&}
\DoxyCodeLine{1163                    \textcolor{stringliteral}{" Line: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//\&}
\DoxyCodeLine{1164                    \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{" is being ignored."})}
\DoxyCodeLine{1165         force\_cycle = .true.}
\DoxyCodeLine{1166 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{1167       \textcolor{keywordflow}{if} (.not.found\_override .and. (ival >= max\_vals)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1168         \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1169           \textcolor{keywordflow}{if} ((defined\_in\_line .neqv. defined) .or. .not. valueissame) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1170             \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"MOM\_file\_parser : "}//trim(varname)// \&}
\DoxyCodeLine{1171                      \textcolor{stringliteral}{" found with multiple inconsistent definitions."}// \&}
\DoxyCodeLine{1172                      \textcolor{stringliteral}{" Line A: '"}//trim(value\_string(max\_vals))//\textcolor{stringliteral}{"'"}//\&}
\DoxyCodeLine{1173                      \textcolor{stringliteral}{" Line B: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//\&}
\DoxyCodeLine{1174                      \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{" caused the model failure."})}
\DoxyCodeLine{1175           \textcolor{keywordflow}{else}}
\DoxyCodeLine{1176             \textcolor{keyword}{call }mom\_error(warning,\textcolor{stringliteral}{"MOM\_file\_parser : "}//trim(varname)// \&}
\DoxyCodeLine{1177                      \textcolor{stringliteral}{" occurs more times than is permitted."}// \&}
\DoxyCodeLine{1178                      \textcolor{stringliteral}{" Line: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//\&}
\DoxyCodeLine{1179                      \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{" is being ignored."})}
\DoxyCodeLine{1180 \textcolor{keywordflow}{          endif}}
\DoxyCodeLine{1181 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{1182         force\_cycle = .true.}
\DoxyCodeLine{1183 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{1184       \textcolor{keywordflow}{if} (force\_cycle) cycle}
\DoxyCodeLine{1185 }
\DoxyCodeLine{1186       \textcolor{comment}{! Store new values}}
\DoxyCodeLine{1187       \textcolor{keywordflow}{if} (found\_override) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1188         oval = oval + 1}
\DoxyCodeLine{1189         value\_string(oval) = trim(val\_str)}
\DoxyCodeLine{1190         defined = defined\_in\_line}
\DoxyCodeLine{1191         \textcolor{keywordflow}{if} (verbose > 0 .and. ival > 0 .and. is\_root\_pe() .and. \&}
\DoxyCodeLine{1192             .not. overridewarninghasbeenissued(cs\%chain, trim(varname)) ) \&}
\DoxyCodeLine{1193           \textcolor{keyword}{call }mom\_error(warning,\textcolor{stringliteral}{"MOM\_file\_parser : "}//trim(varname)// \&}
\DoxyCodeLine{1194                  \textcolor{stringliteral}{" over-\/ridden.  Line: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//\&}
\DoxyCodeLine{1195                  \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{"."})}
\DoxyCodeLine{1196       \textcolor{keywordflow}{else} \textcolor{comment}{! (.not. found\_overide)}}
\DoxyCodeLine{1197         ival = ival + 1}
\DoxyCodeLine{1198         value\_string(ival) = trim(val\_str)}
\DoxyCodeLine{1199         defined = defined\_in\_line}
\DoxyCodeLine{1200         \textcolor{keywordflow}{if} (verbose > 1 .and. is\_root\_pe()) \&}
\DoxyCodeLine{1201           \textcolor{keyword}{call }mom\_error(warning,\textcolor{stringliteral}{"MOM\_file\_parser : "}//trim(varname)// \&}
\DoxyCodeLine{1202                  \textcolor{stringliteral}{" set.  Line: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//\&}
\DoxyCodeLine{1203                  \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{"."})}
\DoxyCodeLine{1204 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{1205 }
\DoxyCodeLine{1206 \textcolor{keywordflow}{    enddo} \textcolor{comment}{! CS\%param\_data(ipf)\%num\_lines}}
\DoxyCodeLine{1207 }
\DoxyCodeLine{1208     \textcolor{keywordflow}{if} (len\_trim(blockname)>0 .and. is\_root\_pe()) \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{1209       \textcolor{stringliteral}{'A namelist/parameter block was not closed. Last open block appears '}// \&}
\DoxyCodeLine{1210       \textcolor{stringliteral}{'to be "'}//trim(blockname)//\textcolor{stringliteral}{'".'})}
\DoxyCodeLine{1211 }
\DoxyCodeLine{1212 \textcolor{keywordflow}{  enddo} paramfile\_loop}
\DoxyCodeLine{1213 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a000fd0a0681f9e73481ef2663154df78}\label{namespacemom__file__parser_a000fd0a0681f9e73481ef2663154df78}} 
\index{mom\_file\_parser@{mom\_file\_parser}!lastnoncommentindex@{lastnoncommentindex}}
\index{lastnoncommentindex@{lastnoncommentindex}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{lastnoncommentindex()}{lastnoncommentindex()}}
{\footnotesize\ttfamily integer function mom\+\_\+file\+\_\+parser\+::lastnoncommentindex (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{string }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Find position of last character before any comments, As marked by \char`\"{}!\char`\"{}, \char`\"{}//\char`\"{}, or \char`\"{}/$\ast$\char`\"{} following F90, C++, or C syntax. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em string} & The input string to process \\
\hline
\end{DoxyParams}


Definition at line 474 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{474   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{intent(in)} :: string\textcolor{comment}{  !< The input string to process}}
\DoxyCodeLine{475   \textcolor{keywordtype}{integer}                      :: lastNonCommentIndex}
\DoxyCodeLine{476 }
\DoxyCodeLine{477   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{478   \textcolor{keywordtype}{integer} :: icom, last}
\DoxyCodeLine{479 }
\DoxyCodeLine{480   \textcolor{comment}{! This subroutine is the only place where a comment needs to be defined}}
\DoxyCodeLine{481   last = len\_trim(string)}
\DoxyCodeLine{482   icom = index(string(:last), \textcolor{stringliteral}{"!"}) ; \textcolor{keywordflow}{if} (icom > 0) last = icom-\/1 \textcolor{comment}{! F90 style}}
\DoxyCodeLine{483   icom = index(string(:last), \textcolor{stringliteral}{"//"}) ; \textcolor{keywordflow}{if} (icom > 0) last = icom-\/1 \textcolor{comment}{! C++ style}}
\DoxyCodeLine{484   icom = index(string(:last), \textcolor{stringliteral}{"/*"}) ; \textcolor{keywordflow}{if} (icom > 0) last = icom-\/1 \textcolor{comment}{! C style}}
\DoxyCodeLine{485   lastnoncommentindex = last}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_ab4b89d9420e174185db1c6aa3feb948b}\label{namespacemom__file__parser_ab4b89d9420e174185db1c6aa3feb948b}} 
\index{mom\_file\_parser@{mom\_file\_parser}!lastnoncommentnonblank@{lastnoncommentnonblank}}
\index{lastnoncommentnonblank@{lastnoncommentnonblank}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{lastnoncommentnonblank()}{lastnoncommentnonblank()}}
{\footnotesize\ttfamily integer function mom\+\_\+file\+\_\+parser\+::lastnoncommentnonblank (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{string }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Find position of last non-\/blank character before any comments. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em string} & The input string to process \\
\hline
\end{DoxyParams}


Definition at line 490 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{490   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{intent(in)} :: string\textcolor{comment}{  !< The input string to process}}
\DoxyCodeLine{491   \textcolor{keywordtype}{integer}                      :: lastNonCommentNonBlank}
\DoxyCodeLine{492 }
\DoxyCodeLine{493   lastnoncommentnonblank = len\_trim(string(:lastnoncommentindex(string))) \textcolor{comment}{! Ignore remaining trailing blanks}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_afc8a86933730879e4ba4d28ec9736c30}\label{namespacemom__file__parser_afc8a86933730879e4ba4d28ec9736c30}} 
\index{mom\_file\_parser@{mom\_file\_parser}!log\_param\_char@{log\_param\_char}}
\index{log\_param\_char@{log\_param\_char}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{log\_param\_char()}{log\_param\_char()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::log\+\_\+param\+\_\+char (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{modulename,  }\item[{character(len=$\ast$), intent(in)}]{varname,  }\item[{character(len=$\ast$), intent(in)}]{value,  }\item[{character(len=$\ast$), intent(in), optional}]{desc,  }\item[{character(len=$\ast$), intent(in), optional}]{units,  }\item[{character(len=$\ast$), intent(in), optional}]{default,  }\item[{logical, intent(in), optional}]{layout\+Param,  }\item[{logical, intent(in), optional}]{debugging\+Param,  }\item[{logical, intent(in), optional}]{like\+\_\+default }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Log the name and value of a character string model parameter in documentation files. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em modulename} & The name of the calling module \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The name of the parameter to log \\
\hline
\mbox{\texttt{ in}}  & {\em value} & The value of the parameter to log \\
\hline
\mbox{\texttt{ in}}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file \\
\hline
\mbox{\texttt{ in}}  & {\em units} & The units of this parameter \\
\hline
\mbox{\texttt{ in}}  & {\em default} & The default value of the parameter \\
\hline
\mbox{\texttt{ in}}  & {\em layoutparam} & If present and true, this parameter is logged in the layout parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em debuggingparam} & If present and true, this parameter is logged in the debugging parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em like\+\_\+default} & If present and true, log this parameter as though it has the default value, even if there is no default. \\
\hline
\end{DoxyParams}


Definition at line 1470 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1470   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{1471 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{1472   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: modulename\textcolor{comment}{ !< The name of the calling module}}
\DoxyCodeLine{1473   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The name of the parameter to log}}
\DoxyCodeLine{1474   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter to log}}
\DoxyCodeLine{1475   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: desc\textcolor{comment}{    !< A description of this variable; if not}}
\DoxyCodeLine{1476 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}}
\DoxyCodeLine{1477   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: units\textcolor{comment}{   !< The units of this parameter}}
\DoxyCodeLine{1478   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: default\textcolor{comment}{ !< The default value of the parameter}}
\DoxyCodeLine{1479   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: layoutParam\textcolor{comment}{ !< If present and true, this parameter is}}
\DoxyCodeLine{1480 \textcolor{comment}{                                         !! logged in the layout parameter file}}
\DoxyCodeLine{1481   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}}
\DoxyCodeLine{1482 \textcolor{comment}{                                         !! logged in the debugging parameter file}}
\DoxyCodeLine{1483   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: like\_default\textcolor{comment}{ !< If present and true, log this parameter as}}
\DoxyCodeLine{1484 \textcolor{comment}{                                         !! though it has the default value, even if there is no default.}}
\DoxyCodeLine{1485 }
\DoxyCodeLine{1486   \textcolor{keywordtype}{character(len=1024)} :: mesg, myunits}
\DoxyCodeLine{1487 }
\DoxyCodeLine{1488   \textcolor{keyword}{write}(mesg, \textcolor{stringliteral}{'("  ",a," ",a,": ",a)'}) \&}
\DoxyCodeLine{1489     trim(modulename), trim(varname), trim(\textcolor{keywordtype}{value})}
\DoxyCodeLine{1490   \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1491     \textcolor{keywordflow}{if} (cs\%log\_open) \textcolor{keyword}{write}(cs\%stdlog,\textcolor{stringliteral}{'(a)'}) trim(mesg)}
\DoxyCodeLine{1492     \textcolor{keywordflow}{if} (cs\%log\_to\_stdout) \textcolor{keyword}{write}(cs\%stdout,\textcolor{stringliteral}{'(a)'}) trim(mesg)}
\DoxyCodeLine{1493 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1494 }
\DoxyCodeLine{1495   myunits=\textcolor{stringliteral}{" "}; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(units)) \textcolor{keyword}{write}(myunits(1:1024),\textcolor{stringliteral}{'(A)'}) trim(units)}
\DoxyCodeLine{1496   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(desc)) \&}
\DoxyCodeLine{1497     \textcolor{keyword}{call }doc\_param(cs\%doc, varname, desc, myunits, \textcolor{keywordtype}{value}, default, \&}
\DoxyCodeLine{1498                    layoutparam=layoutparam, debuggingparam=debuggingparam, like\_default=like\_default)}
\DoxyCodeLine{1499 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a9de0970faa34e6db6f15f526cf305ca4}\label{namespacemom__file__parser_a9de0970faa34e6db6f15f526cf305ca4}} 
\index{mom\_file\_parser@{mom\_file\_parser}!log\_param\_int@{log\_param\_int}}
\index{log\_param\_int@{log\_param\_int}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{log\_param\_int()}{log\_param\_int()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::log\+\_\+param\+\_\+int (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{modulename,  }\item[{character(len=$\ast$), intent(in)}]{varname,  }\item[{integer, intent(in)}]{value,  }\item[{character(len=$\ast$), intent(in), optional}]{desc,  }\item[{character(len=$\ast$), intent(in), optional}]{units,  }\item[{integer, intent(in), optional}]{default,  }\item[{logical, intent(in), optional}]{layout\+Param,  }\item[{logical, intent(in), optional}]{debugging\+Param,  }\item[{logical, intent(in), optional}]{like\+\_\+default }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Log the name and value of an integer model parameter in documentation files. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em modulename} & The name of the module using this parameter \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The name of the parameter to log \\
\hline
\mbox{\texttt{ in}}  & {\em value} & The value of the parameter to log \\
\hline
\mbox{\texttt{ in}}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file \\
\hline
\mbox{\texttt{ in}}  & {\em units} & The units of this parameter \\
\hline
\mbox{\texttt{ in}}  & {\em default} & The default value of the parameter \\
\hline
\mbox{\texttt{ in}}  & {\em layoutparam} & If present and true, this parameter is logged in the layout parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em debuggingparam} & If present and true, this parameter is logged in the debugging parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em like\+\_\+default} & If present and true, log this parameter as though it has the default value, even if there is no default. \\
\hline
\end{DoxyParams}


Definition at line 1293 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1293   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{1294 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{1295   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: modulename\textcolor{comment}{ !< The name of the module using this parameter}}
\DoxyCodeLine{1296   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The name of the parameter to log}}
\DoxyCodeLine{1297   \textcolor{keywordtype}{integer},                    \textcolor{keywordtype}{intent(in)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter to log}}
\DoxyCodeLine{1298   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: desc\textcolor{comment}{    !< A description of this variable; if not}}
\DoxyCodeLine{1299 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}}
\DoxyCodeLine{1300   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: units\textcolor{comment}{   !< The units of this parameter}}
\DoxyCodeLine{1301   \textcolor{keywordtype}{integer},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: default\textcolor{comment}{ !< The default value of the parameter}}
\DoxyCodeLine{1302   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: layoutParam\textcolor{comment}{ !< If present and true, this parameter is}}
\DoxyCodeLine{1303 \textcolor{comment}{                                         !! logged in the layout parameter file}}
\DoxyCodeLine{1304   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}}
\DoxyCodeLine{1305 \textcolor{comment}{                                         !! logged in the debugging parameter file}}
\DoxyCodeLine{1306   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: like\_default\textcolor{comment}{ !< If present and true, log this parameter as}}
\DoxyCodeLine{1307 \textcolor{comment}{                                         !! though it has the default value, even if there is no default.}}
\DoxyCodeLine{1308 }
\DoxyCodeLine{1309   \textcolor{keywordtype}{character(len=240)} :: mesg, myunits}
\DoxyCodeLine{1310 }
\DoxyCodeLine{1311   \textcolor{keyword}{write}(mesg, \textcolor{stringliteral}{'("  ",a," ",a,": ",a)'}) trim(modulename), trim(varname), trim(left\_int(\textcolor{keywordtype}{value}))}
\DoxyCodeLine{1312   \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1313     \textcolor{keywordflow}{if} (cs\%log\_open) \textcolor{keyword}{write}(cs\%stdlog,\textcolor{stringliteral}{'(a)'}) trim(mesg)}
\DoxyCodeLine{1314     \textcolor{keywordflow}{if} (cs\%log\_to\_stdout) \textcolor{keyword}{write}(cs\%stdout,\textcolor{stringliteral}{'(a)'}) trim(mesg)}
\DoxyCodeLine{1315 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1316 }
\DoxyCodeLine{1317   myunits=\textcolor{stringliteral}{" "}; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(units)) \textcolor{keyword}{write}(myunits(1:240),\textcolor{stringliteral}{'(A)'}) trim(units)}
\DoxyCodeLine{1318   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(desc)) \&}
\DoxyCodeLine{1319     \textcolor{keyword}{call }doc\_param(cs\%doc, varname, desc, myunits, \textcolor{keywordtype}{value}, default, \&}
\DoxyCodeLine{1320                    layoutparam=layoutparam, debuggingparam=debuggingparam, like\_default=like\_default)}
\DoxyCodeLine{1321 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_ac3d162a4e2d2240609561675842223aa}\label{namespacemom__file__parser_ac3d162a4e2d2240609561675842223aa}} 
\index{mom\_file\_parser@{mom\_file\_parser}!log\_param\_int\_array@{log\_param\_int\_array}}
\index{log\_param\_int\_array@{log\_param\_int\_array}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{log\_param\_int\_array()}{log\_param\_int\_array()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::log\+\_\+param\+\_\+int\+\_\+array (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{modulename,  }\item[{character(len=$\ast$), intent(in)}]{varname,  }\item[{integer, dimension(\+:), intent(in)}]{value,  }\item[{character(len=$\ast$), intent(in), optional}]{desc,  }\item[{character(len=$\ast$), intent(in), optional}]{units,  }\item[{integer, intent(in), optional}]{default,  }\item[{logical, intent(in), optional}]{layout\+Param,  }\item[{logical, intent(in), optional}]{debugging\+Param,  }\item[{logical, intent(in), optional}]{like\+\_\+default }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Log the name and values of an array of integer model parameter in documentation files. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em modulename} & The name of the module using this parameter \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The name of the parameter to log \\
\hline
\mbox{\texttt{ in}}  & {\em value} & The value of the parameter to log \\
\hline
\mbox{\texttt{ in}}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file \\
\hline
\mbox{\texttt{ in}}  & {\em units} & The units of this parameter \\
\hline
\mbox{\texttt{ in}}  & {\em default} & The default value of the parameter \\
\hline
\mbox{\texttt{ in}}  & {\em layoutparam} & If present and true, this parameter is logged in the layout parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em debuggingparam} & If present and true, this parameter is logged in the debugging parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em like\+\_\+default} & If present and true, log this parameter as though it has the default value, even if there is no default. \\
\hline
\end{DoxyParams}


Definition at line 1327 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1327   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{1328 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{1329   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: modulename\textcolor{comment}{ !< The name of the module using this parameter}}
\DoxyCodeLine{1330   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The name of the parameter to log}}
\DoxyCodeLine{1331   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{dimension(:)},      \textcolor{keywordtype}{intent(in)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter to log}}
\DoxyCodeLine{1332   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: desc\textcolor{comment}{    !< A description of this variable; if not}}
\DoxyCodeLine{1333 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}}
\DoxyCodeLine{1334   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: units\textcolor{comment}{   !< The units of this parameter}}
\DoxyCodeLine{1335   \textcolor{keywordtype}{integer},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: default\textcolor{comment}{ !< The default value of the parameter}}
\DoxyCodeLine{1336   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: layoutParam\textcolor{comment}{ !< If present and true, this parameter is}}
\DoxyCodeLine{1337 \textcolor{comment}{                                         !! logged in the layout parameter file}}
\DoxyCodeLine{1338   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}}
\DoxyCodeLine{1339 \textcolor{comment}{                                         !! logged in the debugging parameter file}}
\DoxyCodeLine{1340   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: like\_default\textcolor{comment}{ !< If present and true, log this parameter as}}
\DoxyCodeLine{1341 \textcolor{comment}{                                         !! though it has the default value, even if there is no default.}}
\DoxyCodeLine{1342 }
\DoxyCodeLine{1343   \textcolor{keywordtype}{character(len=1320)} :: mesg}
\DoxyCodeLine{1344   \textcolor{keywordtype}{character(len=240)} :: myunits}
\DoxyCodeLine{1345 }
\DoxyCodeLine{1346   \textcolor{keyword}{write}(mesg, \textcolor{stringliteral}{'("  ",a," ",a,": ",A)'}) trim(modulename), trim(varname), trim(left\_ints(\textcolor{keywordtype}{value}))}
\DoxyCodeLine{1347   \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1348     \textcolor{keywordflow}{if} (cs\%log\_open) \textcolor{keyword}{write}(cs\%stdlog,\textcolor{stringliteral}{'(a)'}) trim(mesg)}
\DoxyCodeLine{1349     \textcolor{keywordflow}{if} (cs\%log\_to\_stdout) \textcolor{keyword}{write}(cs\%stdout,\textcolor{stringliteral}{'(a)'}) trim(mesg)}
\DoxyCodeLine{1350 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1351 }
\DoxyCodeLine{1352   myunits=\textcolor{stringliteral}{" "}; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(units)) \textcolor{keyword}{write}(myunits(1:240),\textcolor{stringliteral}{'(A)'}) trim(units)}
\DoxyCodeLine{1353   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(desc)) \&}
\DoxyCodeLine{1354     \textcolor{keyword}{call }doc\_param(cs\%doc, varname, desc, myunits, \textcolor{keywordtype}{value}, default, \&}
\DoxyCodeLine{1355                    layoutparam=layoutparam, debuggingparam=debuggingparam, like\_default=like\_default)}
\DoxyCodeLine{1356 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_af40b11dca775343525981f4c5521478f}\label{namespacemom__file__parser_af40b11dca775343525981f4c5521478f}} 
\index{mom\_file\_parser@{mom\_file\_parser}!log\_param\_logical@{log\_param\_logical}}
\index{log\_param\_logical@{log\_param\_logical}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{log\_param\_logical()}{log\_param\_logical()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::log\+\_\+param\+\_\+logical (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{modulename,  }\item[{character(len=$\ast$), intent(in)}]{varname,  }\item[{logical, intent(in)}]{value,  }\item[{character(len=$\ast$), intent(in), optional}]{desc,  }\item[{character(len=$\ast$), intent(in), optional}]{units,  }\item[{logical, intent(in), optional}]{default,  }\item[{logical, intent(in), optional}]{layout\+Param,  }\item[{logical, intent(in), optional}]{debugging\+Param,  }\item[{logical, intent(in), optional}]{like\+\_\+default }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Log the name and value of a logical model parameter in documentation files. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em modulename} & The name of the calling module \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The name of the parameter to log \\
\hline
\mbox{\texttt{ in}}  & {\em value} & The value of the parameter to log \\
\hline
\mbox{\texttt{ in}}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file \\
\hline
\mbox{\texttt{ in}}  & {\em units} & The units of this parameter \\
\hline
\mbox{\texttt{ in}}  & {\em default} & The default value of the parameter \\
\hline
\mbox{\texttt{ in}}  & {\em layoutparam} & If present and true, this parameter is logged in the layout parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em debuggingparam} & If present and true, this parameter is logged in the debugging parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em like\+\_\+default} & If present and true, log this parameter as though it has the default value, even if there is no default. \\
\hline
\end{DoxyParams}


Definition at line 1432 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1432   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{1433 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{1434   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: modulename\textcolor{comment}{ !< The name of the calling module}}
\DoxyCodeLine{1435   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The name of the parameter to log}}
\DoxyCodeLine{1436   \textcolor{keywordtype}{logical},                    \textcolor{keywordtype}{intent(in)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter to log}}
\DoxyCodeLine{1437   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: desc\textcolor{comment}{    !< A description of this variable; if not}}
\DoxyCodeLine{1438 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}}
\DoxyCodeLine{1439   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: units\textcolor{comment}{   !< The units of this parameter}}
\DoxyCodeLine{1440   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: default\textcolor{comment}{ !< The default value of the parameter}}
\DoxyCodeLine{1441   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: layoutParam\textcolor{comment}{ !< If present and true, this parameter is}}
\DoxyCodeLine{1442 \textcolor{comment}{                                         !! logged in the layout parameter file}}
\DoxyCodeLine{1443   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}}
\DoxyCodeLine{1444 \textcolor{comment}{                                         !! logged in the debugging parameter file}}
\DoxyCodeLine{1445   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: like\_default\textcolor{comment}{ !< If present and true, log this parameter as}}
\DoxyCodeLine{1446 \textcolor{comment}{                                         !! though it has the default value, even if there is no default.}}
\DoxyCodeLine{1447 }
\DoxyCodeLine{1448   \textcolor{keywordtype}{character(len=240)} :: mesg, myunits}
\DoxyCodeLine{1449 }
\DoxyCodeLine{1450   \textcolor{keywordflow}{if} (\textcolor{keywordtype}{value}) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1451     \textcolor{keyword}{write}(mesg, \textcolor{stringliteral}{'("  ",a," ",a,": True")'}) trim(modulename), trim(varname)}
\DoxyCodeLine{1452   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1453     \textcolor{keyword}{write}(mesg, \textcolor{stringliteral}{'("  ",a," ",a,": False")'}) trim(modulename), trim(varname)}
\DoxyCodeLine{1454 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1455   \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1456     \textcolor{keywordflow}{if} (cs\%log\_open) \textcolor{keyword}{write}(cs\%stdlog,\textcolor{stringliteral}{'(a)'}) trim(mesg)}
\DoxyCodeLine{1457     \textcolor{keywordflow}{if} (cs\%log\_to\_stdout) \textcolor{keyword}{write}(cs\%stdout,\textcolor{stringliteral}{'(a)'}) trim(mesg)}
\DoxyCodeLine{1458 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1459 }
\DoxyCodeLine{1460   myunits=\textcolor{stringliteral}{"Boolean"}; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(units)) \textcolor{keyword}{write}(myunits(1:240),\textcolor{stringliteral}{'(A)'}) trim(units)}
\DoxyCodeLine{1461   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(desc)) \&}
\DoxyCodeLine{1462     \textcolor{keyword}{call }doc\_param(cs\%doc, varname, desc, myunits, \textcolor{keywordtype}{value}, default, \&}
\DoxyCodeLine{1463                    layoutparam=layoutparam, debuggingparam=debuggingparam, like\_default=like\_default)}
\DoxyCodeLine{1464 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_aa90bbff4e22d9e05ba9a68a350852fd0}\label{namespacemom__file__parser_aa90bbff4e22d9e05ba9a68a350852fd0}} 
\index{mom\_file\_parser@{mom\_file\_parser}!log\_param\_real@{log\_param\_real}}
\index{log\_param\_real@{log\_param\_real}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{log\_param\_real()}{log\_param\_real()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::log\+\_\+param\+\_\+real (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{modulename,  }\item[{character(len=$\ast$), intent(in)}]{varname,  }\item[{real, intent(in)}]{value,  }\item[{character(len=$\ast$), intent(in), optional}]{desc,  }\item[{character(len=$\ast$), intent(in), optional}]{units,  }\item[{real, intent(in), optional}]{default,  }\item[{logical, intent(in), optional}]{debugging\+Param,  }\item[{logical, intent(in), optional}]{like\+\_\+default }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Log the name and value of a real model parameter in documentation files. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em modulename} & The name of the calling module \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The name of the parameter to log \\
\hline
\mbox{\texttt{ in}}  & {\em value} & The value of the parameter to log \\
\hline
\mbox{\texttt{ in}}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file \\
\hline
\mbox{\texttt{ in}}  & {\em units} & The units of this parameter \\
\hline
\mbox{\texttt{ in}}  & {\em default} & The default value of the parameter \\
\hline
\mbox{\texttt{ in}}  & {\em debuggingparam} & If present and true, this parameter is logged in the debugging parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em like\+\_\+default} & If present and true, log this parameter as though it has the default value, even if there is no default. \\
\hline
\end{DoxyParams}


Definition at line 1362 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1362   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{1363 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{1364   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: modulename\textcolor{comment}{ !< The name of the calling module}}
\DoxyCodeLine{1365   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The name of the parameter to log}}
\DoxyCodeLine{1366 \textcolor{keywordtype}{  real},                       \textcolor{keywordtype}{intent(in)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter to log}}
\DoxyCodeLine{1367   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: desc\textcolor{comment}{    !< A description of this variable; if not}}
\DoxyCodeLine{1368 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}}
\DoxyCodeLine{1369   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: units\textcolor{comment}{   !< The units of this parameter}}
\DoxyCodeLine{1370 \textcolor{keywordtype}{  real},             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: default\textcolor{comment}{ !< The default value of the parameter}}
\DoxyCodeLine{1371   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}}
\DoxyCodeLine{1372 \textcolor{comment}{                                         !! logged in the debugging parameter file}}
\DoxyCodeLine{1373   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: like\_default\textcolor{comment}{ !< If present and true, log this parameter as}}
\DoxyCodeLine{1374 \textcolor{comment}{                                         !! though it has the default value, even if there is no default.}}
\DoxyCodeLine{1375 }
\DoxyCodeLine{1376   \textcolor{keywordtype}{character(len=240)} :: mesg, myunits}
\DoxyCodeLine{1377 }
\DoxyCodeLine{1378   \textcolor{keyword}{write}(mesg, \textcolor{stringliteral}{'("  ",a," ",a,": ",a)'}) \&}
\DoxyCodeLine{1379     trim(modulename), trim(varname), trim(left\_real(\textcolor{keywordtype}{value}))}
\DoxyCodeLine{1380   \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1381     \textcolor{keywordflow}{if} (cs\%log\_open) \textcolor{keyword}{write}(cs\%stdlog,\textcolor{stringliteral}{'(a)'}) trim(mesg)}
\DoxyCodeLine{1382     \textcolor{keywordflow}{if} (cs\%log\_to\_stdout) \textcolor{keyword}{write}(cs\%stdout,\textcolor{stringliteral}{'(a)'}) trim(mesg)}
\DoxyCodeLine{1383 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1384 }
\DoxyCodeLine{1385   myunits=\textcolor{stringliteral}{"not defined"}; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(units)) \textcolor{keyword}{write}(myunits(1:240),\textcolor{stringliteral}{'(A)'}) trim(units)}
\DoxyCodeLine{1386   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(desc)) \&}
\DoxyCodeLine{1387     \textcolor{keyword}{call }doc\_param(cs\%doc, varname, desc, myunits, \textcolor{keywordtype}{value}, default, \&}
\DoxyCodeLine{1388                    debuggingparam=debuggingparam, like\_default=like\_default)}
\DoxyCodeLine{1389 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a299e3cf82ae37f14ca38dc9323238621}\label{namespacemom__file__parser_a299e3cf82ae37f14ca38dc9323238621}} 
\index{mom\_file\_parser@{mom\_file\_parser}!log\_param\_real\_array@{log\_param\_real\_array}}
\index{log\_param\_real\_array@{log\_param\_real\_array}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{log\_param\_real\_array()}{log\_param\_real\_array()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::log\+\_\+param\+\_\+real\+\_\+array (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{modulename,  }\item[{character(len=$\ast$), intent(in)}]{varname,  }\item[{real, dimension(\+:), intent(in)}]{value,  }\item[{character(len=$\ast$), intent(in), optional}]{desc,  }\item[{character(len=$\ast$), intent(in), optional}]{units,  }\item[{real, intent(in), optional}]{default,  }\item[{logical, intent(in), optional}]{debugging\+Param,  }\item[{logical, intent(in), optional}]{like\+\_\+default }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Log the name and values of an array of real model parameter in documentation files. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em modulename} & The name of the calling module \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The name of the parameter to log \\
\hline
\mbox{\texttt{ in}}  & {\em value} & The value of the parameter to log \\
\hline
\mbox{\texttt{ in}}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file \\
\hline
\mbox{\texttt{ in}}  & {\em units} & The units of this parameter \\
\hline
\mbox{\texttt{ in}}  & {\em default} & The default value of the parameter \\
\hline
\mbox{\texttt{ in}}  & {\em debuggingparam} & If present and true, this parameter is logged in the debugging parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em like\+\_\+default} & If present and true, log this parameter as though it has the default value, even if there is no default. \\
\hline
\end{DoxyParams}


Definition at line 1395 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1395   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{1396 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{1397   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: modulename\textcolor{comment}{ !< The name of the calling module}}
\DoxyCodeLine{1398   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The name of the parameter to log}}
\DoxyCodeLine{1399 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)},         \textcolor{keywordtype}{intent(in)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter to log}}
\DoxyCodeLine{1400   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: desc\textcolor{comment}{    !< A description of this variable; if not}}
\DoxyCodeLine{1401 \textcolor{comment}{                                             !! present, this parameter is not written to a doc file}}
\DoxyCodeLine{1402   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: units\textcolor{comment}{   !< The units of this parameter}}
\DoxyCodeLine{1403 \textcolor{keywordtype}{  real},             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: default\textcolor{comment}{ !< The default value of the parameter}}
\DoxyCodeLine{1404   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}}
\DoxyCodeLine{1405 \textcolor{comment}{                                         !! logged in the debugging parameter file}}
\DoxyCodeLine{1406   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: like\_default\textcolor{comment}{ !< If present and true, log this parameter as}}
\DoxyCodeLine{1407 \textcolor{comment}{                                         !! though it has the default value, even if there is no default.}}
\DoxyCodeLine{1408 }
\DoxyCodeLine{1409   \textcolor{keywordtype}{character(len=1320)} :: mesg}
\DoxyCodeLine{1410   \textcolor{keywordtype}{character(len=240)} :: myunits}
\DoxyCodeLine{1411 }
\DoxyCodeLine{1412  \textcolor{comment}{!write(mesg, '("  ",a," ",a,": ",ES19.12,99(",",ES19.12))') \&}}
\DoxyCodeLine{1413  \textcolor{comment}{!write(mesg, '("  ",a," ",a,": ",G,99(",",G))') \&}}
\DoxyCodeLine{1414  \textcolor{comment}{!  trim(modulename), trim(varname), value}}
\DoxyCodeLine{1415   \textcolor{keyword}{write}(mesg, \textcolor{stringliteral}{'("  ",a," ",a,": ",a)'}) \&}
\DoxyCodeLine{1416     trim(modulename), trim(varname), trim(left\_reals(\textcolor{keywordtype}{value}))}
\DoxyCodeLine{1417   \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1418     \textcolor{keywordflow}{if} (cs\%log\_open) \textcolor{keyword}{write}(cs\%stdlog,\textcolor{stringliteral}{'(a)'}) trim(mesg)}
\DoxyCodeLine{1419     \textcolor{keywordflow}{if} (cs\%log\_to\_stdout) \textcolor{keyword}{write}(cs\%stdout,\textcolor{stringliteral}{'(a)'}) trim(mesg)}
\DoxyCodeLine{1420 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1421 }
\DoxyCodeLine{1422   myunits=\textcolor{stringliteral}{"not defined"}; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(units)) \textcolor{keyword}{write}(myunits(1:240),\textcolor{stringliteral}{'(A)'}) trim(units)}
\DoxyCodeLine{1423   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(desc)) \&}
\DoxyCodeLine{1424     \textcolor{keyword}{call }doc\_param(cs\%doc, varname, desc, myunits, \textcolor{keywordtype}{value}, default, \&}
\DoxyCodeLine{1425                    debuggingparam=debuggingparam, like\_default=like\_default)}
\DoxyCodeLine{1426 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_ae26a3a3f39d3ef66de55aea6ac27a681}\label{namespacemom__file__parser_ae26a3a3f39d3ef66de55aea6ac27a681}} 
\index{mom\_file\_parser@{mom\_file\_parser}!log\_param\_time@{log\_param\_time}}
\index{log\_param\_time@{log\_param\_time}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{log\_param\_time()}{log\_param\_time()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::log\+\_\+param\+\_\+time (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{modulename,  }\item[{character(len=$\ast$), intent(in)}]{varname,  }\item[{type(time\+\_\+type), intent(in)}]{value,  }\item[{character(len=$\ast$), intent(in), optional}]{desc,  }\item[{character(len=$\ast$), intent(in), optional}]{units,  }\item[{type(time\+\_\+type), intent(in), optional}]{default,  }\item[{real, intent(in), optional}]{timeunit,  }\item[{logical, intent(in), optional}]{layout\+Param,  }\item[{logical, intent(in), optional}]{debugging\+Param,  }\item[{logical, intent(in), optional}]{log\+\_\+date,  }\item[{logical, intent(in), optional}]{like\+\_\+default }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine writes the value of a time-\/type parameter to a log file, along with its name and the module it came from. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em modulename} & The name of the calling module \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The name of the parameter to log \\
\hline
\mbox{\texttt{ in}}  & {\em value} & The value of the parameter to log \\
\hline
\mbox{\texttt{ in}}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file \\
\hline
\mbox{\texttt{ in}}  & {\em units} & The units of this parameter \\
\hline
\mbox{\texttt{ in}}  & {\em default} & The default value of the parameter \\
\hline
\mbox{\texttt{ in}}  & {\em timeunit} & The number of seconds in a time unit for real-\/number output. \\
\hline
\mbox{\texttt{ in}}  & {\em log\+\_\+date} & If true, log the time\+\_\+type in date format. If missing the default is false. \\
\hline
\mbox{\texttt{ in}}  & {\em layoutparam} & If present and true, this parameter is logged in the layout parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em debuggingparam} & If present and true, this parameter is logged in the debugging parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em like\+\_\+default} & If present and true, log this parameter as though it has the default value, even if there is no default. \\
\hline
\end{DoxyParams}


Definition at line 1506 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1506   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{1507 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{1508   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: modulename\textcolor{comment}{ !< The name of the calling module}}
\DoxyCodeLine{1509   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The name of the parameter to log}}
\DoxyCodeLine{1510   \textcolor{keywordtype}{type}(time\_type),            \textcolor{keywordtype}{intent(in)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter to log}}
\DoxyCodeLine{1511   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: desc\textcolor{comment}{    !< A description of this variable; if not}}
\DoxyCodeLine{1512 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}}
\DoxyCodeLine{1513   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: units\textcolor{comment}{   !< The units of this parameter}}
\DoxyCodeLine{1514   \textcolor{keywordtype}{type}(time\_type),  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: default\textcolor{comment}{ !< The default value of the parameter}}
\DoxyCodeLine{1515 \textcolor{keywordtype}{  real},             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: timeunit\textcolor{comment}{ !< The number of seconds in a time unit for}}
\DoxyCodeLine{1516 \textcolor{comment}{                                         !! real-\/number output.}}
\DoxyCodeLine{1517   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: log\_date\textcolor{comment}{   !< If true, log the time\_type in date format.}}
\DoxyCodeLine{1518 \textcolor{comment}{                                         !! If missing the default is false.}}
\DoxyCodeLine{1519   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: layoutParam\textcolor{comment}{ !< If present and true, this parameter is}}
\DoxyCodeLine{1520 \textcolor{comment}{                                         !! logged in the layout parameter file}}
\DoxyCodeLine{1521   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}}
\DoxyCodeLine{1522 \textcolor{comment}{                                         !! logged in the debugging parameter file}}
\DoxyCodeLine{1523   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: like\_default\textcolor{comment}{ !< If present and true, log this parameter as}}
\DoxyCodeLine{1524 \textcolor{comment}{                                         !! though it has the default value, even if there is no default.}}
\DoxyCodeLine{1525 }
\DoxyCodeLine{1526   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{1527 \textcolor{keywordtype}{  real} :: real\_time, real\_default}
\DoxyCodeLine{1528   \textcolor{keywordtype}{logical} :: use\_timeunit, date\_format}
\DoxyCodeLine{1529   \textcolor{keywordtype}{character(len=240)} :: mesg, myunits}
\DoxyCodeLine{1530   \textcolor{keywordtype}{character(len=80)} :: date\_string, default\_string}
\DoxyCodeLine{1531   \textcolor{keywordtype}{integer} :: days, secs, ticks, ticks\_per\_sec}
\DoxyCodeLine{1532 }
\DoxyCodeLine{1533   use\_timeunit = .false.}
\DoxyCodeLine{1534   date\_format = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(log\_date)) date\_format = log\_date}
\DoxyCodeLine{1535 }
\DoxyCodeLine{1536   \textcolor{keyword}{call }get\_time(\textcolor{keywordtype}{value}, secs, days, ticks)}
\DoxyCodeLine{1537 }
\DoxyCodeLine{1538   \textcolor{keywordflow}{if} (ticks == 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1539     \textcolor{keyword}{write}(mesg, \textcolor{stringliteral}{'("  ",a," ",a," (Time): ",i0,":",i0)'}) trim(modulename), \&}
\DoxyCodeLine{1540        trim(varname), days, secs}
\DoxyCodeLine{1541   \textcolor{keywordflow}{else}}
\DoxyCodeLine{1542     \textcolor{keyword}{write}(mesg, \textcolor{stringliteral}{'("  ",a," ",a," (Time): ",i0,":",i0,":",i0)'}) trim(modulename), \&}
\DoxyCodeLine{1543        trim(varname), days, secs, ticks}
\DoxyCodeLine{1544 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1545   \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1546     \textcolor{keywordflow}{if} (cs\%log\_open) \textcolor{keyword}{write}(cs\%stdlog,\textcolor{stringliteral}{'(a)'}) trim(mesg)}
\DoxyCodeLine{1547     \textcolor{keywordflow}{if} (cs\%log\_to\_stdout) \textcolor{keyword}{write}(cs\%stdout,\textcolor{stringliteral}{'(a)'}) trim(mesg)}
\DoxyCodeLine{1548 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1549 }
\DoxyCodeLine{1550   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(desc)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1551     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(timeunit)) use\_timeunit = (timeunit > 0.0)}
\DoxyCodeLine{1552     \textcolor{keywordflow}{if} (date\_format) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1553       myunits=\textcolor{stringliteral}{'[date]'}}
\DoxyCodeLine{1554 }
\DoxyCodeLine{1555       date\_string = convert\_date\_to\_string(\textcolor{keywordtype}{value})}
\DoxyCodeLine{1556       \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1557         default\_string = convert\_date\_to\_string(default)}
\DoxyCodeLine{1558         \textcolor{keyword}{call }doc\_param(cs\%doc, varname, desc, myunits, date\_string, \&}
\DoxyCodeLine{1559                        default=default\_string, layoutparam=layoutparam, \&}
\DoxyCodeLine{1560                        debuggingparam=debuggingparam, like\_default=like\_default)}
\DoxyCodeLine{1561       \textcolor{keywordflow}{else}}
\DoxyCodeLine{1562         \textcolor{keyword}{call }doc\_param(cs\%doc, varname, desc, myunits, date\_string, \&}
\DoxyCodeLine{1563                        layoutparam=layoutparam, debuggingparam=debuggingparam, like\_default=like\_default)}
\DoxyCodeLine{1564 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{1565     \textcolor{keywordflow}{elseif} (use\_timeunit) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1566       \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(units)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1567         \textcolor{keyword}{write}(myunits(1:240),\textcolor{stringliteral}{'(A)'}) trim(units)}
\DoxyCodeLine{1568       \textcolor{keywordflow}{else}}
\DoxyCodeLine{1569         \textcolor{keywordflow}{if} (abs(timeunit-\/1.0) < 0.01) \textcolor{keywordflow}{then} ; myunits = \textcolor{stringliteral}{"seconds"}}
\DoxyCodeLine{1570         \textcolor{keywordflow}{elseif} (abs(timeunit-\/3600.0) < 1.0) \textcolor{keywordflow}{then} ; myunits = \textcolor{stringliteral}{"hours"}}
\DoxyCodeLine{1571         \textcolor{keywordflow}{elseif} (abs(timeunit-\/86400.0) < 1.0) \textcolor{keywordflow}{then} ; myunits = \textcolor{stringliteral}{"days"}}
\DoxyCodeLine{1572         \textcolor{keywordflow}{elseif} (abs(timeunit-\/3.1e7) < 1.0e6) \textcolor{keywordflow}{then} ; myunits = \textcolor{stringliteral}{"years"}}
\DoxyCodeLine{1573         \textcolor{keywordflow}{else} ; \textcolor{keyword}{write}(myunits,\textcolor{stringliteral}{'(es8.2," sec")'}) timeunit ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{1574 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{1575       real\_time = (86400.0/timeunit)*days + secs/timeunit}
\DoxyCodeLine{1576       \textcolor{keywordflow}{if} (ticks > 0) real\_time = real\_time + \&}
\DoxyCodeLine{1577 \textcolor{keywordtype}{                           real}(ticks) / (timeunit*get\_ticks\_per\_second())}
\DoxyCodeLine{1578       \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1579         \textcolor{keyword}{call }get\_time(default, secs, days, ticks)}
\DoxyCodeLine{1580         real\_default = (86400.0/timeunit)*days + secs/timeunit}
\DoxyCodeLine{1581         \textcolor{keywordflow}{if} (ticks > 0) real\_default = real\_default + \&}
\DoxyCodeLine{1582 \textcolor{keywordtype}{                           real}(ticks) / (timeunit*get\_ticks\_per\_second())}
\DoxyCodeLine{1583         \textcolor{keyword}{call }doc\_param(cs\%doc, varname, desc, myunits, real\_time, real\_default, like\_default=like\_default)}
\DoxyCodeLine{1584       \textcolor{keywordflow}{else}}
\DoxyCodeLine{1585         \textcolor{keyword}{call }doc\_param(cs\%doc, varname, desc, myunits, real\_time, like\_default=like\_default)}
\DoxyCodeLine{1586 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{1587     \textcolor{keywordflow}{else}}
\DoxyCodeLine{1588       \textcolor{keyword}{call }doc\_param(cs\%doc, varname, desc, \textcolor{keywordtype}{value}, default, units=units, like\_default=like\_default)}
\DoxyCodeLine{1589 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1590 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1591 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a639194f100f2bb42379a1dd84bac7b47}\label{namespacemom__file__parser_a639194f100f2bb42379a1dd84bac7b47}} 
\index{mom\_file\_parser@{mom\_file\_parser}!log\_version\_cs@{log\_version\_cs}}
\index{log\_version\_cs@{log\_version\_cs}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{log\_version\_cs()}{log\_version\_cs()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::log\+\_\+version\+\_\+cs (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{modulename,  }\item[{character(len=$\ast$), intent(in)}]{version,  }\item[{character(len=$\ast$), intent(in), optional}]{desc,  }\item[{logical, intent(in), optional}]{log\+\_\+to\+\_\+all,  }\item[{logical, intent(in), optional}]{all\+\_\+default,  }\item[{logical, intent(in), optional}]{layout,  }\item[{logical, intent(in), optional}]{debugging }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Log the version of a module to a log file and/or stdout, and/or to the parameter documentation file. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & File parser type \\
\hline
\mbox{\texttt{ in}}  & {\em modulename} & Name of calling module \\
\hline
\mbox{\texttt{ in}}  & {\em version} & Version string of module \\
\hline
\mbox{\texttt{ in}}  & {\em desc} & Module description \\
\hline
\mbox{\texttt{ in}}  & {\em log\+\_\+to\+\_\+all} & If present and true, log this parameter to the ...\+\_\+doc.\+all files, even if this module also has layout or debugging parameters. \\
\hline
\mbox{\texttt{ in}}  & {\em all\+\_\+default} & If true, all parameters take their default values. \\
\hline
\mbox{\texttt{ in}}  & {\em layout} & If present and true, this module has layout parameters. \\
\hline
\mbox{\texttt{ in}}  & {\em debugging} & If present and true, this module has debugging parameters. \\
\hline
\end{DoxyParams}


Definition at line 1253 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1253   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{         !< File parser type}}
\DoxyCodeLine{1254   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: modulename\textcolor{comment}{ !< Name of calling module}}
\DoxyCodeLine{1255   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: version\textcolor{comment}{    !< Version string of module}}
\DoxyCodeLine{1256   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: desc\textcolor{comment}{       !< Module description}}
\DoxyCodeLine{1257   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: log\_to\_all\textcolor{comment}{ !< If present and true, log this parameter to the}}
\DoxyCodeLine{1258 \textcolor{comment}{                                                       !! ...\_doc.all files, even if this module also has layout}}
\DoxyCodeLine{1259 \textcolor{comment}{                                                       !! or debugging parameters.}}
\DoxyCodeLine{1260   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: all\_default\textcolor{comment}{ !< If true, all parameters take their default values.}}
\DoxyCodeLine{1261   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: layout\textcolor{comment}{     !< If present and true, this module has layout parameters.}}
\DoxyCodeLine{1262   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: debugging\textcolor{comment}{  !< If present and true, this module has debugging parameters.}}
\DoxyCodeLine{1263   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{1264   \textcolor{keywordtype}{character(len=240)} :: mesg}
\DoxyCodeLine{1265 }
\DoxyCodeLine{1266   mesg = trim(modulename)//\textcolor{stringliteral}{": "}//trim(version)}
\DoxyCodeLine{1267   \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1268     \textcolor{keywordflow}{if} (cs\%log\_open) \textcolor{keyword}{write}(cs\%stdlog,\textcolor{stringliteral}{'(a)'}) trim(mesg)}
\DoxyCodeLine{1269     \textcolor{keywordflow}{if} (cs\%log\_to\_stdout) \textcolor{keyword}{write}(cs\%stdout,\textcolor{stringliteral}{'(a)'}) trim(mesg)}
\DoxyCodeLine{1270 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1271 }
\DoxyCodeLine{1272   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(desc)) \textcolor{keyword}{call }doc\_module(cs\%doc, modulename, desc, log\_to\_all, all\_default, layout, debugging)}
\DoxyCodeLine{1273 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_aae4fde48d1b45f8afdd1131a637eb356}\label{namespacemom__file__parser_aae4fde48d1b45f8afdd1131a637eb356}} 
\index{mom\_file\_parser@{mom\_file\_parser}!log\_version\_plain@{log\_version\_plain}}
\index{log\_version\_plain@{log\_version\_plain}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{log\_version\_plain()}{log\_version\_plain()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::log\+\_\+version\+\_\+plain (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{modulename,  }\item[{character(len=$\ast$), intent(in)}]{version }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Log the version of a module to a log file and/or stdout. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em modulename} & Name of calling module \\
\hline
\mbox{\texttt{ in}}  & {\em version} & Version string of module \\
\hline
\end{DoxyParams}


Definition at line 1278 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1278   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: modulename\textcolor{comment}{ !< Name of calling module}}
\DoxyCodeLine{1279   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: version\textcolor{comment}{    !< Version string of module}}
\DoxyCodeLine{1280   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{1281   \textcolor{keywordtype}{character(len=240)} :: mesg}
\DoxyCodeLine{1282 }
\DoxyCodeLine{1283   mesg = trim(modulename)//\textcolor{stringliteral}{": "}//trim(version)}
\DoxyCodeLine{1284   \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1285     \textcolor{keyword}{write}(stdlog(),\textcolor{stringliteral}{'(a)'}) trim(mesg)}
\DoxyCodeLine{1286 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{1287 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_abecae1b9386aafa17aec927af1f8c448}\label{namespacemom__file__parser_abecae1b9386aafa17aec927af1f8c448}} 
\index{mom\_file\_parser@{mom\_file\_parser}!open\_param\_file@{open\_param\_file}}
\index{open\_param\_file@{open\_param\_file}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{open\_param\_file()}{open\_param\_file()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+file\+\_\+parser\+::open\+\_\+param\+\_\+file (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{filename,  }\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(inout)}]{CS,  }\item[{logical, intent(in), optional}]{checkable,  }\item[{character(len=$\ast$), intent(in), optional}]{component,  }\item[{character(len=$\ast$), intent(in), optional}]{doc\+\_\+file\+\_\+dir }\end{DoxyParamCaption})}



Make the contents of a parameter input file availalble in a \mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em filename} & An input file name, optionally with the full path \\
\hline
\mbox{\texttt{ in,out}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em checkable} & If this is false, it disables checks of this file for unused parameters. The default is True. \\
\hline
\mbox{\texttt{ in}}  & {\em component} & If present, this component name is used to generate parameter documentation file names; the default is\char`\"{}\+M\+O\+M\char`\"{} \\
\hline
\mbox{\texttt{ in}}  & {\em doc\+\_\+file\+\_\+dir} & An optional directory in which to write out the documentation files. The default is effectively \textquotesingle{}./\textquotesingle{}. \\
\hline
\end{DoxyParams}


Definition at line 117 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{117   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: filename\textcolor{comment}{ !< An input file name, optionally with the full path}}
\DoxyCodeLine{118   \textcolor{keywordtype}{type}(param\_file\_type),   \textcolor{keywordtype}{intent(inout)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{119 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{120   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: checkable\textcolor{comment}{   !< If this is false, it disables checks of this}}
\DoxyCodeLine{121 \textcolor{comment}{                                         !! file for unused parameters.  The default is True.}}
\DoxyCodeLine{122   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: component\textcolor{comment}{   !< If present, this component name is used}}
\DoxyCodeLine{123 \textcolor{comment}{                                         !! to generate parameter documentation file names; the default is"MOM"}}
\DoxyCodeLine{124   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: doc\_file\_dir\textcolor{comment}{ !< An optional directory in which to write out}}
\DoxyCodeLine{125 \textcolor{comment}{                                         !! the documentation files.  The default is effectively './'.}}
\DoxyCodeLine{126 }
\DoxyCodeLine{127   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{128   \textcolor{keywordtype}{logical} :: file\_exists, unit\_in\_use, Netcdf\_file, may\_check}
\DoxyCodeLine{129   \textcolor{keywordtype}{integer} :: ios, iounit, strlen, i}
\DoxyCodeLine{130   \textcolor{keywordtype}{character(len=240)} :: doc\_path}
\DoxyCodeLine{131   \textcolor{keywordtype}{type}(parameter\_block), \textcolor{keywordtype}{pointer} :: block => null()}
\DoxyCodeLine{132 }
\DoxyCodeLine{133   may\_check = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(checkable)) may\_check = checkable}
\DoxyCodeLine{134 }
\DoxyCodeLine{135   \textcolor{comment}{! Check for non-\/blank filename}}
\DoxyCodeLine{136   strlen = len\_trim(filename)}
\DoxyCodeLine{137   \textcolor{keywordflow}{if} (strlen == 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{138     \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"open\_param\_file: Input file has not been specified."})}
\DoxyCodeLine{139 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{140 }
\DoxyCodeLine{141   \textcolor{comment}{! Check that this file has not already been opened}}
\DoxyCodeLine{142   \textcolor{keywordflow}{if} (cs\%nfiles > 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{143     \textcolor{keyword}{inquire}(file=trim(filename), number=iounit)}
\DoxyCodeLine{144     \textcolor{keywordflow}{if} (iounit /= -\/1) \textcolor{keywordflow}{then}}
\DoxyCodeLine{145       \textcolor{keywordflow}{do} i = 1, cs\%nfiles}
\DoxyCodeLine{146         \textcolor{keywordflow}{if} (cs\%iounit(i) == iounit) \textcolor{keywordflow}{then}}
\DoxyCodeLine{147           \textcolor{keywordflow}{if} (trim(cs\%filename(1)) /= trim(filename)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{148             \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{149               \textcolor{stringliteral}{"open\_param\_file: internal inconsistency! "}//trim(filename)// \&}
\DoxyCodeLine{150               \textcolor{stringliteral}{" is registered as open but has the wrong unit number!"})}
\DoxyCodeLine{151           \textcolor{keywordflow}{else}}
\DoxyCodeLine{152             \textcolor{keyword}{call }mom\_error(warning, \&}
\DoxyCodeLine{153               \textcolor{stringliteral}{"open\_param\_file: file "}//trim(filename)// \&}
\DoxyCodeLine{154               \textcolor{stringliteral}{" has already been opened. This should NOT happen!"}// \&}
\DoxyCodeLine{155               \textcolor{stringliteral}{" Did you specify the same file twice in a namelist?"})}
\DoxyCodeLine{156             \textcolor{keywordflow}{return}}
\DoxyCodeLine{157 \textcolor{keywordflow}{          endif} \textcolor{comment}{! filenames}}
\DoxyCodeLine{158 \textcolor{keywordflow}{        endif} \textcolor{comment}{! unit numbers}}
\DoxyCodeLine{159 \textcolor{keywordflow}{      enddo} \textcolor{comment}{! i}}
\DoxyCodeLine{160 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{161 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{162 }
\DoxyCodeLine{163   \textcolor{comment}{! Check that the file exists to readstdlog}}
\DoxyCodeLine{164   \textcolor{keyword}{inquire}(file=trim(filename), exist=file\_exists)}
\DoxyCodeLine{165   \textcolor{keywordflow}{if} (.not.file\_exists) \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{166       \textcolor{stringliteral}{"open\_param\_file: Input file "}// trim(filename)//\textcolor{stringliteral}{" does not exist."})}
\DoxyCodeLine{167 }
\DoxyCodeLine{168   netcdf\_file = .false.}
\DoxyCodeLine{169   \textcolor{keywordflow}{if} (strlen > 3) \textcolor{keywordflow}{then}}
\DoxyCodeLine{170     \textcolor{keywordflow}{if} (filename(strlen-\/2:strlen) == \textcolor{stringliteral}{".nc"}) netcdf\_file = .true.}
\DoxyCodeLine{171 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{172 }
\DoxyCodeLine{173   \textcolor{keywordflow}{if} (netcdf\_file) \&}
\DoxyCodeLine{174     \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"open\_param\_file: NetCDF files are not yet supported."})}
\DoxyCodeLine{175 }
\DoxyCodeLine{176   \textcolor{keywordflow}{if} (all\_pes\_read .or. is\_root\_pe()) \textcolor{keywordflow}{then}}
\DoxyCodeLine{177     \textcolor{comment}{! Find an unused unit number.}}
\DoxyCodeLine{178     \textcolor{keywordflow}{do} iounit=10,512}
\DoxyCodeLine{179       \textcolor{keyword}{INQUIRE}(iounit,opened=unit\_in\_use) ; \textcolor{keywordflow}{if} (.not.unit\_in\_use) \textcolor{keywordflow}{exit}}
\DoxyCodeLine{180 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{181     \textcolor{keywordflow}{if} (iounit >= 512) \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{182         \textcolor{stringliteral}{"open\_param\_file: No unused file unit could be found."})}
\DoxyCodeLine{183 }
\DoxyCodeLine{184     \textcolor{comment}{! Open the parameter file.}}
\DoxyCodeLine{185     \textcolor{keyword}{open}(iounit, file=trim(filename), access=\textcolor{stringliteral}{'SEQUENTIAL'}, \&}
\DoxyCodeLine{186          form=\textcolor{stringliteral}{'FORMATTED'}, action=\textcolor{stringliteral}{'READ'}, position=\textcolor{stringliteral}{'REWIND'}, iostat=ios)}
\DoxyCodeLine{187     \textcolor{keywordflow}{if} (ios /= 0) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"open\_param\_file: Error opening "}// \&}
\DoxyCodeLine{188                                        trim(filename))}
\DoxyCodeLine{189   \textcolor{keywordflow}{else}}
\DoxyCodeLine{190     iounit = 1}
\DoxyCodeLine{191 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{192 }
\DoxyCodeLine{193   \textcolor{comment}{! Store/register the unit and details}}
\DoxyCodeLine{194   i = cs\%nfiles + 1}
\DoxyCodeLine{195   cs\%nfiles = i}
\DoxyCodeLine{196   cs\%iounit(i) = iounit}
\DoxyCodeLine{197   cs\%filename(i) = filename}
\DoxyCodeLine{198   cs\%NetCDF\_file(i) = netcdf\_file}
\DoxyCodeLine{199   \textcolor{keyword}{allocate}(block) ; block\%name = \textcolor{stringliteral}{''} ; cs\%blockName => block}
\DoxyCodeLine{200 }
\DoxyCodeLine{201   \textcolor{keyword}{call }mom\_mesg(\textcolor{stringliteral}{"open\_param\_file: "}// trim(filename)// \&}
\DoxyCodeLine{202                  \textcolor{stringliteral}{" has been opened successfully."}, 5)}
\DoxyCodeLine{203 }
\DoxyCodeLine{204   \textcolor{keyword}{call }populate\_param\_data(iounit, filename, cs\%param\_data(i))}
\DoxyCodeLine{205 }
\DoxyCodeLine{206   \textcolor{keyword}{call }read\_param(cs,\textcolor{stringliteral}{"SEND\_LOG\_TO\_STDOUT"},cs\%log\_to\_stdout)}
\DoxyCodeLine{207   \textcolor{keyword}{call }read\_param(cs,\textcolor{stringliteral}{"REPORT\_UNUSED\_PARAMS"},cs\%report\_unused)}
\DoxyCodeLine{208   \textcolor{keyword}{call }read\_param(cs,\textcolor{stringliteral}{"FATAL\_UNUSED\_PARAMS"},cs\%unused\_params\_fatal)}
\DoxyCodeLine{209   cs\%doc\_file = \textcolor{stringliteral}{"MOM\_parameter\_doc"}}
\DoxyCodeLine{210   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(component)) cs\%doc\_file = trim(component)//\textcolor{stringliteral}{"\_parameter\_doc"}}
\DoxyCodeLine{211   \textcolor{keyword}{call }read\_param(cs,\textcolor{stringliteral}{"DOCUMENT\_FILE"}, cs\%doc\_file)}
\DoxyCodeLine{212   \textcolor{keywordflow}{if} (.not.may\_check) \textcolor{keywordflow}{then}}
\DoxyCodeLine{213     cs\%report\_unused = .false.}
\DoxyCodeLine{214     cs\%unused\_params\_fatal = .false.}
\DoxyCodeLine{215 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{216 }
\DoxyCodeLine{217   \textcolor{comment}{! Open the log file.}}
\DoxyCodeLine{218   cs\%stdlog = stdlog() ; cs\%stdout = stdout()}
\DoxyCodeLine{219   cs\%log\_open = (stdlog() > 0)}
\DoxyCodeLine{220 }
\DoxyCodeLine{221   doc\_path = cs\%doc\_file}
\DoxyCodeLine{222   \textcolor{keywordflow}{if} (len\_trim(cs\%doc\_file) > 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{223     cs\%complete\_doc = complete\_doc\_default}
\DoxyCodeLine{224     \textcolor{keyword}{call }read\_param(cs, \textcolor{stringliteral}{"COMPLETE\_DOCUMENTATION"}, cs\%complete\_doc)}
\DoxyCodeLine{225     cs\%minimal\_doc = minimal\_doc\_default}
\DoxyCodeLine{226     \textcolor{keyword}{call }read\_param(cs, \textcolor{stringliteral}{"MINIMAL\_DOCUMENTATION"}, cs\%minimal\_doc)}
\DoxyCodeLine{227     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(doc\_file\_dir)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (len\_trim(doc\_file\_dir) > 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{228       doc\_path = trim(slasher(doc\_file\_dir))//trim(cs\%doc\_file)}
\DoxyCodeLine{229 \textcolor{keywordflow}{    endif} ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{230   \textcolor{keywordflow}{else}}
\DoxyCodeLine{231     cs\%complete\_doc = .false.}
\DoxyCodeLine{232     cs\%minimal\_doc = .false.}
\DoxyCodeLine{233 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{234   \textcolor{keyword}{call }doc\_init(doc\_path, cs\%doc, minimal=cs\%minimal\_doc, complete=cs\%complete\_doc, \&}
\DoxyCodeLine{235                 layout=cs\%complete\_doc, debugging=cs\%complete\_doc)}
\DoxyCodeLine{236 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a476a2649ce161e38088588e07f7df130}\label{namespacemom__file__parser_a476a2649ce161e38088588e07f7df130}} 
\index{mom\_file\_parser@{mom\_file\_parser}!openmultilinecomment@{openmultilinecomment}}
\index{openmultilinecomment@{openmultilinecomment}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{openmultilinecomment()}{openmultilinecomment()}}
{\footnotesize\ttfamily logical function mom\+\_\+file\+\_\+parser\+::openmultilinecomment (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{string }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Return True if a /$\ast$ appears on this line without a closing $\ast$/. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em string} & The input string to process \\
\hline
\end{DoxyParams}


Definition at line 446 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{446   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{intent(in)} :: string\textcolor{comment}{  !< The input string to process}}
\DoxyCodeLine{447   \textcolor{keywordtype}{logical}                      :: openMultiLineComment}
\DoxyCodeLine{448 }
\DoxyCodeLine{449   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{450   \textcolor{keywordtype}{integer} :: icom, last}
\DoxyCodeLine{451 }
\DoxyCodeLine{452   openmultilinecomment = .false.}
\DoxyCodeLine{453   last = lastnoncommentindex(string)+1}
\DoxyCodeLine{454   icom = index(string(last:), \textcolor{stringliteral}{"/*"})}
\DoxyCodeLine{455   \textcolor{keywordflow}{if} (icom > 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{456     openmultilinecomment=.true.}
\DoxyCodeLine{457     last = last+icom+1}
\DoxyCodeLine{458 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{459   icom = index(string(last:), \textcolor{stringliteral}{"*/"}) ; \textcolor{keywordflow}{if} (icom > 0) openmultilinecomment=.false.}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a363628fcd8540de780ebeacf24012229}\label{namespacemom__file__parser_a363628fcd8540de780ebeacf24012229}} 
\index{mom\_file\_parser@{mom\_file\_parser}!openparameterblock@{openparameterblock}}
\index{openparameterblock@{openparameterblock}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{openparameterblock()}{openparameterblock()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+file\+\_\+parser\+::openparameterblock (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{block\+Name,  }\item[{character(len=$\ast$), intent(in), optional}]{desc }\end{DoxyParamCaption})}



Tags block\+Name onto the end of the active parameter block name. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em blockname} & The name of a parameter block being added \\
\hline
\mbox{\texttt{ in}}  & {\em desc} & A description of the parameter block being added \\
\hline
\end{DoxyParams}


Definition at line 2043 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{2043   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{2044 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{2045   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: blockName\textcolor{comment}{ !< The name of a parameter block being added}}
\DoxyCodeLine{2046   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: desc\textcolor{comment}{    !< A description of the parameter block being added}}
\DoxyCodeLine{2047 }
\DoxyCodeLine{2048   \textcolor{keywordtype}{type}(parameter\_block), \textcolor{keywordtype}{pointer} :: block => null()}
\DoxyCodeLine{2049   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs\%blockName)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{2050     block => cs\%blockName}
\DoxyCodeLine{2051     block\%name = pushblocklevel(block\%name,blockname)}
\DoxyCodeLine{2052     \textcolor{keyword}{call }doc\_openblock(cs\%doc,block\%name,desc)}
\DoxyCodeLine{2053   \textcolor{keywordflow}{else}}
\DoxyCodeLine{2054     \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{2055       \textcolor{stringliteral}{'openParameterBlock: A push was attempted before allocation.'})}
\DoxyCodeLine{2056 \textcolor{keywordflow}{  endif}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a0c9bb1e76b09bc09bae5402e63bd0f99}\label{namespacemom__file__parser_a0c9bb1e76b09bc09bae5402e63bd0f99}} 
\index{mom\_file\_parser@{mom\_file\_parser}!overridewarninghasbeenissued@{overridewarninghasbeenissued}}
\index{overridewarninghasbeenissued@{overridewarninghasbeenissued}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{overridewarninghasbeenissued()}{overridewarninghasbeenissued()}}
{\footnotesize\ttfamily logical function mom\+\_\+file\+\_\+parser\+::overridewarninghasbeenissued (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1link__parameter}{link\+\_\+parameter}}), pointer}]{chain,  }\item[{character(len=$\ast$), intent(in)}]{var\+Name }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Returns true if an override warning has been issued for the variable var\+Name. 


\begin{DoxyParams}[1]{Parameters}
 & {\em chain} & The linked list of variables that have already had override warnings issued \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The name of the variable being queried for warnings \\
\hline
\end{DoxyParams}


Definition at line 1225 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{1225   \textcolor{keywordtype}{type}(link\_parameter), \textcolor{keywordtype}{pointer}    :: chain\textcolor{comment}{   !< The linked list of variables that have already had}}
\DoxyCodeLine{1226 \textcolor{comment}{                                              !! override warnings issued}}
\DoxyCodeLine{1227   \textcolor{keywordtype}{character(len=*)},     \textcolor{keywordtype}{intent(in)} :: varName\textcolor{comment}{ !< The name of the variable being queried for warnings}}
\DoxyCodeLine{1228   \textcolor{keywordtype}{logical}                          :: overrideWarningHasBeenIssued}
\DoxyCodeLine{1229   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{1230   \textcolor{keywordtype}{type}(link\_parameter), \textcolor{keywordtype}{pointer} :: newLink => null(), this => null()}
\DoxyCodeLine{1231 }
\DoxyCodeLine{1232   overridewarninghasbeenissued = .false.}
\DoxyCodeLine{1233   this => chain}
\DoxyCodeLine{1234   \textcolor{keywordflow}{do} \textcolor{keywordflow}{while}( \textcolor{keyword}{associated}(this) )}
\DoxyCodeLine{1235     \textcolor{keywordflow}{if} (trim(varname) == trim(this\%name)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{1236       overridewarninghasbeenissued = .true.}
\DoxyCodeLine{1237       \textcolor{keywordflow}{return}}
\DoxyCodeLine{1238 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{1239     this => this\%next}
\DoxyCodeLine{1240 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{1241   \textcolor{keyword}{allocate}(newlink)}
\DoxyCodeLine{1242   newlink\%name = trim(varname)}
\DoxyCodeLine{1243   newlink\%hasIssuedOverrideWarning = .true.}
\DoxyCodeLine{1244   newlink\%next => chain}
\DoxyCodeLine{1245   chain => newlink}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a73b11b969d303b1fc0ba5235c812fd05}\label{namespacemom__file__parser_a73b11b969d303b1fc0ba5235c812fd05}} 
\index{mom\_file\_parser@{mom\_file\_parser}!popblocklevel@{popblocklevel}}
\index{popblocklevel@{popblocklevel}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{popblocklevel()}{popblocklevel()}}
{\footnotesize\ttfamily character(len=len(oldblockname)+40) function mom\+\_\+file\+\_\+parser\+::popblocklevel (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{oldblock\+Name }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Truncates block name (shallower level of parameter block) 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em oldblockname} & A sequence of hierarchical parameter block names \\
\hline
\end{DoxyParams}


Definition at line 2094 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{2094   \textcolor{keywordtype}{character(len=*)},        \textcolor{keywordtype}{intent(in)} :: oldBlockName\textcolor{comment}{ !< A sequence of hierarchical parameter block names}}
\DoxyCodeLine{2095   \textcolor{keywordtype}{character(len=len(oldBlockName)+40)} :: popBlockLevel}
\DoxyCodeLine{2096 }
\DoxyCodeLine{2097   \textcolor{keywordtype}{integer} :: i}
\DoxyCodeLine{2098   i = index(trim(oldblockname), \textcolor{stringliteral}{'\%'}, .true.)}
\DoxyCodeLine{2099   \textcolor{keywordflow}{if} (i>1) \textcolor{keywordflow}{then}}
\DoxyCodeLine{2100     popblocklevel = trim(oldblockname(1:i-\/1))}
\DoxyCodeLine{2101   \textcolor{keywordflow}{elseif} (i==0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{2102     popblocklevel = \textcolor{stringliteral}{''}}
\DoxyCodeLine{2103   \textcolor{keywordflow}{else} \textcolor{comment}{! i==1}}
\DoxyCodeLine{2104     \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{2105       \textcolor{stringliteral}{'popBlockLevel: A pop was attempted leaving an empty block name.'})}
\DoxyCodeLine{2106 \textcolor{keywordflow}{  endif}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a7abfd98d7f0831fc0d1f3747a68f1be9}\label{namespacemom__file__parser_a7abfd98d7f0831fc0d1f3747a68f1be9}} 
\index{mom\_file\_parser@{mom\_file\_parser}!populate\_param\_data@{populate\_param\_data}}
\index{populate\_param\_data@{populate\_param\_data}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{populate\_param\_data()}{populate\_param\_data()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::populate\+\_\+param\+\_\+data (\begin{DoxyParamCaption}\item[{integer, intent(in)}]{iounit,  }\item[{character(len=$\ast$), intent(in)}]{filename,  }\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1file__data__type}{file\+\_\+data\+\_\+type}}), intent(inout)}]{param\+\_\+data }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Read the contents of a parameter input file, and store the contents in a \mbox{\hyperlink{structmom__file__parser_1_1file__data__type}{file\+\_\+data\+\_\+type}} after removing comments and simplifying white space. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em iounit} & The IO unit number that is open for filename \\
\hline
\mbox{\texttt{ in}}  & {\em filename} & An input file name, optionally with the full path \\
\hline
\mbox{\texttt{ in,out}}  & {\em param\+\_\+data} & A list of the input lines that set parameters after comments have been stripped out. \\
\hline
\end{DoxyParams}


Definition at line 347 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{347   \textcolor{keywordtype}{integer},                 \textcolor{keywordtype}{intent(in)} :: iounit\textcolor{comment}{ !< The IO unit number that is open for filename}}
\DoxyCodeLine{348   \textcolor{keywordtype}{character(len=*)},        \textcolor{keywordtype}{intent(in)} :: filename\textcolor{comment}{ !< An input file name, optionally with the full path}}
\DoxyCodeLine{349   \textcolor{keywordtype}{type}(file\_data\_type), \textcolor{keywordtype}{intent(inout)} :: param\_data\textcolor{comment}{ !< A list of the input lines that set parameters}}
\DoxyCodeLine{350 \textcolor{comment}{                                                !! after comments have been stripped out.}}
\DoxyCodeLine{351 }
\DoxyCodeLine{352   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{353   \textcolor{keywordtype}{character(len=INPUT\_STR\_LENGTH)} :: line}
\DoxyCodeLine{354   \textcolor{keywordtype}{integer} :: num\_lines}
\DoxyCodeLine{355   \textcolor{keywordtype}{logical} :: inMultiLineComment}
\DoxyCodeLine{356 }
\DoxyCodeLine{357   \textcolor{comment}{! Find the number of keyword lines in a parameter file}}
\DoxyCodeLine{358   \textcolor{comment}{! Allocate the space to hold the lines in param\_data\%line}}
\DoxyCodeLine{359   \textcolor{comment}{! Populate param\_data\%line with the keyword lines from parameter file}}
\DoxyCodeLine{360 }
\DoxyCodeLine{361   \textcolor{keywordflow}{if} (iounit <= 0) \textcolor{keywordflow}{return}}
\DoxyCodeLine{362 }
\DoxyCodeLine{363   \textcolor{keywordflow}{if} (all\_pes\_read .or. is\_root\_pe()) \textcolor{keywordflow}{then}}
\DoxyCodeLine{364     \textcolor{comment}{! rewind the parameter file}}
\DoxyCodeLine{365     rewind(iounit)}
\DoxyCodeLine{366 }
\DoxyCodeLine{367     \textcolor{comment}{! count the number of valid entries in the parameter file}}
\DoxyCodeLine{368     num\_lines = 0}
\DoxyCodeLine{369     inmultilinecomment = .false.}
\DoxyCodeLine{370     \textcolor{keywordflow}{do} \textcolor{keywordflow}{while}(.true.)}
\DoxyCodeLine{371       \textcolor{keyword}{read}(iounit, \textcolor{stringliteral}{'(a)'}, \textcolor{keyword}{end}=8, err=9) line}
\DoxyCodeLine{372       line = replacetabs(line)}
\DoxyCodeLine{373       \textcolor{keywordflow}{if} (inmultilinecomment) \textcolor{keywordflow}{then}}
\DoxyCodeLine{374         \textcolor{keywordflow}{if} (closemultilinecomment(line)) inmultilinecomment=.false.}
\DoxyCodeLine{375       \textcolor{keywordflow}{else}}
\DoxyCodeLine{376         \textcolor{keywordflow}{if} (lastnoncommentnonblank(line)>0) num\_lines = num\_lines + 1}
\DoxyCodeLine{377         \textcolor{keywordflow}{if} (openmultilinecomment(line)) inmultilinecomment=.true.}
\DoxyCodeLine{378 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{379 \textcolor{keywordflow}{    enddo} \textcolor{comment}{! while (.true.)}}
\DoxyCodeLine{380  8  \textcolor{keywordflow}{continue} \textcolor{comment}{! get here when read() reaches EOF}}
\DoxyCodeLine{381 }
\DoxyCodeLine{382     \textcolor{keywordflow}{if} (inmultilinecomment .and. is\_root\_pe()) \&}
\DoxyCodeLine{383       \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{'MOM\_file\_parser : A C-\/style multi-\/line comment '}// \&}
\DoxyCodeLine{384                       \textcolor{stringliteral}{'(/* ... */) was not closed before the end of '}//trim(filename))}
\DoxyCodeLine{385 }
\DoxyCodeLine{386     \textcolor{comment}{! allocate space to hold contents of the parameter file}}
\DoxyCodeLine{387     param\_data\%num\_lines = num\_lines}
\DoxyCodeLine{388 \textcolor{keywordflow}{  endif}  \textcolor{comment}{! (is\_root\_pe())}}
\DoxyCodeLine{389 }
\DoxyCodeLine{390   \textcolor{comment}{! Broadcast the number of valid entries in parameter file}}
\DoxyCodeLine{391   \textcolor{keywordflow}{if} (.not. all\_pes\_read) \textcolor{keywordflow}{then}}
\DoxyCodeLine{392     \textcolor{keyword}{call }broadcast(param\_data\%num\_lines, root\_pe())}
\DoxyCodeLine{393 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{394 }
\DoxyCodeLine{395   \textcolor{comment}{! Set up the space for storing the actual lines.}}
\DoxyCodeLine{396   num\_lines = param\_data\%num\_lines}
\DoxyCodeLine{397   \textcolor{keyword}{allocate} (param\_data\%line(num\_lines))}
\DoxyCodeLine{398   \textcolor{keyword}{allocate} (param\_data\%line\_used(num\_lines))}
\DoxyCodeLine{399   param\_data\%line(:) = \textcolor{stringliteral}{' '}}
\DoxyCodeLine{400   param\_data\%line\_used(:) = .false.}
\DoxyCodeLine{401 }
\DoxyCodeLine{402   \textcolor{comment}{! Read the actual lines.}}
\DoxyCodeLine{403   \textcolor{keywordflow}{if} (all\_pes\_read .or. is\_root\_pe()) \textcolor{keywordflow}{then}}
\DoxyCodeLine{404     \textcolor{comment}{! rewind the parameter file}}
\DoxyCodeLine{405     rewind(iounit)}
\DoxyCodeLine{406 }
\DoxyCodeLine{407     \textcolor{comment}{! Populate param\_data\%line}}
\DoxyCodeLine{408     num\_lines = 0}
\DoxyCodeLine{409     \textcolor{keywordflow}{do} \textcolor{keywordflow}{while}(.true.)}
\DoxyCodeLine{410       \textcolor{keyword}{read}(iounit, \textcolor{stringliteral}{'(a)'}, \textcolor{keyword}{end}=18, err=9) line}
\DoxyCodeLine{411       line = replacetabs(line)}
\DoxyCodeLine{412       \textcolor{keywordflow}{if} (inmultilinecomment) \textcolor{keywordflow}{then}}
\DoxyCodeLine{413         \textcolor{keywordflow}{if} (closemultilinecomment(line)) inmultilinecomment=.false.}
\DoxyCodeLine{414       \textcolor{keywordflow}{else}}
\DoxyCodeLine{415         \textcolor{keywordflow}{if} (lastnoncommentnonblank(line)>0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{416           line = removecomments(line)}
\DoxyCodeLine{417           line = simplifywhitespace(line(:len\_trim(line)))}
\DoxyCodeLine{418           num\_lines = num\_lines + 1}
\DoxyCodeLine{419           param\_data\%line(num\_lines) = line}
\DoxyCodeLine{420 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{421         \textcolor{keywordflow}{if} (openmultilinecomment(line)) inmultilinecomment=.true.}
\DoxyCodeLine{422 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{423 \textcolor{keywordflow}{    enddo} \textcolor{comment}{! while (.true.)}}
\DoxyCodeLine{424 18  \textcolor{keywordflow}{continue} \textcolor{comment}{! get here when read() reaches EOF}}
\DoxyCodeLine{425 }
\DoxyCodeLine{426     \textcolor{keywordflow}{if} (num\_lines /= param\_data\%num\_lines) \&}
\DoxyCodeLine{427       \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{'MOM\_file\_parser : Found different number of '}// \&}
\DoxyCodeLine{428                       \textcolor{stringliteral}{'valid lines on second reading of '}//trim(filename))}
\DoxyCodeLine{429 \textcolor{keywordflow}{  endif}  \textcolor{comment}{! (is\_root\_pe())}}
\DoxyCodeLine{430 }
\DoxyCodeLine{431   \textcolor{comment}{! Broadcast the populated array param\_data\%line}}
\DoxyCodeLine{432   \textcolor{keywordflow}{if} (.not. all\_pes\_read) \textcolor{keywordflow}{then}}
\DoxyCodeLine{433     \textcolor{keyword}{call }broadcast(param\_data\%line, input\_str\_length, root\_pe())}
\DoxyCodeLine{434 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{435 }
\DoxyCodeLine{436   \textcolor{keywordflow}{return}}
\DoxyCodeLine{437 }
\DoxyCodeLine{438 9 \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"MOM\_file\_parser : "}//\&}
\DoxyCodeLine{439                   \textcolor{stringliteral}{"Error while reading file "}//trim(filename))}
\DoxyCodeLine{440 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a58777b0faf747d59a793b4e238919dc6}\label{namespacemom__file__parser_a58777b0faf747d59a793b4e238919dc6}} 
\index{mom\_file\_parser@{mom\_file\_parser}!pushblocklevel@{pushblocklevel}}
\index{pushblocklevel@{pushblocklevel}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{pushblocklevel()}{pushblocklevel()}}
{\footnotesize\ttfamily character(len=len(oldblockname)+40) function mom\+\_\+file\+\_\+parser\+::pushblocklevel (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{oldblock\+Name,  }\item[{character(len=$\ast$), intent(in)}]{new\+Block\+Name }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Extends block name (deeper level of parameter block) 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em oldblockname} & A sequence of hierarchical parameter block names \\
\hline
\mbox{\texttt{ in}}  & {\em newblockname} & A new block name to add to the end of the sequence \\
\hline
\end{DoxyParams}


Definition at line 2081 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{2081   \textcolor{keywordtype}{character(len=*)},        \textcolor{keywordtype}{intent(in)} :: oldBlockName\textcolor{comment}{  !< A sequence of hierarchical parameter block names}}
\DoxyCodeLine{2082   \textcolor{keywordtype}{character(len=*)},        \textcolor{keywordtype}{intent(in)} :: newBlockName\textcolor{comment}{  !< A new block name to add to the end of the sequence}}
\DoxyCodeLine{2083   \textcolor{keywordtype}{character(len=len(oldBlockName)+40)} :: pushBlockLevel}
\DoxyCodeLine{2084 }
\DoxyCodeLine{2085   \textcolor{keywordflow}{if} (len\_trim(oldblockname)>0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{2086     pushblocklevel=trim(oldblockname)//\textcolor{stringliteral}{'\%'}//trim(newblockname)}
\DoxyCodeLine{2087   \textcolor{keywordflow}{else}}
\DoxyCodeLine{2088     pushblocklevel=trim(newblockname)}
\DoxyCodeLine{2089 \textcolor{keywordflow}{  endif}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a14c84db15e417656105f7303ad0ac2a2}\label{namespacemom__file__parser_a14c84db15e417656105f7303ad0ac2a2}} 
\index{mom\_file\_parser@{mom\_file\_parser}!read\_param\_char@{read\_param\_char}}
\index{read\_param\_char@{read\_param\_char}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{read\_param\_char()}{read\_param\_char()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::read\+\_\+param\+\_\+char (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{varname,  }\item[{character(len=$\ast$), intent(inout)}]{value,  }\item[{logical, intent(in), optional}]{fail\+\_\+if\+\_\+missing }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine reads the value of a character string model parameter from a parameter file. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The case-\/sensitive name of the parameter to read \\
\hline
\mbox{\texttt{ in,out}}  & {\em value} & The value of the parameter that may be read from the parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em fail\+\_\+if\+\_\+missing} & If present and true, a fatal error occurs if this variable is not found in the parameter file \\
\hline
\end{DoxyParams}


Definition at line 720 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{720   \textcolor{keywordtype}{type}(param\_file\_type),  \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{721 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{722   \textcolor{keywordtype}{character(len=*)},       \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The case-\/sensitive name of the parameter to read}}
\DoxyCodeLine{723   \textcolor{keywordtype}{character(len=*)},    \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}}
\DoxyCodeLine{724 \textcolor{comment}{                                         !! read from the parameter file}}
\DoxyCodeLine{725   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}}
\DoxyCodeLine{726 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}}
\DoxyCodeLine{727   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{728   \textcolor{keywordtype}{character(len=INPUT\_STR\_LENGTH)} :: value\_string(1)}
\DoxyCodeLine{729   \textcolor{keywordtype}{logical}            :: found, defined}
\DoxyCodeLine{730 }
\DoxyCodeLine{731   \textcolor{keyword}{call }get\_variable\_line(cs, varname, found, defined, value\_string)}
\DoxyCodeLine{732   \textcolor{keywordflow}{if} (found) \textcolor{keywordflow}{then}}
\DoxyCodeLine{733     \textcolor{keywordtype}{value} = trim(strip\_quotes(value\_string(1)))}
\DoxyCodeLine{734   \textcolor{keywordflow}{elseif} (\textcolor{keyword}{present}(fail\_if\_missing)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (fail\_if\_missing) \textcolor{keywordflow}{then}}
\DoxyCodeLine{735     \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'Unable to find variable '}//trim(varname)// \&}
\DoxyCodeLine{736                          \textcolor{stringliteral}{' in any input files.'})}
\DoxyCodeLine{737 \textcolor{keywordflow}{  endif} ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{738 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a67808253e247b2542d0810e7c7f598f4}\label{namespacemom__file__parser_a67808253e247b2542d0810e7c7f598f4}} 
\index{mom\_file\_parser@{mom\_file\_parser}!read\_param\_char\_array@{read\_param\_char\_array}}
\index{read\_param\_char\_array@{read\_param\_char\_array}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{read\_param\_char\_array()}{read\_param\_char\_array()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::read\+\_\+param\+\_\+char\+\_\+array (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{varname,  }\item[{character(len=$\ast$), dimension(\+:), intent(inout)}]{value,  }\item[{logical, intent(in), optional}]{fail\+\_\+if\+\_\+missing }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine reads the values of an array of character string model parameters from a parameter file. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The case-\/sensitive name of the parameter to read \\
\hline
\mbox{\texttt{ in,out}}  & {\em value} & The value of the parameter that may be read from the parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em fail\+\_\+if\+\_\+missing} & If present and true, a fatal error occurs if this variable is not found in the parameter file \\
\hline
\end{DoxyParams}


Definition at line 743 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{743   \textcolor{keywordtype}{type}(param\_file\_type),  \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{744 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{745   \textcolor{keywordtype}{character(len=*)},       \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The case-\/sensitive name of the parameter to read}}
\DoxyCodeLine{746   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}}
\DoxyCodeLine{747 \textcolor{comment}{                                         !! read from the parameter file}}
\DoxyCodeLine{748   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}}
\DoxyCodeLine{749 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}}
\DoxyCodeLine{750 }
\DoxyCodeLine{751   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{752   \textcolor{keywordtype}{character(len=INPUT\_STR\_LENGTH)} :: value\_string(1), loc\_string}
\DoxyCodeLine{753   \textcolor{keywordtype}{logical}            :: found, defined}
\DoxyCodeLine{754   \textcolor{keywordtype}{integer}            :: i, i\_out}
\DoxyCodeLine{755 }
\DoxyCodeLine{756   \textcolor{keyword}{call }get\_variable\_line(cs, varname, found, defined, value\_string)}
\DoxyCodeLine{757   \textcolor{keywordflow}{if} (found) \textcolor{keywordflow}{then}}
\DoxyCodeLine{758     loc\_string = trim(value\_string(1))}
\DoxyCodeLine{759     i = index(loc\_string,\textcolor{stringliteral}{","})}
\DoxyCodeLine{760     i\_out = 1}
\DoxyCodeLine{761     \textcolor{keywordflow}{do} \textcolor{keywordflow}{while}(i>0)}
\DoxyCodeLine{762       value(i\_out) = trim(strip\_quotes(loc\_string(:i-\/1)))}
\DoxyCodeLine{763       i\_out = i\_out+1}
\DoxyCodeLine{764       loc\_string = trim(adjustl(loc\_string(i+1:)))}
\DoxyCodeLine{765       i = index(loc\_string,\textcolor{stringliteral}{","})}
\DoxyCodeLine{766 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{767     \textcolor{keywordflow}{if} (len\_trim(loc\_string)>0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{768       value(i\_out) = trim(strip\_quotes(adjustl(loc\_string)))}
\DoxyCodeLine{769       i\_out = i\_out+1}
\DoxyCodeLine{770 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{771     \textcolor{keywordflow}{do} i=i\_out,\textcolor{keyword}{SIZE}(\textcolor{keywordtype}{value}) ; value(i) = \textcolor{stringliteral}{" "} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{772   \textcolor{keywordflow}{elseif} (\textcolor{keyword}{present}(fail\_if\_missing)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (fail\_if\_missing) \textcolor{keywordflow}{then}}
\DoxyCodeLine{773     \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'Unable to find variable '}//trim(varname)// \&}
\DoxyCodeLine{774                          \textcolor{stringliteral}{' in any input files.'})}
\DoxyCodeLine{775 \textcolor{keywordflow}{  endif} ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{776 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a28352549cebdb1f8ed8db3655258d502}\label{namespacemom__file__parser_a28352549cebdb1f8ed8db3655258d502}} 
\index{mom\_file\_parser@{mom\_file\_parser}!read\_param\_int@{read\_param\_int}}
\index{read\_param\_int@{read\_param\_int}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{read\_param\_int()}{read\_param\_int()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::read\+\_\+param\+\_\+int (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{varname,  }\item[{integer, intent(inout)}]{value,  }\item[{logical, intent(in), optional}]{fail\+\_\+if\+\_\+missing }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine reads the value of an integer model parameter from a parameter file. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The case-\/sensitive name of the parameter to read \\
\hline
\mbox{\texttt{ in,out}}  & {\em value} & The value of the parameter that may be read from the parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em fail\+\_\+if\+\_\+missing} & If present and true, a fatal error occurs if this variable is not found in the parameter file \\
\hline
\end{DoxyParams}


Definition at line 581 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{581   \textcolor{keywordtype}{type}(param\_file\_type),  \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{582 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{583   \textcolor{keywordtype}{character(len=*)},       \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The case-\/sensitive name of the parameter to read}}
\DoxyCodeLine{584   \textcolor{keywordtype}{integer},             \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}}
\DoxyCodeLine{585 \textcolor{comment}{                                         !! read from the parameter file}}
\DoxyCodeLine{586   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}}
\DoxyCodeLine{587 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}}
\DoxyCodeLine{588   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{589   \textcolor{keywordtype}{character(len=INPUT\_STR\_LENGTH)} :: value\_string(1)}
\DoxyCodeLine{590   \textcolor{keywordtype}{logical}            :: found, defined}
\DoxyCodeLine{591 }
\DoxyCodeLine{592   \textcolor{keyword}{call }get\_variable\_line(cs, varname, found, defined, value\_string)}
\DoxyCodeLine{593   \textcolor{keywordflow}{if} (found .and. defined .and. (len\_trim(value\_string(1)) > 0)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{594     \textcolor{keyword}{read}(value\_string(1),*,err = 1001) \textcolor{keywordtype}{value}}
\DoxyCodeLine{595   \textcolor{keywordflow}{else}}
\DoxyCodeLine{596     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(fail\_if\_missing)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (fail\_if\_missing) \textcolor{keywordflow}{then}}
\DoxyCodeLine{597       \textcolor{keywordflow}{if} (.not.found) \textcolor{keywordflow}{then}}
\DoxyCodeLine{598         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_int: Unable to find variable '}//trim(varname)// \&}
\DoxyCodeLine{599                              \textcolor{stringliteral}{' in any input files.'})}
\DoxyCodeLine{600       \textcolor{keywordflow}{else}}
\DoxyCodeLine{601         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_int: Variable '}//trim(varname)// \&}
\DoxyCodeLine{602                              \textcolor{stringliteral}{' found but not set in input files.'})}
\DoxyCodeLine{603 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{604 \textcolor{keywordflow}{    endif} ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{605 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{606   \textcolor{keywordflow}{return}}
\DoxyCodeLine{607  1001 \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_int: read error for integer variable '}//trim(varname)// \&}
\DoxyCodeLine{608                              \textcolor{stringliteral}{' parsing "'}//trim(value\_string(1))//\textcolor{stringliteral}{'"'})}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a9f3cacd113743a19df607293b6c30ec7}\label{namespacemom__file__parser_a9f3cacd113743a19df607293b6c30ec7}} 
\index{mom\_file\_parser@{mom\_file\_parser}!read\_param\_int\_array@{read\_param\_int\_array}}
\index{read\_param\_int\_array@{read\_param\_int\_array}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{read\_param\_int\_array()}{read\_param\_int\_array()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::read\+\_\+param\+\_\+int\+\_\+array (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{varname,  }\item[{integer, dimension(\+:), intent(inout)}]{value,  }\item[{logical, intent(in), optional}]{fail\+\_\+if\+\_\+missing }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine reads the values of an array of integer model parameters from a parameter file. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The case-\/sensitive name of the parameter to read \\
\hline
\mbox{\texttt{ in,out}}  & {\em value} & The value of the parameter that may be read from the parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em fail\+\_\+if\+\_\+missing} & If present and true, a fatal error occurs if this variable is not found in the parameter file \\
\hline
\end{DoxyParams}


Definition at line 613 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{613   \textcolor{keywordtype}{type}(param\_file\_type),  \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{614 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{615   \textcolor{keywordtype}{character(len=*)},       \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The case-\/sensitive name of the parameter to read}}
\DoxyCodeLine{616   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{dimension(:)},  \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}}
\DoxyCodeLine{617 \textcolor{comment}{                                         !! read from the parameter file}}
\DoxyCodeLine{618   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}}
\DoxyCodeLine{619 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}}
\DoxyCodeLine{620   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{621   \textcolor{keywordtype}{character(len=INPUT\_STR\_LENGTH)} :: value\_string(1)}
\DoxyCodeLine{622   \textcolor{keywordtype}{logical}            :: found, defined}
\DoxyCodeLine{623 }
\DoxyCodeLine{624   \textcolor{keyword}{call }get\_variable\_line(cs, varname, found, defined, value\_string)}
\DoxyCodeLine{625   \textcolor{keywordflow}{if} (found .and. defined .and. (len\_trim(value\_string(1)) > 0)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{626     \textcolor{keyword}{read}(value\_string(1),*,\textcolor{keyword}{end}=991,err=1002) value}
\DoxyCodeLine{627  991 \textcolor{keywordflow}{return}}
\DoxyCodeLine{628   \textcolor{keywordflow}{else}}
\DoxyCodeLine{629     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(fail\_if\_missing)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (fail\_if\_missing) \textcolor{keywordflow}{then}}
\DoxyCodeLine{630       \textcolor{keywordflow}{if} (.not.found) \textcolor{keywordflow}{then}}
\DoxyCodeLine{631         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_int\_array: Unable to find variable '}//trim(varname)// \&}
\DoxyCodeLine{632                              \textcolor{stringliteral}{' in any input files.'})}
\DoxyCodeLine{633       \textcolor{keywordflow}{else}}
\DoxyCodeLine{634         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_int\_array: Variable '}//trim(varname)// \&}
\DoxyCodeLine{635                              \textcolor{stringliteral}{' found but not set in input files.'})}
\DoxyCodeLine{636 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{637 \textcolor{keywordflow}{    endif} ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{638 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{639   \textcolor{keywordflow}{return}}
\DoxyCodeLine{640  1002 \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_int\_array: read error for integer array '}//trim(varname)// \&}
\DoxyCodeLine{641                              \textcolor{stringliteral}{' parsing "'}//trim(value\_string(1))//\textcolor{stringliteral}{'"'})}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_ae12cfb8a4de90b0454683ba5810c79a2}\label{namespacemom__file__parser_ae12cfb8a4de90b0454683ba5810c79a2}} 
\index{mom\_file\_parser@{mom\_file\_parser}!read\_param\_logical@{read\_param\_logical}}
\index{read\_param\_logical@{read\_param\_logical}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{read\_param\_logical()}{read\_param\_logical()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::read\+\_\+param\+\_\+logical (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{varname,  }\item[{logical, intent(inout)}]{value,  }\item[{logical, intent(in), optional}]{fail\+\_\+if\+\_\+missing }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine reads the value of a logical model parameter from a parameter file. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The case-\/sensitive name of the parameter to read \\
\hline
\mbox{\texttt{ in,out}}  & {\em value} & The value of the parameter that may be read from the parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em fail\+\_\+if\+\_\+missing} & If present and true, a fatal error occurs if this variable is not found in the parameter file \\
\hline
\end{DoxyParams}


Definition at line 781 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{781   \textcolor{keywordtype}{type}(param\_file\_type),  \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{782 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{783   \textcolor{keywordtype}{character(len=*)},       \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The case-\/sensitive name of the parameter to read}}
\DoxyCodeLine{784   \textcolor{keywordtype}{logical},             \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}}
\DoxyCodeLine{785 \textcolor{comment}{                                         !! read from the parameter file}}
\DoxyCodeLine{786   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}}
\DoxyCodeLine{787 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}}
\DoxyCodeLine{788 }
\DoxyCodeLine{789   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{790   \textcolor{keywordtype}{character(len=INPUT\_STR\_LENGTH)} :: value\_string(1)}
\DoxyCodeLine{791   \textcolor{keywordtype}{logical}            :: found, defined}
\DoxyCodeLine{792 }
\DoxyCodeLine{793   \textcolor{keyword}{call }get\_variable\_line(cs, varname, found, defined, value\_string, paramislogical=.true.)}
\DoxyCodeLine{794   \textcolor{keywordflow}{if} (found) \textcolor{keywordflow}{then}}
\DoxyCodeLine{795     \textcolor{keywordtype}{value} = defined}
\DoxyCodeLine{796   \textcolor{keywordflow}{elseif} (\textcolor{keyword}{present}(fail\_if\_missing)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (fail\_if\_missing) \textcolor{keywordflow}{then}}
\DoxyCodeLine{797     \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'Unable to find variable '}//trim(varname)// \&}
\DoxyCodeLine{798                          \textcolor{stringliteral}{' in any input files.'})}
\DoxyCodeLine{799 \textcolor{keywordflow}{  endif} ;\textcolor{keywordflow}{ endif}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a95b28c92ef3603d3fb20b0a6d133d4ad}\label{namespacemom__file__parser_a95b28c92ef3603d3fb20b0a6d133d4ad}} 
\index{mom\_file\_parser@{mom\_file\_parser}!read\_param\_real@{read\_param\_real}}
\index{read\_param\_real@{read\_param\_real}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{read\_param\_real()}{read\_param\_real()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::read\+\_\+param\+\_\+real (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{varname,  }\item[{real, intent(inout)}]{value,  }\item[{logical, intent(in), optional}]{fail\+\_\+if\+\_\+missing,  }\item[{real, intent(in), optional}]{scale }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine reads the value of a real model parameter from a parameter file. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The case-\/sensitive name of the parameter to read \\
\hline
\mbox{\texttt{ in,out}}  & {\em value} & The value of the parameter that may be read from the parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em fail\+\_\+if\+\_\+missing} & If present and true, a fatal error occurs if this variable is not found in the parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em scale} & A scaling factor that the parameter is multiplied by before it is returned. \\
\hline
\end{DoxyParams}


Definition at line 646 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{646   \textcolor{keywordtype}{type}(param\_file\_type), \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{647 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{648   \textcolor{keywordtype}{character(len=*)},      \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The case-\/sensitive name of the parameter to read}}
\DoxyCodeLine{649 \textcolor{keywordtype}{  real},               \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}}
\DoxyCodeLine{650 \textcolor{comment}{                                         !! read from the parameter file}}
\DoxyCodeLine{651   \textcolor{keywordtype}{logical},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}}
\DoxyCodeLine{652 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}}
\DoxyCodeLine{653 \textcolor{keywordtype}{  real},        \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: scale\textcolor{comment}{   !< A scaling factor that the parameter is multiplied}}
\DoxyCodeLine{654 \textcolor{comment}{                                         !! by before it is returned.}}
\DoxyCodeLine{655 }
\DoxyCodeLine{656   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{657   \textcolor{keywordtype}{character(len=INPUT\_STR\_LENGTH)} :: value\_string(1)}
\DoxyCodeLine{658   \textcolor{keywordtype}{logical}            :: found, defined}
\DoxyCodeLine{659 }
\DoxyCodeLine{660   \textcolor{keyword}{call }get\_variable\_line(cs, varname, found, defined, value\_string)}
\DoxyCodeLine{661   \textcolor{keywordflow}{if} (found .and. defined .and. (len\_trim(value\_string(1)) > 0)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{662     \textcolor{keyword}{read}(value\_string(1),*,err=1003) \textcolor{keywordtype}{value}}
\DoxyCodeLine{663     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) \textcolor{keywordtype}{value} = scale*\textcolor{keywordtype}{value}}
\DoxyCodeLine{664   \textcolor{keywordflow}{else}}
\DoxyCodeLine{665     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(fail\_if\_missing)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (fail\_if\_missing) \textcolor{keywordflow}{then}}
\DoxyCodeLine{666       \textcolor{keywordflow}{if} (.not.found) \textcolor{keywordflow}{then}}
\DoxyCodeLine{667         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_real: Unable to find variable '}//trim(varname)// \&}
\DoxyCodeLine{668                              \textcolor{stringliteral}{' in any input files.'})}
\DoxyCodeLine{669       \textcolor{keywordflow}{else}}
\DoxyCodeLine{670         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_real: Variable '}//trim(varname)// \&}
\DoxyCodeLine{671                              \textcolor{stringliteral}{' found but not set in input files.'})}
\DoxyCodeLine{672 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{673 \textcolor{keywordflow}{    endif} ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{674 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{675   \textcolor{keywordflow}{return}}
\DoxyCodeLine{676  1003 \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_real: read error for real variable '}//trim(varname)// \&}
\DoxyCodeLine{677                              \textcolor{stringliteral}{' parsing "'}//trim(value\_string(1))//\textcolor{stringliteral}{'"'})}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_ae85623b4210b35c5e583d48ff536d596}\label{namespacemom__file__parser_ae85623b4210b35c5e583d48ff536d596}} 
\index{mom\_file\_parser@{mom\_file\_parser}!read\_param\_real\_array@{read\_param\_real\_array}}
\index{read\_param\_real\_array@{read\_param\_real\_array}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{read\_param\_real\_array()}{read\_param\_real\_array()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::read\+\_\+param\+\_\+real\+\_\+array (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{varname,  }\item[{real, dimension(\+:), intent(inout)}]{value,  }\item[{logical, intent(in), optional}]{fail\+\_\+if\+\_\+missing,  }\item[{real, intent(in), optional}]{scale }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine reads the values of an array of real model parameters from a parameter file. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The case-\/sensitive name of the parameter to read \\
\hline
\mbox{\texttt{ in,out}}  & {\em value} & The value of the parameter that may be read from the parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em fail\+\_\+if\+\_\+missing} & If present and true, a fatal error occurs if this variable is not found in the parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em scale} & A scaling factor that the parameter is multiplied by before it is returned. \\
\hline
\end{DoxyParams}


Definition at line 682 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{682   \textcolor{keywordtype}{type}(param\_file\_type), \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{683 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{684   \textcolor{keywordtype}{character(len=*)},      \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The case-\/sensitive name of the parameter to read}}
\DoxyCodeLine{685 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}}
\DoxyCodeLine{686 \textcolor{comment}{                                         !! read from the parameter file}}
\DoxyCodeLine{687   \textcolor{keywordtype}{logical},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}}
\DoxyCodeLine{688 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}}
\DoxyCodeLine{689 \textcolor{keywordtype}{  real},        \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: scale\textcolor{comment}{   !< A scaling factor that the parameter is multiplied}}
\DoxyCodeLine{690 \textcolor{comment}{                                         !! by before it is returned.}}
\DoxyCodeLine{691 }
\DoxyCodeLine{692   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{693   \textcolor{keywordtype}{character(len=INPUT\_STR\_LENGTH)} :: value\_string(1)}
\DoxyCodeLine{694   \textcolor{keywordtype}{logical}                         :: found, defined}
\DoxyCodeLine{695 }
\DoxyCodeLine{696   \textcolor{keyword}{call }get\_variable\_line(cs, varname, found, defined, value\_string)}
\DoxyCodeLine{697   \textcolor{keywordflow}{if} (found .and. defined .and. (len\_trim(value\_string(1)) > 0)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{698     \textcolor{keyword}{read}(value\_string(1),*,\textcolor{keyword}{end}=991,err=1004) value}
\DoxyCodeLine{699 991 \textcolor{keywordflow}{continue}}
\DoxyCodeLine{700     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) value(:) = scale*value(:)}
\DoxyCodeLine{701     \textcolor{keywordflow}{return}}
\DoxyCodeLine{702   \textcolor{keywordflow}{else}}
\DoxyCodeLine{703     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(fail\_if\_missing)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (fail\_if\_missing) \textcolor{keywordflow}{then}}
\DoxyCodeLine{704       \textcolor{keywordflow}{if} (.not.found) \textcolor{keywordflow}{then}}
\DoxyCodeLine{705         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_real\_array: Unable to find variable '}//trim(varname)// \&}
\DoxyCodeLine{706                              \textcolor{stringliteral}{' in any input files.'})}
\DoxyCodeLine{707       \textcolor{keywordflow}{else}}
\DoxyCodeLine{708         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_real\_array: Variable '}//trim(varname)// \&}
\DoxyCodeLine{709                              \textcolor{stringliteral}{' found but not set in input files.'})}
\DoxyCodeLine{710 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{711 \textcolor{keywordflow}{    endif} ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{712 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{713   \textcolor{keywordflow}{return}}
\DoxyCodeLine{714  1004 \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_real\_array: read error for real array '}//trim(varname)// \&}
\DoxyCodeLine{715                              \textcolor{stringliteral}{' parsing "'}//trim(value\_string(1))//\textcolor{stringliteral}{'"'})}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a799f1d8af038c5a64b7496018f03b590}\label{namespacemom__file__parser_a799f1d8af038c5a64b7496018f03b590}} 
\index{mom\_file\_parser@{mom\_file\_parser}!read\_param\_time@{read\_param\_time}}
\index{read\_param\_time@{read\_param\_time}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{read\_param\_time()}{read\_param\_time()}}
{\footnotesize\ttfamily subroutine mom\+\_\+file\+\_\+parser\+::read\+\_\+param\+\_\+time (\begin{DoxyParamCaption}\item[{type(\mbox{\hyperlink{structmom__file__parser_1_1param__file__type}{param\+\_\+file\+\_\+type}}), intent(in)}]{CS,  }\item[{character(len=$\ast$), intent(in)}]{varname,  }\item[{type(time\+\_\+type), intent(inout)}]{value,  }\item[{real, intent(in), optional}]{timeunit,  }\item[{logical, intent(in), optional}]{fail\+\_\+if\+\_\+missing,  }\item[{logical, intent(out), optional}]{date\+\_\+format }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This subroutine reads the value of a time\+\_\+type model parameter from a parameter file. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters \\
\hline
\mbox{\texttt{ in}}  & {\em varname} & The case-\/sensitive name of the parameter to read \\
\hline
\mbox{\texttt{ in,out}}  & {\em value} & The value of the parameter that may be read from the parameter file \\
\hline
\mbox{\texttt{ in}}  & {\em timeunit} & The number of seconds in a time unit for real-\/number input. \\
\hline
\mbox{\texttt{ in}}  & {\em fail\+\_\+if\+\_\+missing} & If present and true, a fatal error occurs if this variable is not found in the parameter file \\
\hline
\mbox{\texttt{ out}}  & {\em date\+\_\+format} & If present, this indicates whether this parameter was read in a date format, so that it can later be logged in the same format. \\
\hline
\end{DoxyParams}


Definition at line 804 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{804   \textcolor{keywordtype}{type}(param\_file\_type),  \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}}
\DoxyCodeLine{805 \textcolor{comment}{                                         !! it is also a structure to parse for run-\/time parameters}}
\DoxyCodeLine{806   \textcolor{keywordtype}{character(len=*)},       \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The case-\/sensitive name of the parameter to read}}
\DoxyCodeLine{807   \textcolor{keywordtype}{type}(time\_type),     \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}}
\DoxyCodeLine{808 \textcolor{comment}{                                         !! read from the parameter file}}
\DoxyCodeLine{809 \textcolor{keywordtype}{  real},         \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: timeunit\textcolor{comment}{ !< The number of seconds in a time unit for real-\/number input.}}
\DoxyCodeLine{810   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}}
\DoxyCodeLine{811 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}}
\DoxyCodeLine{812   \textcolor{keywordtype}{logical},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)} :: date\_format\textcolor{comment}{ !< If present, this indicates whether this}}
\DoxyCodeLine{813 \textcolor{comment}{                                         !! parameter was read in a date format, so that it can}}
\DoxyCodeLine{814 \textcolor{comment}{                                         !! later be logged in the same format.}}
\DoxyCodeLine{815 }
\DoxyCodeLine{816   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{817   \textcolor{keywordtype}{character(len=INPUT\_STR\_LENGTH)} :: value\_string(1)}
\DoxyCodeLine{818   \textcolor{keywordtype}{character(len=240)} :: err\_msg}
\DoxyCodeLine{819   \textcolor{keywordtype}{logical}            :: found, defined}
\DoxyCodeLine{820 \textcolor{keywordtype}{  real}               :: real\_time, time\_unit}
\DoxyCodeLine{821   \textcolor{keywordtype}{integer}            :: vals(7)}
\DoxyCodeLine{822 }
\DoxyCodeLine{823   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(date\_format)) date\_format = .false.}
\DoxyCodeLine{824 }
\DoxyCodeLine{825   \textcolor{keyword}{call }get\_variable\_line(cs, varname, found, defined, value\_string)}
\DoxyCodeLine{826   \textcolor{keywordflow}{if} (found .and. defined .and. (len\_trim(value\_string(1)) > 0)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{827     \textcolor{comment}{! Determine whether value string should be parsed for a real number}}
\DoxyCodeLine{828     \textcolor{comment}{! or a date, in either a string format or a comma-\/delimited list of values.}}
\DoxyCodeLine{829     \textcolor{keywordflow}{if} ((index(value\_string(1),\textcolor{stringliteral}{'-\/'}) > 0) .and. \&}
\DoxyCodeLine{830         (index(value\_string(1),\textcolor{stringliteral}{'-\/'},back=.true.) > index(value\_string(1),\textcolor{stringliteral}{'-\/'}))) \textcolor{keywordflow}{then}}
\DoxyCodeLine{831       \textcolor{comment}{! There are two dashes, so this must be a date format.}}
\DoxyCodeLine{832       \textcolor{keywordtype}{value} = set\_date(value\_string(1), err\_msg=err\_msg)}
\DoxyCodeLine{833       \textcolor{keywordflow}{if} (len\_trim(err\_msg) > 0) \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_time: '}//\&}
\DoxyCodeLine{834           trim(err\_msg)//\textcolor{stringliteral}{' in integer list read error for time-\/type variable '}//\&}
\DoxyCodeLine{835           trim(varname)// \textcolor{stringliteral}{' parsing "'}//trim(value\_string(1))//\textcolor{stringliteral}{'"'})}
\DoxyCodeLine{836       \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(date\_format)) date\_format = .true.}
\DoxyCodeLine{837     \textcolor{keywordflow}{elseif} (index(value\_string(1),\textcolor{stringliteral}{','}) > 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{838       \textcolor{comment}{! Initialize vals with an invalid date.}}
\DoxyCodeLine{839       vals(:) = (/ -\/999, -\/999, -\/999, 0, 0, 0, 0 /)}
\DoxyCodeLine{840       \textcolor{keyword}{read}(value\_string(1),*,\textcolor{keyword}{end}=995,err=1005) vals}
\DoxyCodeLine{841      995 \textcolor{keywordflow}{continue}}
\DoxyCodeLine{842       \textcolor{keywordflow}{if} ((vals(1) < 0) .or. (vals(2) < 0) .or. (vals(3) < 0)) \&}
\DoxyCodeLine{843         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_time: integer list read error for time-\/type variable '}//\&}
\DoxyCodeLine{844                        trim(varname)// \textcolor{stringliteral}{' parsing "'}//trim(value\_string(1))//\textcolor{stringliteral}{'"'})}
\DoxyCodeLine{845       \textcolor{keywordtype}{value} = set\_date(vals(1), vals(2), vals(3), vals(4), vals(5), vals(6), \&}
\DoxyCodeLine{846                        vals(7), err\_msg=err\_msg)}
\DoxyCodeLine{847       \textcolor{keywordflow}{if} (len\_trim(err\_msg) > 0) \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_time: '}//\&}
\DoxyCodeLine{848           trim(err\_msg)//\textcolor{stringliteral}{' in integer list read error for time-\/type variable '}//\&}
\DoxyCodeLine{849           trim(varname)// \textcolor{stringliteral}{' parsing "'}//trim(value\_string(1))//\textcolor{stringliteral}{'"'})}
\DoxyCodeLine{850       \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(date\_format)) date\_format = .true.}
\DoxyCodeLine{851     \textcolor{keywordflow}{else}}
\DoxyCodeLine{852       time\_unit = 1.0 ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(timeunit)) time\_unit = timeunit}
\DoxyCodeLine{853       \textcolor{keyword}{read}( value\_string(1), *) real\_time}
\DoxyCodeLine{854       \textcolor{keywordtype}{value} = real\_to\_time(real\_time*time\_unit)}
\DoxyCodeLine{855 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{856   \textcolor{keywordflow}{else}}
\DoxyCodeLine{857     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(fail\_if\_missing)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (fail\_if\_missing) \textcolor{keywordflow}{then}}
\DoxyCodeLine{858       \textcolor{keywordflow}{if} (.not.found) \textcolor{keywordflow}{then}}
\DoxyCodeLine{859         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'Unable to find variable '}//trim(varname)// \&}
\DoxyCodeLine{860                              \textcolor{stringliteral}{' in any input files.'})}
\DoxyCodeLine{861       \textcolor{keywordflow}{else}}
\DoxyCodeLine{862         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'Variable '}//trim(varname)// \&}
\DoxyCodeLine{863                              \textcolor{stringliteral}{' found but not set in input files.'})}
\DoxyCodeLine{864 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{865 \textcolor{keywordflow}{    endif} ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{866 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{867   \textcolor{keywordflow}{return}}
\DoxyCodeLine{868  1005 \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_time: read error for time-\/type variable '}//\&}
\DoxyCodeLine{869                            trim(varname)// \textcolor{stringliteral}{' parsing "'}//trim(value\_string(1))//\textcolor{stringliteral}{'"'})}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_ae0b982cc161173a401291757a6677373}\label{namespacemom__file__parser_ae0b982cc161173a401291757a6677373}} 
\index{mom\_file\_parser@{mom\_file\_parser}!removecomments@{removecomments}}
\index{removecomments@{removecomments}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{removecomments()}{removecomments()}}
{\footnotesize\ttfamily character(len=len(string)) function mom\+\_\+file\+\_\+parser\+::removecomments (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{string }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Trims comments and leading blanks from string. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em string} & The input string to process \\
\hline
\end{DoxyParams}


Definition at line 514 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{514   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{intent(in)} :: string\textcolor{comment}{  !< The input string to process}}
\DoxyCodeLine{515   \textcolor{keywordtype}{character(len=len(string))}   :: removeComments}
\DoxyCodeLine{516 }
\DoxyCodeLine{517   \textcolor{keywordtype}{integer} :: last}
\DoxyCodeLine{518 }
\DoxyCodeLine{519   removecomments=repeat(\textcolor{stringliteral}{" "},len(string))}
\DoxyCodeLine{520   last = lastnoncommentnonblank(string)}
\DoxyCodeLine{521   removecomments(:last)=adjustl(string(:last)) \textcolor{comment}{! Copy only the non-\/comment part of string}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a9813087789e0924f363d7f67768c7f42}\label{namespacemom__file__parser_a9813087789e0924f363d7f67768c7f42}} 
\index{mom\_file\_parser@{mom\_file\_parser}!replacetabs@{replacetabs}}
\index{replacetabs@{replacetabs}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{replacetabs()}{replacetabs()}}
{\footnotesize\ttfamily character(len=len(string)) function mom\+\_\+file\+\_\+parser\+::replacetabs (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{string }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Returns a string with tabs replaced by a blank. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em string} & The input string to process \\
\hline
\end{DoxyParams}


Definition at line 498 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{498   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{intent(in)} :: string\textcolor{comment}{  !< The input string to process}}
\DoxyCodeLine{499   \textcolor{keywordtype}{character(len=len(string))}   :: replaceTabs}
\DoxyCodeLine{500 }
\DoxyCodeLine{501   \textcolor{keywordtype}{integer} :: i}
\DoxyCodeLine{502 }
\DoxyCodeLine{503   \textcolor{keywordflow}{do} i=1, len(string)}
\DoxyCodeLine{504     \textcolor{keywordflow}{if} (string(i:i)==achar(9)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{505       replacetabs(i:i)=\textcolor{stringliteral}{" "}}
\DoxyCodeLine{506     \textcolor{keywordflow}{else}}
\DoxyCodeLine{507       replacetabs(i:i)=string(i:i)}
\DoxyCodeLine{508 \textcolor{keywordflow}{    endif}}
\DoxyCodeLine{509 \textcolor{keywordflow}{  enddo}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a3ad322925f44e8cb48c4e652634f6f93}\label{namespacemom__file__parser_a3ad322925f44e8cb48c4e652634f6f93}} 
\index{mom\_file\_parser@{mom\_file\_parser}!simplifywhitespace@{simplifywhitespace}}
\index{simplifywhitespace@{simplifywhitespace}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{simplifywhitespace()}{simplifywhitespace()}}
{\footnotesize\ttfamily character(len=len(string)+16) function mom\+\_\+file\+\_\+parser\+::simplifywhitespace (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{string }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Constructs a string with all repeated whitespace replaced with single blanks and insert white space where it helps delineate tokens (e.\+g. around =) 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em string} & A string to modify to simpify white space \\
\hline
\end{DoxyParams}


Definition at line 527 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{527   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{intent(in)} :: string\textcolor{comment}{ !< A string to modify to simpify white space}}
\DoxyCodeLine{528   \textcolor{keywordtype}{character(len=len(string)+16)}   :: simplifyWhiteSpace}
\DoxyCodeLine{529 }
\DoxyCodeLine{530   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{531   \textcolor{keywordtype}{integer} :: i,j}
\DoxyCodeLine{532   \textcolor{keywordtype}{logical} :: nonBlank = .false., insidestring = .false.}
\DoxyCodeLine{533   \textcolor{keywordtype}{character(len=1)} :: quoteChar=\textcolor{stringliteral}{" "}}
\DoxyCodeLine{534 }
\DoxyCodeLine{535   nonblank  = .false.; insidestring = .false. \textcolor{comment}{! NOTE: For some reason this line is needed??}}
\DoxyCodeLine{536   i=0}
\DoxyCodeLine{537   simplifywhitespace=repeat(\textcolor{stringliteral}{" "},len(string)+16)}
\DoxyCodeLine{538   \textcolor{keywordflow}{do} j=1,len\_trim(string)}
\DoxyCodeLine{539     \textcolor{keywordflow}{if} (insidestring) \textcolor{keywordflow}{then} \textcolor{comment}{! Do not change formatting inside strings}}
\DoxyCodeLine{540       i=i+1}
\DoxyCodeLine{541       simplifywhitespace(i:i)=string(j:j)}
\DoxyCodeLine{542       \textcolor{keywordflow}{if} (string(j:j)==quotechar) insidestring=.false. \textcolor{comment}{! End of string}}
\DoxyCodeLine{543     \textcolor{keywordflow}{else} \textcolor{comment}{! The following is outside of string delimiters}}
\DoxyCodeLine{544       \textcolor{keywordflow}{if} (string(j:j)==\textcolor{stringliteral}{" "} .or. string(j:j)==achar(9)) \textcolor{keywordflow}{then} \textcolor{comment}{! Space or tab}}
\DoxyCodeLine{545         \textcolor{keywordflow}{if} (nonblank) \textcolor{keywordflow}{then} \textcolor{comment}{! Only copy a blank if the preceeding character was non-\/blank}}
\DoxyCodeLine{546           i=i+1}
\DoxyCodeLine{547           simplifywhitespace(i:i)=\textcolor{stringliteral}{" "} \textcolor{comment}{! Not string(j:j) so that tabs are replace by blanks}}
\DoxyCodeLine{548           nonblank=.false.}
\DoxyCodeLine{549 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{550       \textcolor{keywordflow}{elseif} (string(j:j)==\textcolor{stringliteral}{'"'} .or. string(j:j)==\textcolor{stringliteral}{"'"}) \textcolor{keywordflow}{then} \textcolor{comment}{! Start a sting}}
\DoxyCodeLine{551         i=i+1}
\DoxyCodeLine{552         simplifywhitespace(i:i)=string(j:j)}
\DoxyCodeLine{553         insidestring=.true.}
\DoxyCodeLine{554         quotechar=string(j:j) \textcolor{comment}{! Keep copy of starting quote}}
\DoxyCodeLine{555         nonblank=.true.       \textcolor{comment}{! For exit from string}}
\DoxyCodeLine{556       \textcolor{keywordflow}{elseif} (string(j:j)==\textcolor{stringliteral}{'='}) \textcolor{keywordflow}{then}}
\DoxyCodeLine{557         \textcolor{comment}{! Insert spaces if this character is "=" so that line contains " = "}}
\DoxyCodeLine{558         \textcolor{keywordflow}{if} (nonblank) \textcolor{keywordflow}{then}}
\DoxyCodeLine{559           i=i+1}
\DoxyCodeLine{560           simplifywhitespace(i:i)=\textcolor{stringliteral}{" "}}
\DoxyCodeLine{561 \textcolor{keywordflow}{        endif}}
\DoxyCodeLine{562         i=i+2}
\DoxyCodeLine{563         simplifywhitespace(i-\/1:i)=string(j:j)//\textcolor{stringliteral}{" "}}
\DoxyCodeLine{564         nonblank=.false.}
\DoxyCodeLine{565       \textcolor{keywordflow}{else} \textcolor{comment}{! All other characters}}
\DoxyCodeLine{566         i=i+1}
\DoxyCodeLine{567         simplifywhitespace(i:i)=string(j:j)}
\DoxyCodeLine{568         nonblank=.true.}
\DoxyCodeLine{569 \textcolor{keywordflow}{      endif}}
\DoxyCodeLine{570 \textcolor{keywordflow}{    endif} \textcolor{comment}{! if (insideString)}}
\DoxyCodeLine{571 \textcolor{keywordflow}{  enddo} \textcolor{comment}{! j}}
\DoxyCodeLine{572   \textcolor{keywordflow}{if} (insidestring) \textcolor{keywordflow}{then} \textcolor{comment}{! A missing close quote should be flagged}}
\DoxyCodeLine{573     \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keyword}{call }mom\_error(fatal, \&}
\DoxyCodeLine{574       \textcolor{stringliteral}{"There is a mismatched quote in the parameter file line: "}// \&}
\DoxyCodeLine{575       trim(string))}
\DoxyCodeLine{576 \textcolor{keywordflow}{  endif}}

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__file__parser_a416b4a2a5b52f526ad1815f3e5a4739e}\label{namespacemom__file__parser_a416b4a2a5b52f526ad1815f3e5a4739e}} 
\index{mom\_file\_parser@{mom\_file\_parser}!strip\_quotes@{strip\_quotes}}
\index{strip\_quotes@{strip\_quotes}!mom\_file\_parser@{mom\_file\_parser}}
\doxysubsubsection{\texorpdfstring{strip\_quotes()}{strip\_quotes()}}
{\footnotesize\ttfamily character(len=\mbox{\hyperlink{namespacemom__file__parser_ac514a928716bf54e5bd4b64afd024274}{input\+\_\+str\+\_\+length}}) function mom\+\_\+file\+\_\+parser\+::strip\+\_\+quotes (\begin{DoxyParamCaption}\item[{character(len=$\ast$)}]{val\+\_\+str }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This function removes single and double quotes from a character string. 


\begin{DoxyParams}{Parameters}
{\em val\+\_\+str} & The character string to work on \\
\hline
\end{DoxyParams}


Definition at line 874 of file M\+O\+M\+\_\+file\+\_\+parser.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{874   \textcolor{keywordtype}{character(len=*)} :: val\_str\textcolor{comment}{ !< The character string to work on}}
\DoxyCodeLine{875   \textcolor{keywordtype}{character(len=INPUT\_STR\_LENGTH)} :: strip\_quotes}
\DoxyCodeLine{876   \textcolor{comment}{! Local variables}}
\DoxyCodeLine{877   \textcolor{keywordtype}{integer} :: i}
\DoxyCodeLine{878   strip\_quotes = val\_str}
\DoxyCodeLine{879   i = index(strip\_quotes,achar(34)) \textcolor{comment}{! Double quote}}
\DoxyCodeLine{880   \textcolor{keywordflow}{do} \textcolor{keywordflow}{while} (i>0)}
\DoxyCodeLine{881     \textcolor{keywordflow}{if} (i > 1) \textcolor{keywordflow}{then} ; strip\_quotes = strip\_quotes(:i-\/1)//strip\_quotes(i+1:)}
\DoxyCodeLine{882     \textcolor{keywordflow}{else} ; strip\_quotes = strip\_quotes(2:) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{883     i = index(strip\_quotes,achar(34)) \textcolor{comment}{! Double quote}}
\DoxyCodeLine{884 \textcolor{keywordflow}{  enddo}}
\DoxyCodeLine{885   i = index(strip\_quotes,achar(39)) \textcolor{comment}{! Single quote}}
\DoxyCodeLine{886   \textcolor{keywordflow}{do} \textcolor{keywordflow}{while} (i>0)}
\DoxyCodeLine{887     \textcolor{keywordflow}{if} (i > 1) \textcolor{keywordflow}{then} ; strip\_quotes = strip\_quotes(:i-\/1)//strip\_quotes(i+1:)}
\DoxyCodeLine{888     \textcolor{keywordflow}{else} ; strip\_quotes = strip\_quotes(2:) ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{889     i = index(strip\_quotes,achar(39)) \textcolor{comment}{! Single quote}}
\DoxyCodeLine{890 \textcolor{keywordflow}{  enddo}}

\end{DoxyCode}
