\hypertarget{namespacemom__file__parser}{}\section{mom\+\_\+file\+\_\+parser Module Reference}
\label{namespacemom__file__parser}\index{mom\+\_\+file\+\_\+parser@{mom\+\_\+file\+\_\+parser}}


\subsection{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. \subsection*{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}
\subsection*{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}
\subsection*{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}
\textbf{ }\par
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{namespacemom__file__parser_a45ab675675a03bc9e022bfa38b89d00c}\label{namespacemom__file__parser_a45ab675675a03bc9e022bfa38b89d00c}} 
logical, parameter \mbox{\hyperlink{namespacemom__file__parser_a45ab675675a03bc9e022bfa38b89d00c}{report\+\_\+unused\+\_\+default}} = .true.
\begin{DoxyCompactList}\small\item\em Default values for parameters. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__file__parser_a740ef7293c993ec21be06e6fec8379f2}\label{namespacemom__file__parser_a740ef7293c993ec21be06e6fec8379f2}} 
logical, parameter \mbox{\hyperlink{namespacemom__file__parser_a740ef7293c993ec21be06e6fec8379f2}{unused\+\_\+params\+\_\+fatal\+\_\+default}} = .false.
\begin{DoxyCompactList}\small\item\em Default values for parameters. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__file__parser_ab8b9ab6f888192d009217d47ac8dc88a}\label{namespacemom__file__parser_ab8b9ab6f888192d009217d47ac8dc88a}} 
logical, parameter \mbox{\hyperlink{namespacemom__file__parser_ab8b9ab6f888192d009217d47ac8dc88a}{log\+\_\+to\+\_\+stdout\+\_\+default}} = .false.
\begin{DoxyCompactList}\small\item\em Default values for parameters. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__file__parser_ad0623fac971ca1b244c91ee9a5e15ff8}\label{namespacemom__file__parser_ad0623fac971ca1b244c91ee9a5e15ff8}} 
logical, parameter \mbox{\hyperlink{namespacemom__file__parser_ad0623fac971ca1b244c91ee9a5e15ff8}{complete\+\_\+doc\+\_\+default}} = .true.
\begin{DoxyCompactList}\small\item\em Default values for parameters. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{namespacemom__file__parser_a2aef00270ee2e862702bb76b3d187535}\label{namespacemom__file__parser_a2aef00270ee2e862702bb76b3d187535}} 
logical, parameter \mbox{\hyperlink{namespacemom__file__parser_a2aef00270ee2e862702bb76b3d187535}{minimal\+\_\+doc\+\_\+default}} = .true.
\begin{DoxyCompactList}\small\item\em Default values for parameters. \end{DoxyCompactList}\end{DoxyCompactItemize}



\subsection{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}}
\subsubsection{\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{\tt 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}
2028   \textcolor{keywordtype}{type}(param\_file\_type), \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
2029 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
2030 
2031   \textcolor{keywordtype}{type}(parameter\_block), \textcolor{keywordtype}{pointer} :: block => null()
2032   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs%blockName)) \textcolor{keywordflow}{then}
2033     block => cs%blockName
2034     block%name = \textcolor{stringliteral}{''}
2035   \textcolor{keywordflow}{else}
2036     \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keyword}{call }mom\_error(fatal, &
2037       \textcolor{stringliteral}{'clearParameterBlock: A clear was attempted before allocation.'})
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}}
\subsubsection{\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{\tt 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{\tt in}  & {\em quiet\+\_\+close} & if present and true, do not do any logging with this call.\\
\hline
\mbox{\tt 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}
242   \textcolor{keywordtype}{type}(param\_file\_type),   \textcolor{keywordtype}{intent(inout)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
243 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
244   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: quiet\_close\textcolor{comment}{ !< if present and true, do not do any}
245 \textcolor{comment}{                                         !! logging with this call.}
246   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: component\textcolor{comment}{   !< If present, this component name is used}
247 \textcolor{comment}{                                         !! to generate parameter documentation file names}
248   \textcolor{comment}{! Local variables}
249   \textcolor{keywordtype}{logical} :: all\_default
250   \textcolor{keywordtype}{character(len=128)} :: docfile\_default
251   \textcolor{keywordtype}{character(len=40)}  :: mdl   \textcolor{comment}{! This module's name.}
252   \textcolor{comment}{! This include declares and sets the variable "version".}
253 \textcolor{preprocessor}{# include "version\_variable.h"}
254 \textcolor{preprocessor}{}  \textcolor{keywordtype}{integer} :: i, n, num\_unused
255 
256   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(quiet\_close)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (quiet\_close) \textcolor{keywordflow}{then}
257     \textcolor{keywordflow}{do} i = 1, cs%nfiles
258       \textcolor{keywordflow}{if} (all\_pes\_read .or. is\_root\_pe()) \textcolor{keyword}{close}(cs%iounit(i))
259       \textcolor{keyword}{call }mom\_mesg(\textcolor{stringliteral}{"close\_param\_file: "}// trim(cs%filename(i))// &
260                     \textcolor{stringliteral}{" has been closed successfully."}, 5)
261       cs%iounit(i) = -1
262       cs%filename(i) = \textcolor{stringliteral}{''}
263       cs%NetCDF\_file(i) = .false.
264       \textcolor{keyword}{deallocate} (cs%param\_data(i)%line)
265       \textcolor{keyword}{deallocate} (cs%param\_data(i)%line\_used)
266 \textcolor{keywordflow}{    enddo}
267     cs%log\_open = .false.
268     \textcolor{keyword}{call }doc\_end(cs%doc)
269     \textcolor{keywordflow}{return}
270 \textcolor{keywordflow}{  endif} ;\textcolor{keywordflow}{ endif}
271 
272   \textcolor{comment}{! Log the parameters for the parser.}
273   docfile\_default = \textcolor{stringliteral}{"MOM\_parameter\_doc"}
274   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(component)) docfile\_default = trim(component)//\textcolor{stringliteral}{"\_parameter\_doc"}
275 
276   all\_default = (cs%log\_to\_stdout .eqv. log\_to\_stdout\_default)
277   all\_default = all\_default .and. (trim(cs%doc\_file) == trim(docfile\_default))
278   \textcolor{keywordflow}{if} (len\_trim(cs%doc\_file) > 0) \textcolor{keywordflow}{then}
279     all\_default = all\_default .and. (cs%complete\_doc .eqv. complete\_doc\_default)
280     all\_default = all\_default .and. (cs%minimal\_doc .eqv. minimal\_doc\_default)
281 \textcolor{keywordflow}{  endif}
282 
283   mdl = \textcolor{stringliteral}{"MOM\_file\_parser"}
284   \textcolor{keyword}{call }log\_version(cs, mdl, version, \textcolor{stringliteral}{""}, debugging=.true., log\_to\_all=.true., all\_default=all\_default)
285   \textcolor{keyword}{call }log\_param(cs, mdl, \textcolor{stringliteral}{"SEND\_LOG\_TO\_STDOUT"}, cs%log\_to\_stdout, &
286                  \textcolor{stringliteral}{"If true, all log messages are also sent to stdout."}, &
287                  default=log\_to\_stdout\_default)
288   \textcolor{keyword}{call }log\_param(cs, mdl, \textcolor{stringliteral}{"REPORT\_UNUSED\_PARAMS"}, cs%report\_unused, &
289                  \textcolor{stringliteral}{"If true, report any parameter lines that are not used "}//&
290                  \textcolor{stringliteral}{"in the run."}, default=report\_unused\_default, &
291                  debuggingparam=.true.)
292   \textcolor{keyword}{call }log\_param(cs, mdl, \textcolor{stringliteral}{"FATAL\_UNUSED\_PARAMS"}, cs%unused\_params\_fatal, &
293                  \textcolor{stringliteral}{"If true, kill the run if there are any unused "}//&
294                  \textcolor{stringliteral}{"parameters."}, default=unused\_params\_fatal\_default, &
295                  debuggingparam=.true.)
296   \textcolor{keyword}{call }log\_param(cs, mdl, \textcolor{stringliteral}{"DOCUMENT\_FILE"}, cs%doc\_file, &
297                  \textcolor{stringliteral}{"The basename for files where run-time parameters, their "}//&
298                  \textcolor{stringliteral}{"settings, units and defaults are documented. Blank will "}//&
299                  \textcolor{stringliteral}{"disable all parameter documentation."}, default=docfile\_default)
300   \textcolor{keywordflow}{if} (len\_trim(cs%doc\_file) > 0) \textcolor{keywordflow}{then}
301     \textcolor{keyword}{call }log\_param(cs, mdl, \textcolor{stringliteral}{"COMPLETE\_DOCUMENTATION"},  cs%complete\_doc, &
302                   \textcolor{stringliteral}{"If true, all run-time parameters are "}//&
303                   \textcolor{stringliteral}{"documented in "}//trim(cs%doc\_file)//&
304                   \textcolor{stringliteral}{".all ."}, default=complete\_doc\_default)
305     \textcolor{keyword}{call }log\_param(cs, mdl, \textcolor{stringliteral}{"MINIMAL\_DOCUMENTATION"}, cs%minimal\_doc, &
306                   \textcolor{stringliteral}{"If true, non-default run-time parameters are "}//&
307                   \textcolor{stringliteral}{"documented in "}//trim(cs%doc\_file)//&
308                   \textcolor{stringliteral}{".short ."}, default=minimal\_doc\_default)
309 \textcolor{keywordflow}{  endif}
310 
311   num\_unused = 0
312   \textcolor{keywordflow}{do} i = 1, cs%nfiles
313     \textcolor{keywordflow}{if} (is\_root\_pe() .and. (cs%report\_unused .or. &
314                             cs%unused\_params\_fatal)) \textcolor{keywordflow}{then}
315       \textcolor{comment}{! Check for unused lines.}
316       \textcolor{keywordflow}{do} n=1,cs%param\_data(i)%num\_lines
317         \textcolor{keywordflow}{if} (.not.cs%param\_data(i)%line\_used(n)) \textcolor{keywordflow}{then}
318           num\_unused = num\_unused + 1
319           \textcolor{keywordflow}{if} (cs%report\_unused) &
320             \textcolor{keyword}{call }mom\_error(warning, \textcolor{stringliteral}{"Unused line in "}//trim(cs%filename(i))// &
321                             \textcolor{stringliteral}{" : "}//trim(cs%param\_data(i)%line(n)))
322 \textcolor{keywordflow}{        endif}
323 \textcolor{keywordflow}{      enddo}
324 \textcolor{keywordflow}{    endif}
325 
326     \textcolor{keywordflow}{if} (all\_pes\_read .or. is\_root\_pe()) \textcolor{keyword}{close}(cs%iounit(i))
327     \textcolor{keyword}{call }mom\_mesg(\textcolor{stringliteral}{"close\_param\_file: "}// trim(cs%filename(i))// &
328                   \textcolor{stringliteral}{" has been closed successfully."}, 5)
329     cs%iounit(i) = -1
330     cs%filename(i) = \textcolor{stringliteral}{''}
331     cs%NetCDF\_file(i) = .false.
332     \textcolor{keyword}{deallocate} (cs%param\_data(i)%line)
333     \textcolor{keyword}{deallocate} (cs%param\_data(i)%line\_used)
334 \textcolor{keywordflow}{  enddo}
335 
336   \textcolor{keywordflow}{if} (is\_root\_pe() .and. (num\_unused>0) .and. cs%unused\_params\_fatal) &
337     \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"Run stopped because of unused parameter lines."})
338 
339   cs%log\_open = .false.
340   \textcolor{keyword}{call }doc\_end(cs%doc)
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}}
\subsubsection{\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{\tt 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}
464   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{intent(in)} :: string\textcolor{comment}{  !< The input string to process}
465   \textcolor{keywordtype}{logical}                      :: closeMultiLineComment
466 \textcolor{comment}{! True if a */ appears on this line}
467   closemultilinecomment = .false.
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}}
\subsubsection{\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{\tt 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}
2061   \textcolor{keywordtype}{type}(param\_file\_type), \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
2062 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
2063 
2064   \textcolor{keywordtype}{type}(parameter\_block), \textcolor{keywordtype}{pointer} :: block => null()
2065 
2066   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs%blockName)) \textcolor{keywordflow}{then}
2067     block => cs%blockName
2068     \textcolor{keywordflow}{if} (is\_root\_pe().and.len\_trim(block%name)==0) \textcolor{keyword}{call }mom\_error(fatal, &
2069       \textcolor{stringliteral}{'closeParameterBlock: A pop was attempted on an empty stack. ("'}//&
2070       trim(block%name)//\textcolor{stringliteral}{'")'})
2071     \textcolor{keyword}{call }doc\_closeblock(cs%doc,block%name)
2072   \textcolor{keywordflow}{else}
2073     \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keyword}{call }mom\_error(fatal, &
2074       \textcolor{stringliteral}{'closeParameterBlock: A pop was attempted before allocation.'})
2075 \textcolor{keywordflow}{  endif}
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}}
\subsubsection{\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{\tt 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}
1596   \textcolor{keywordtype}{type}(time\_type), \textcolor{keywordtype}{intent(in)} :: date\textcolor{comment}{ !< The date to be translated into a string.}
1597   \textcolor{keywordtype}{character(len=40)} :: date\_string\textcolor{comment}{    !< A date string in a format like YYYY-MM-DD HH:MM:SS.sss}
1598 
1599   \textcolor{comment}{! Local variables}
1600   \textcolor{keywordtype}{character(len=40)} :: sub\_string
1601   \textcolor{keywordtype}{real}    :: real\_secs
1602   \textcolor{keywordtype}{integer} :: yrs, mons, days, hours, mins, secs, ticks, ticks\_per\_sec
1603 
1604   \textcolor{keyword}{call }get\_date(date, yrs, mons, days, hours, mins, secs, ticks)
1605   \textcolor{keyword}{write} (date\_string, \textcolor{stringliteral}{'(i8.4)'}) yrs
1606   \textcolor{keyword}{write} (sub\_string, \textcolor{stringliteral}{'("-", i2.2, "-", I2.2, " ", i2.2, ":", i2.2, ":")'}) &
1607          mons, days, hours, mins
1608   date\_string = trim(adjustl(date\_string)) // trim(sub\_string)
1609   \textcolor{keywordflow}{if} (ticks > 0) \textcolor{keywordflow}{then}
1610     ticks\_per\_sec = get\_ticks\_per\_second()
1611     real\_secs = secs + ticks/ticks\_per\_sec
1612     \textcolor{keywordflow}{if} (ticks\_per\_sec <= 100) \textcolor{keywordflow}{then}
1613       \textcolor{keyword}{write} (sub\_string, \textcolor{stringliteral}{'(F7.3)'}) real\_secs
1614     \textcolor{keywordflow}{else}
1615       \textcolor{keyword}{write} (sub\_string, \textcolor{stringliteral}{'(F10.6)'}) real\_secs
1616 \textcolor{keywordflow}{    endif}
1617   \textcolor{keywordflow}{else}
1618     \textcolor{keyword}{write} (sub\_string, \textcolor{stringliteral}{'(i2.2)'}) secs
1619 \textcolor{keywordflow}{  endif}
1620   date\_string = trim(date\_string) // trim(adjustl(sub\_string))
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}}
\subsubsection{\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{\tt 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}
1218   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{pointer} :: line\_used\textcolor{comment}{ !< A structure indicating which lines have been read}
1219   \textcolor{keywordtype}{integer},            \textcolor{keywordtype}{intent(in)} :: count\textcolor{comment}{ !< The parameter on this line number has been read}
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em modulename} & The name of the calling module\\
\hline
\mbox{\tt in}  & {\em varname} & The case-\/sensitive name of the parameter to read\\
\hline
\mbox{\tt in,out}  & {\em value} & The value of the parameter that may be read from the parameter file and logged\\
\hline
\mbox{\tt in}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file\\
\hline
\mbox{\tt in}  & {\em units} & The units of this parameter\\
\hline
\mbox{\tt in}  & {\em default} & The default value of the parameter\\
\hline
\mbox{\tt 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{\tt 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{\tt in}  & {\em do\+\_\+not\+\_\+read} & If present and true, do not read a value for this parameter, although it might be logged.\\
\hline
\mbox{\tt in}  & {\em do\+\_\+not\+\_\+log} & If present and true, do not log this parameter to the documentation files\\
\hline
\mbox{\tt in}  & {\em layoutparam} & If present and true, this parameter is logged in the layout parameter file\\
\hline
\mbox{\tt 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}
1827   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)}    :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
1828 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
1829   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: modulename\textcolor{comment}{ !< The name of the calling module}
1830   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: varname\textcolor{comment}{ !< The case-sensitive name of the parameter to read}
1831   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}
1832 \textcolor{comment}{                                         !! read from the parameter file and logged}
1833   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: desc\textcolor{comment}{    !< A description of this variable; if not}
1834 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}
1835   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: units\textcolor{comment}{   !< The units of this parameter}
1836   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: default\textcolor{comment}{ !< The default value of the parameter}
1837   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: static\_value\textcolor{comment}{ !< If this parameter is static, it takes}
1838 \textcolor{comment}{                                         !! this value, which can be compared for consistency with}
1839 \textcolor{comment}{                                         !! what is in the parameter file.}
1840   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}
1841 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}
1842   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_read\textcolor{comment}{  !< If present and true, do not read a}
1843 \textcolor{comment}{                                         !! value for this parameter, although it might be logged.}
1844   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_log\textcolor{comment}{ !< If present and true, do not log this}
1845 \textcolor{comment}{                                         !! parameter to the documentation files}
1846   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: layoutParam\textcolor{comment}{ !< If present and true, this parameter is}
1847 \textcolor{comment}{                                         !! logged in the layout parameter file}
1848   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}
1849 \textcolor{comment}{                                         !! logged in the debugging parameter file}
1850 
1851   \textcolor{keywordtype}{logical} :: do\_read, do\_log
1852 
1853   do\_read = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_read)) do\_read = .not.do\_not\_read
1854   do\_log  = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_log))  do\_log  = .not.do\_not\_log
1855 
1856   \textcolor{keywordflow}{if} (do\_read) \textcolor{keywordflow}{then}
1857     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) \textcolor{keywordtype}{value} = default
1858     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(static\_value)) \textcolor{keywordtype}{value} = static\_value
1859     \textcolor{keyword}{call }read\_param\_char(cs, varname, \textcolor{keywordtype}{value}, fail\_if\_missing)
1860 \textcolor{keywordflow}{  endif}
1861 
1862   \textcolor{keywordflow}{if} (do\_log) \textcolor{keywordflow}{then}
1863     \textcolor{keyword}{call }log\_param\_char(cs, modulename, varname, \textcolor{keywordtype}{value}, desc, units, &
1864                         default, layoutparam, debuggingparam)
1865 \textcolor{keywordflow}{  endif}
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em modulename} & The name of the calling module\\
\hline
\mbox{\tt in}  & {\em varname} & The case-\/sensitive name of the parameter to read\\
\hline
\mbox{\tt in,out}  & {\em value} & The value of the parameter that may be read from the parameter file and logged\\
\hline
\mbox{\tt in}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file\\
\hline
\mbox{\tt in}  & {\em units} & The units of this parameter\\
\hline
\mbox{\tt in}  & {\em default} & The default value of the parameter\\
\hline
\mbox{\tt 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{\tt 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{\tt in}  & {\em do\+\_\+not\+\_\+read} & If present and true, do not read a value for this parameter, although it might be logged.\\
\hline
\mbox{\tt 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}
1873   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)}    :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
1874 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
1875   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: modulename\textcolor{comment}{ !< The name of the calling module}
1876   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: varname\textcolor{comment}{ !< The case-sensitive name of the parameter to read}
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}
1878 \textcolor{comment}{                                         !! read from the parameter file and logged}
1879   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: desc\textcolor{comment}{    !< A description of this variable; if not}
1880 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}
1881   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: units\textcolor{comment}{   !< The units of this parameter}
1882   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: default\textcolor{comment}{ !< The default value of the parameter}
1883   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: static\_value\textcolor{comment}{ !< If this parameter is static, it takes}
1884 \textcolor{comment}{                                         !! this value, which can be compared for consistency with}
1885 \textcolor{comment}{                                         !! what is in the parameter file.}
1886   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}
1887 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}
1888   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_read\textcolor{comment}{  !< If present and true, do not read a}
1889 \textcolor{comment}{                                         !! value for this parameter, although it might be logged.}
1890   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_log\textcolor{comment}{ !< If present and true, do not log this}
1891 \textcolor{comment}{                                         !! parameter to the documentation files}
1892 
1893   \textcolor{comment}{! Local variables}
1894   \textcolor{keywordtype}{logical} :: do\_read, do\_log
1895   \textcolor{keywordtype}{integer} :: i, len\_tot, len\_val
1896   \textcolor{keywordtype}{character(len=1024)} :: cat\_val
1897 
1898   do\_read = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_read)) do\_read = .not.do\_not\_read
1899   do\_log  = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_log))  do\_log  = .not.do\_not\_log
1900 
1901   \textcolor{keywordflow}{if} (do\_read) \textcolor{keywordflow}{then}
1902     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) \textcolor{keywordflow}{then} ; value(:) = default ;\textcolor{keywordflow}{ endif}
1903     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(static\_value)) \textcolor{keywordflow}{then} ; value(:) = static\_value ;\textcolor{keywordflow}{ endif}
1904     \textcolor{keyword}{call }read\_param\_char\_array(cs, varname, \textcolor{keywordtype}{value}, fail\_if\_missing)
1905 \textcolor{keywordflow}{  endif}
1906 
1907   \textcolor{keywordflow}{if} (do\_log) \textcolor{keywordflow}{then}
1908     cat\_val = trim(value(1)); len\_tot = len\_trim(value(1))
1909     \textcolor{keywordflow}{do} i=2,\textcolor{keyword}{size}(\textcolor{keywordtype}{value})
1910       len\_val = len\_trim(value(i))
1911       \textcolor{keywordflow}{if} ((len\_val > 0) .and. (len\_tot + len\_val + 2 < 240)) \textcolor{keywordflow}{then}
1912         cat\_val = trim(cat\_val)//achar(34)// \textcolor{stringliteral}{", "}//achar(34)//trim(value(i))
1913         len\_tot = len\_tot + len\_val
1914 \textcolor{keywordflow}{      endif}
1915 \textcolor{keywordflow}{    enddo}
1916     \textcolor{keyword}{call }log\_param\_char(cs, modulename, varname, cat\_val, desc, &
1917                         units, default)
1918 \textcolor{keywordflow}{  endif}
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em modulename} & The name of the calling module\\
\hline
\mbox{\tt in}  & {\em varname} & The case-\/sensitive name of the parameter to read\\
\hline
\mbox{\tt in,out}  & {\em value} & The value of the parameter that may be read from the parameter file and logged\\
\hline
\mbox{\tt in}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file\\
\hline
\mbox{\tt in}  & {\em units} & The units of this parameter\\
\hline
\mbox{\tt in}  & {\em default} & The default value of the parameter\\
\hline
\mbox{\tt 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{\tt 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{\tt in}  & {\em do\+\_\+not\+\_\+read} & If present and true, do not read a value for this parameter, although it might be logged.\\
\hline
\mbox{\tt in}  & {\em do\+\_\+not\+\_\+log} & If present and true, do not log this parameter to the documentation files\\
\hline
\mbox{\tt in}  & {\em layoutparam} & If present and true, this parameter is logged in the layout parameter file\\
\hline
\mbox{\tt 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}
1629   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)}    :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
1630 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
1631   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: modulename\textcolor{comment}{ !< The name of the calling module}
1632   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: varname\textcolor{comment}{ !< The case-sensitive name of the parameter to read}
1633   \textcolor{keywordtype}{integer},                    \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}
1634 \textcolor{comment}{                                         !! read from the parameter file and logged}
1635   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: desc\textcolor{comment}{    !< A description of this variable; if not}
1636 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}
1637   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: units\textcolor{comment}{   !< The units of this parameter}
1638   \textcolor{keywordtype}{integer},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: default\textcolor{comment}{ !< The default value of the parameter}
1639   \textcolor{keywordtype}{integer},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: static\_value\textcolor{comment}{ !< If this parameter is static, it takes}
1640 \textcolor{comment}{                                         !! this value, which can be compared for consistency with}
1641 \textcolor{comment}{                                         !! what is in the parameter file.}
1642   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}
1643 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}
1644   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_read\textcolor{comment}{  !< If present and true, do not read a}
1645 \textcolor{comment}{                                         !! value for this parameter, although it might be logged.}
1646   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_log\textcolor{comment}{ !< If present and true, do not log this}
1647 \textcolor{comment}{                                         !! parameter to the documentation files}
1648   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: layoutParam\textcolor{comment}{ !< If present and true, this parameter is}
1649 \textcolor{comment}{                                         !! logged in the layout parameter file}
1650   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}
1651 \textcolor{comment}{                                         !! logged in the debugging parameter file}
1652 
1653   \textcolor{keywordtype}{logical} :: do\_read, do\_log
1654 
1655   do\_read = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_read)) do\_read = .not.do\_not\_read
1656   do\_log  = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_log))  do\_log  = .not.do\_not\_log
1657 
1658   \textcolor{keywordflow}{if} (do\_read) \textcolor{keywordflow}{then}
1659     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) \textcolor{keywordtype}{value} = default
1660     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(static\_value)) \textcolor{keywordtype}{value} = static\_value
1661     \textcolor{keyword}{call }read\_param\_int(cs, varname, \textcolor{keywordtype}{value}, fail\_if\_missing)
1662 \textcolor{keywordflow}{  endif}
1663 
1664   \textcolor{keywordflow}{if} (do\_log) \textcolor{keywordflow}{then}
1665     \textcolor{keyword}{call }log\_param\_int(cs, modulename, varname, \textcolor{keywordtype}{value}, desc, units, &
1666                        default, layoutparam, debuggingparam)
1667 \textcolor{keywordflow}{  endif}
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em modulename} & The name of the calling module\\
\hline
\mbox{\tt in}  & {\em varname} & The case-\/sensitive name of the parameter to read\\
\hline
\mbox{\tt in,out}  & {\em value} & The value of the parameter that may be reset from the parameter file\\
\hline
\mbox{\tt in}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file\\
\hline
\mbox{\tt in}  & {\em units} & The units of this parameter\\
\hline
\mbox{\tt in}  & {\em default} & The default value of the parameter\\
\hline
\mbox{\tt 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{\tt 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{\tt in}  & {\em do\+\_\+not\+\_\+read} & If present and true, do not read a value for this parameter, although it might be logged.\\
\hline
\mbox{\tt in}  & {\em do\+\_\+not\+\_\+log} & If present and true, do not log this parameter to the documentation files\\
\hline
\mbox{\tt in}  & {\em layoutparam} & If present and true, this parameter is logged in the layout parameter file\\
\hline
\mbox{\tt 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}
1676   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)}    :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
1677 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
1678   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: modulename\textcolor{comment}{ !< The name of the calling module}
1679   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: varname\textcolor{comment}{ !< The case-sensitive name of the parameter to read}
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}
1681 \textcolor{comment}{                                         !! from the parameter file}
1682   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: desc\textcolor{comment}{    !< A description of this variable; if not}
1683 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}
1684   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: units\textcolor{comment}{   !< The units of this parameter}
1685   \textcolor{keywordtype}{integer},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: default\textcolor{comment}{ !< The default value of the parameter}
1686   \textcolor{keywordtype}{integer},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: static\_value\textcolor{comment}{ !< If this parameter is static, it takes}
1687 \textcolor{comment}{                                         !! this value, which can be compared for consistency with}
1688 \textcolor{comment}{                                         !! what is in the parameter file.}
1689   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}
1690 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}
1691   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_read\textcolor{comment}{  !< If present and true, do not read a}
1692 \textcolor{comment}{                                         !! value for this parameter, although it might be logged.}
1693   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_log\textcolor{comment}{ !< If present and true, do not log this}
1694 \textcolor{comment}{                                         !! parameter to the documentation files}
1695   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: layoutParam\textcolor{comment}{ !< If present and true, this parameter is}
1696 \textcolor{comment}{                                         !! logged in the layout parameter file}
1697   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}
1698 \textcolor{comment}{                                         !! logged in the debugging parameter file}
1699 
1700   \textcolor{keywordtype}{logical} :: do\_read, do\_log
1701 
1702   do\_read = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_read)) do\_read = .not.do\_not\_read
1703   do\_log  = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_log))  do\_log  = .not.do\_not\_log
1704 
1705   \textcolor{keywordflow}{if} (do\_read) \textcolor{keywordflow}{then}
1706     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) \textcolor{keywordflow}{then} ; value(:) = default ;\textcolor{keywordflow}{ endif}
1707     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(static\_value)) \textcolor{keywordflow}{then} ; value(:) = static\_value ;\textcolor{keywordflow}{ endif}
1708     \textcolor{keyword}{call }read\_param\_int\_array(cs, varname, \textcolor{keywordtype}{value}, fail\_if\_missing)
1709 \textcolor{keywordflow}{  endif}
1710 
1711   \textcolor{keywordflow}{if} (do\_log) \textcolor{keywordflow}{then}
1712     \textcolor{keyword}{call }log\_param\_int\_array(cs, modulename, varname, \textcolor{keywordtype}{value}, desc, &
1713                              units, default, layoutparam, debuggingparam)
1714 \textcolor{keywordflow}{  endif}
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em modulename} & The name of the calling module\\
\hline
\mbox{\tt in}  & {\em varname} & The case-\/sensitive name of the parameter to read\\
\hline
\mbox{\tt in,out}  & {\em value} & The value of the parameter that may be read from the parameter file and logged\\
\hline
\mbox{\tt in}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file\\
\hline
\mbox{\tt in}  & {\em units} & The units of this parameter\\
\hline
\mbox{\tt in}  & {\em default} & The default value of the parameter\\
\hline
\mbox{\tt 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{\tt 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{\tt in}  & {\em do\+\_\+not\+\_\+read} & If present and true, do not read a value for this parameter, although it might be logged.\\
\hline
\mbox{\tt in}  & {\em do\+\_\+not\+\_\+log} & If present and true, do not log this parameter to the documentation files\\
\hline
\mbox{\tt in}  & {\em layoutparam} & If present and true, this parameter is logged in the layout parameter file\\
\hline
\mbox{\tt 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}
1927   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)}    :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
1928 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
1929   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: modulename\textcolor{comment}{ !< The name of the calling module}
1930   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: varname\textcolor{comment}{ !< The case-sensitive name of the parameter to read}
1931   \textcolor{keywordtype}{logical},                    \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}
1932 \textcolor{comment}{                                         !! read from the parameter file and logged}
1933   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: desc\textcolor{comment}{    !< A description of this variable; if not}
1934 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}
1935   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: units\textcolor{comment}{   !< The units of this parameter}
1936   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: default\textcolor{comment}{ !< The default value of the parameter}
1937   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: static\_value\textcolor{comment}{ !< If this parameter is static, it takes}
1938 \textcolor{comment}{                                         !! this value, which can be compared for consistency with}
1939 \textcolor{comment}{                                         !! what is in the parameter file.}
1940   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}
1941 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}
1942   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_read\textcolor{comment}{  !< If present and true, do not read a}
1943 \textcolor{comment}{                                         !! value for this parameter, although it might be logged.}
1944   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_log\textcolor{comment}{ !< If present and true, do not log this}
1945 \textcolor{comment}{                                         !! parameter to the documentation files}
1946   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: layoutParam\textcolor{comment}{ !< If present and true, this parameter is}
1947 \textcolor{comment}{                                         !! logged in the layout parameter file}
1948   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}
1949 \textcolor{comment}{                                         !! logged in the debugging parameter file}
1950 
1951   \textcolor{keywordtype}{logical} :: do\_read, do\_log
1952 
1953   do\_read = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_read)) do\_read = .not.do\_not\_read
1954   do\_log  = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_log))  do\_log  = .not.do\_not\_log
1955 
1956   \textcolor{keywordflow}{if} (do\_read) \textcolor{keywordflow}{then}
1957     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) \textcolor{keywordtype}{value} = default
1958     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(static\_value)) \textcolor{keywordtype}{value} = static\_value
1959     \textcolor{keyword}{call }read\_param\_logical(cs, varname, \textcolor{keywordtype}{value}, fail\_if\_missing)
1960 \textcolor{keywordflow}{  endif}
1961 
1962   \textcolor{keywordflow}{if} (do\_log) \textcolor{keywordflow}{then}
1963     \textcolor{keyword}{call }log\_param\_logical(cs, modulename, varname, \textcolor{keywordtype}{value}, desc, &
1964                            units, default, layoutparam, debuggingparam)
1965 \textcolor{keywordflow}{  endif}
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em modulename} & The name of the calling module\\
\hline
\mbox{\tt in}  & {\em varname} & The case-\/sensitive name of the parameter to read\\
\hline
\mbox{\tt in,out}  & {\em value} & The value of the parameter that may be read from the parameter file and logged\\
\hline
\mbox{\tt in}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file\\
\hline
\mbox{\tt in}  & {\em units} & The units of this parameter\\
\hline
\mbox{\tt in}  & {\em default} & The default value of the parameter\\
\hline
\mbox{\tt 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{\tt 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{\tt in}  & {\em do\+\_\+not\+\_\+read} & If present and true, do not read a value for this parameter, although it might be logged.\\
\hline
\mbox{\tt in}  & {\em do\+\_\+not\+\_\+log} & If present and true, do not log this parameter to the documentation files\\
\hline
\mbox{\tt in}  & {\em debuggingparam} & If present and true, this parameter is logged in the debugging parameter file\\
\hline
\mbox{\tt in}  & {\em scale} & A scaling factor that the parameter is multiplied by before it is returned.\\
\hline
\mbox{\tt 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}
1723   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)}    :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
1724 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
1725   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: modulename\textcolor{comment}{ !< The name of the calling module}
1726   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: varname\textcolor{comment}{ !< The case-sensitive name of the parameter to read}
1727   \textcolor{keywordtype}{real},                       \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}
1728 \textcolor{comment}{                                         !! read from the parameter file and logged}
1729   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: desc\textcolor{comment}{    !< A description of this variable; if not}
1730 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}
1731   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: units\textcolor{comment}{   !< The units of this parameter}
1732   \textcolor{keywordtype}{real},             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: default\textcolor{comment}{ !< The default value of the parameter}
1733   \textcolor{keywordtype}{real},             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: static\_value\textcolor{comment}{ !< If this parameter is static, it takes}
1734 \textcolor{comment}{                                         !! this value, which can be compared for consistency with}
1735 \textcolor{comment}{                                         !! what is in the parameter file.}
1736   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}
1737 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}
1738   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_read\textcolor{comment}{  !< If present and true, do not read a}
1739 \textcolor{comment}{                                         !! value for this parameter, although it might be logged.}
1740   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_log\textcolor{comment}{ !< If present and true, do not log this}
1741 \textcolor{comment}{                                         !! parameter to the documentation files}
1742   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}
1743 \textcolor{comment}{                                         !! logged in the debugging parameter file}
1744   \textcolor{keywordtype}{real},             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scale\textcolor{comment}{   !< A scaling factor that the parameter is}
1745 \textcolor{comment}{                                         !! multiplied by before it is returned.}
1746   \textcolor{keywordtype}{real},             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)}   :: unscaled\textcolor{comment}{ !< The value of the parameter that would be}
1747 \textcolor{comment}{                                         !! returned without any multiplication by a scaling factor.}
1748 
1749   \textcolor{keywordtype}{logical} :: do\_read, do\_log
1750 
1751   do\_read = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_read)) do\_read = .not.do\_not\_read
1752   do\_log  = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_log))  do\_log  = .not.do\_not\_log
1753 
1754   \textcolor{keywordflow}{if} (do\_read) \textcolor{keywordflow}{then}
1755     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) \textcolor{keywordtype}{value} = default
1756     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(static\_value)) \textcolor{keywordtype}{value} = static\_value
1757     \textcolor{keyword}{call }read\_param\_real(cs, varname, \textcolor{keywordtype}{value}, fail\_if\_missing)
1758 \textcolor{keywordflow}{  endif}
1759 
1760   \textcolor{keywordflow}{if} (do\_log) \textcolor{keywordflow}{then}
1761     \textcolor{keyword}{call }log\_param\_real(cs, modulename, varname, \textcolor{keywordtype}{value}, desc, units, &
1762                         default, debuggingparam)
1763 \textcolor{keywordflow}{  endif}
1764 
1765   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(unscaled)) unscaled = \textcolor{keywordtype}{value}
1766   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) \textcolor{keywordtype}{value} = scale*\textcolor{keywordtype}{value}
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em modulename} & The name of the calling module\\
\hline
\mbox{\tt in}  & {\em varname} & The case-\/sensitive name of the parameter to read\\
\hline
\mbox{\tt in,out}  & {\em value} & The value of the parameter that may be read from the parameter file and logged\\
\hline
\mbox{\tt in}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file\\
\hline
\mbox{\tt in}  & {\em units} & The units of this parameter\\
\hline
\mbox{\tt in}  & {\em default} & The default value of the parameter\\
\hline
\mbox{\tt 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{\tt 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{\tt in}  & {\em do\+\_\+not\+\_\+read} & If present and true, do not read a value for this parameter, although it might be logged.\\
\hline
\mbox{\tt in}  & {\em do\+\_\+not\+\_\+log} & If present and true, do not log this parameter to the documentation files\\
\hline
\mbox{\tt in}  & {\em debuggingparam} & If present and true, this parameter is logged in the debugging parameter file\\
\hline
\mbox{\tt in}  & {\em scale} & A scaling factor that the parameter is multiplied by before it is returned.\\
\hline
\mbox{\tt 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}
1775   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)}    :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
1776 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
1777   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: modulename\textcolor{comment}{ !< The name of the calling module}
1778   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: varname\textcolor{comment}{ !< The case-sensitive name of the parameter to read}
1779   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)},         \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}
1780 \textcolor{comment}{                                         !! read from the parameter file and logged}
1781   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: desc\textcolor{comment}{    !< A description of this variable; if not}
1782 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}
1783   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: units\textcolor{comment}{   !< The units of this parameter}
1784   \textcolor{keywordtype}{real},             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: default\textcolor{comment}{ !< The default value of the parameter}
1785   \textcolor{keywordtype}{real},             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: static\_value\textcolor{comment}{ !< If this parameter is static, it takes}
1786 \textcolor{comment}{                                         !! this value, which can be compared for consistency with}
1787 \textcolor{comment}{                                         !! what is in the parameter file.}
1788   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}
1789 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}
1790   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_read\textcolor{comment}{  !< If present and true, do not read a}
1791 \textcolor{comment}{                                         !! value for this parameter, although it might be logged.}
1792   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_log\textcolor{comment}{ !< If present and true, do not log this}
1793 \textcolor{comment}{                                         !! parameter to the documentation files}
1794   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}
1795 \textcolor{comment}{                                         !! logged in the debugging parameter file}
1796   \textcolor{keywordtype}{real},             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scale\textcolor{comment}{   !< A scaling factor that the parameter is}
1797 \textcolor{comment}{                                         !! multiplied by before it is returned.}
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}
1799 \textcolor{comment}{                                         !! returned without any multiplication by a scaling factor.}
1800 
1801   \textcolor{keywordtype}{logical} :: do\_read, do\_log
1802 
1803   do\_read = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_read)) do\_read = .not.do\_not\_read
1804   do\_log  = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_log))  do\_log  = .not.do\_not\_log
1805 
1806   \textcolor{keywordflow}{if} (do\_read) \textcolor{keywordflow}{then}
1807     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) \textcolor{keywordflow}{then} ; value(:) = default ;\textcolor{keywordflow}{ endif}
1808     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(static\_value)) \textcolor{keywordflow}{then} ; value(:) = static\_value ;\textcolor{keywordflow}{ endif}
1809     \textcolor{keyword}{call }read\_param\_real\_array(cs, varname, \textcolor{keywordtype}{value}, fail\_if\_missing)
1810 \textcolor{keywordflow}{  endif}
1811 
1812   \textcolor{keywordflow}{if} (do\_log) \textcolor{keywordflow}{then}
1813     \textcolor{keyword}{call }log\_param\_real\_array(cs, modulename, varname, \textcolor{keywordtype}{value}, desc, &
1814                               units, default, debuggingparam)
1815 \textcolor{keywordflow}{  endif}
1816 
1817   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(unscaled)) unscaled(:) = value(:)
1818   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) value(:) = scale*value(:)
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em modulename} & The name of the calling module\\
\hline
\mbox{\tt in}  & {\em varname} & The case-\/sensitive name of the parameter to read\\
\hline
\mbox{\tt in,out}  & {\em value} & The value of the parameter that may be read from the parameter file and logged\\
\hline
\mbox{\tt in}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file\\
\hline
\mbox{\tt in}  & {\em units} & The units of this parameter\\
\hline
\mbox{\tt in}  & {\em default} & The default value of the parameter\\
\hline
\mbox{\tt 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{\tt 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{\tt in}  & {\em do\+\_\+not\+\_\+read} & If present and true, do not read a value for this parameter, although it might be logged.\\
\hline
\mbox{\tt in}  & {\em do\+\_\+not\+\_\+log} & If present and true, do not log this parameter to the documentation files\\
\hline
\mbox{\tt in}  & {\em timeunit} & The number of seconds in a time unit for real-\/number input to be translated to a time.\\
\hline
\mbox{\tt in}  & {\em layoutparam} & If present and true, this parameter is logged in the layout parameter file\\
\hline
\mbox{\tt in}  & {\em debuggingparam} & If present and true, this parameter is logged in the debugging parameter file\\
\hline
\mbox{\tt 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}
1975   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)}    :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
1976 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
1977   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: modulename\textcolor{comment}{ !< The name of the calling module}
1978   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)}    :: varname\textcolor{comment}{ !< The case-sensitive name of the parameter to read}
1979   \textcolor{keywordtype}{type}(time\_type),            \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}
1980 \textcolor{comment}{                                         !! read from the parameter file and logged}
1981   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: desc\textcolor{comment}{    !< A description of this variable; if not}
1982 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}
1983   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: units\textcolor{comment}{   !< The units of this parameter}
1984   \textcolor{keywordtype}{type}(time\_type),  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: default\textcolor{comment}{ !< The default value of the parameter}
1985   \textcolor{keywordtype}{type}(time\_type),  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: static\_value\textcolor{comment}{ !< If this parameter is static, it takes}
1986 \textcolor{comment}{                                         !! this value, which can be compared for consistency with}
1987 \textcolor{comment}{                                         !! what is in the parameter file.}
1988   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}
1989 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}
1990   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_read\textcolor{comment}{  !< If present and true, do not read a}
1991 \textcolor{comment}{                                         !! value for this parameter, although it might be logged.}
1992   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: do\_not\_log\textcolor{comment}{ !< If present and true, do not log this}
1993 \textcolor{comment}{                                         !! parameter to the documentation files}
1994   \textcolor{keywordtype}{real},             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: timeunit\textcolor{comment}{ !< The number of seconds in a time unit for}
1995 \textcolor{comment}{                                         !! real-number input to be translated to a time.}
1996   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: layoutParam\textcolor{comment}{ !< If present and true, this parameter is}
1997 \textcolor{comment}{                                         !! logged in the layout parameter file}
1998   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}
1999 \textcolor{comment}{                                         !! logged in the debugging parameter file}
2000   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: log\_as\_date\textcolor{comment}{  !< If true, log the time\_type in date}
2001 \textcolor{comment}{                                         !! format. The default is false.}
2002 
2003   \textcolor{keywordtype}{logical} :: do\_read, do\_log, date\_format, log\_date
2004 
2005   do\_read = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_read)) do\_read = .not.do\_not\_read
2006   do\_log  = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(do\_not\_log))  do\_log  = .not.do\_not\_log
2007   log\_date = .false.
2008 
2009   \textcolor{keywordflow}{if} (do\_read) \textcolor{keywordflow}{then}
2010     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) \textcolor{keywordtype}{value} = default
2011     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(static\_value)) \textcolor{keywordtype}{value} = static\_value
2012     \textcolor{keyword}{call }read\_param\_time(cs, varname, \textcolor{keywordtype}{value}, timeunit, fail\_if\_missing, date\_format=log\_date)
2013 \textcolor{keywordflow}{  endif}
2014 
2015   \textcolor{keywordflow}{if} (do\_log) \textcolor{keywordflow}{then}
2016     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(log\_as\_date)) log\_date = log\_as\_date
2017     \textcolor{keyword}{call }log\_param\_time(cs, modulename, varname, \textcolor{keywordtype}{value}, desc, units, default, &
2018                         timeunit, layoutparam=layoutparam, &
2019                         debuggingparam=debuggingparam, log\_date=log\_date)
2020 \textcolor{keywordflow}{  endif}
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em varname} & The case-\/sensitive name of the parameter to read\\
\hline
\mbox{\tt out}  & {\em found} & If true, this parameter has been found in CS\\
\hline
\mbox{\tt out}  & {\em defined} & If true, this parameter is set (or true) in the CS\\
\hline
\mbox{\tt out}  & {\em value\+\_\+string} & A string that encodes the new value\\
\hline
\mbox{\tt 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}
897   \textcolor{keywordtype}{type}(param\_file\_type),  \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
898 \textcolor{comment}{                                                !! it is also a structure to parse for run-time parameters}
899   \textcolor{keywordtype}{character(len=*)},       \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The case-sensitive name of the parameter to read}
900   \textcolor{keywordtype}{logical},               \textcolor{keywordtype}{intent(out)} :: found\textcolor{comment}{   !< If true, this parameter has been found in CS}
901   \textcolor{keywordtype}{logical},               \textcolor{keywordtype}{intent(out)} :: defined\textcolor{comment}{ !< If true, this parameter is set (or true) in the CS}
902   \textcolor{keywordtype}{character(len=*)},      \textcolor{keywordtype}{intent(out)} :: value\_string(:)\textcolor{comment}{ !< A string that encodes the new value}
903   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{optional},      \textcolor{keywordtype}{intent(in)} :: paramIsLogical\textcolor{comment}{  !< If true, this is a logical parameter}
904 \textcolor{comment}{                                                !! that can be simply defined without parsing a
       value\_string.}
905 
906   \textcolor{comment}{! Local variables}
907   \textcolor{keywordtype}{character(len=INPUT\_STR\_LENGTH)} :: val\_str, lname, origLine
908   \textcolor{keywordtype}{character(len=INPUT\_STR\_LENGTH)} :: line, continuationBuffer, blockName
909   \textcolor{keywordtype}{character(len=FILENAME\_LENGTH)}  :: filename
910   \textcolor{keywordtype}{integer}            :: is, id, isd, isu, ise, iso, verbose, ipf
911   \textcolor{keywordtype}{integer}            :: last, last1, ival, oval, max\_vals, count, contBufSize
912   \textcolor{keywordtype}{character(len=52)}  :: set
913   \textcolor{keywordtype}{logical}            :: found\_override, found\_equals
914   \textcolor{keywordtype}{logical}            :: found\_define, found\_undef
915   \textcolor{keywordtype}{logical}            :: force\_cycle, defined\_in\_line, continuedLine
916   \textcolor{keywordtype}{logical}            :: variableKindIsLogical, valueIsSame
917   \textcolor{keywordtype}{logical}            :: inWrongBlock, fullPathParameter
918   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{parameter} :: requireNamedClose = .false.
919   set = \textcolor{stringliteral}{"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"}
920   continuationbuffer = repeat(\textcolor{stringliteral}{" "},input\_str\_length)
921   contbufsize = 0
922   verbose = 1
923 
924   variablekindislogical=.false.
925   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(paramislogical)) variablekindislogical = paramislogical
926 
927   \textcolor{comment}{! Find the first instance (if any) where the named variable is found, and}
928   \textcolor{comment}{! return variables indicating whether this variable is defined and the string}
929   \textcolor{comment}{! that contains the value of this variable.}
930   found = .false.
931   oval = 0; ival = 0
932   max\_vals = \textcolor{keyword}{SIZE}(value\_string)
933   \textcolor{keywordflow}{do} is=1,max\_vals ; value\_string(is) = \textcolor{stringliteral}{" "} ;\textcolor{keywordflow}{ enddo}
934 
935   paramfile\_loop: \textcolor{keywordflow}{do} ipf = 1, cs%nfiles
936     filename = cs%filename(ipf)
937     continuedline = .false.
938     blockname = \textcolor{stringliteral}{''}
939 
940     \textcolor{comment}{! Scan through each line of the file}
941     \textcolor{keywordflow}{do} count = 1, cs%param\_data(ipf)%num\_lines
942       line = cs%param\_data(ipf)%line(count)
943       last = len\_trim(line)
944 
945       last1 = max(1,last)
946       \textcolor{comment}{! Check if line ends in continuation character (either & or \(\backslash\))}
947       \textcolor{comment}{! Note achar(92) is a backslash}
948       \textcolor{keywordflow}{if} (line(last1:last1) == achar(92).or.line(last1:last1) == \textcolor{stringliteral}{"&"}) \textcolor{keywordflow}{then}
949         continuationbuffer(contbufsize+1:contbufsize+len\_trim(line))=line(:last-1)
950         contbufsize=contbufsize + len\_trim(line)-1
951         continuedline = .true.
952         \textcolor{keywordflow}{if} (count==cs%param\_data(ipf)%num\_lines .and. is\_root\_pe()) &
953            \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"MOM\_file\_parser : the last line"}// &
954                  \textcolor{stringliteral}{" of the file ends in a continuation character but"}// &
955                  \textcolor{stringliteral}{" there are no more lines to read. "}// &
956                  \textcolor{stringliteral}{" Line: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//&
957                  \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{"."})
958         cycle \textcolor{comment}{! cycle inorder to append the next line of the file}
959       \textcolor{keywordflow}{elseif} (continuedline) \textcolor{keywordflow}{then}
960         \textcolor{comment}{! If we reached this point then this is the end of line continuation}
961         continuationbuffer(contbufsize+1:contbufsize+len\_trim(line))=line(:last)
962         line = continuationbuffer
963         continuationbuffer=repeat(\textcolor{stringliteral}{" "},input\_str\_length) \textcolor{comment}{! Clear for next use}
964         contbufsize = 0
965         continuedline = .false.
966         last = len\_trim(line)
967 \textcolor{keywordflow}{      endif}
968 
969       origline = trim(line) \textcolor{comment}{! Keep original for error messages}
970 
971       \textcolor{comment}{! Check for '#override' at start of line}
972       found\_override = .false.; found\_define = .false.; found\_undef = .false.
973       iso = index(line(:last), \textcolor{stringliteral}{"#override "} )\textcolor{comment}{!; if (is > 0) found\_override = .true.}
974       \textcolor{keywordflow}{if} (iso>1) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"MOM\_file\_parser : #override was found "}// &
975                  \textcolor{stringliteral}{" but was not the first keyword."}// &
976                  \textcolor{stringliteral}{" Line: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//&
977                  \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{"."})
978       \textcolor{keywordflow}{if} (iso==1) \textcolor{keywordflow}{then}
979         found\_override = .true.
980         \textcolor{keywordflow}{if} (index(line(:last), \textcolor{stringliteral}{"#override define "})==1) found\_define = .true.
981         \textcolor{keywordflow}{if} (index(line(:last), \textcolor{stringliteral}{"#override undef "})==1) found\_undef = .true.
982         line = trim(adjustl(line(iso+10:last))); last = len\_trim(line)
983 \textcolor{keywordflow}{      endif}
984 
985       \textcolor{comment}{! Check for start of fortran namelist, ie. '&namelist'}
986       \textcolor{keywordflow}{if} (index(line(:last),\textcolor{stringliteral}{'&'})==1) \textcolor{keywordflow}{then}
987         iso=index(line(:last),\textcolor{stringliteral}{' '})
988         \textcolor{keywordflow}{if} (iso>0) \textcolor{keywordflow}{then} \textcolor{comment}{! possibly simething else on this line}
989           blockname = pushblocklevel(blockname,line(2:iso-1))
990           line=trim(adjustl(line(iso:last)))
991           last=len\_trim(line)
992           \textcolor{keywordflow}{if} (last==0) cycle \textcolor{comment}{! nothing else on this line}
993         \textcolor{keywordflow}{else} \textcolor{comment}{! just the namelist on this line}
994           \textcolor{keywordflow}{if} (len\_trim(blockname)>0) \textcolor{keywordflow}{then}
995             blockname = trim(blockname) // \textcolor{stringliteral}{'%'} //trim(line(2:last))
996           \textcolor{keywordflow}{else}
997             blockname = trim(line(2:last))
998 \textcolor{keywordflow}{          endif}
999           \textcolor{keyword}{call }flag\_line\_as\_read(cs%param\_data(ipf)%line\_used,count)
1000           cycle
1001 \textcolor{keywordflow}{        endif}
1002 \textcolor{keywordflow}{      endif}
1003 
1004       \textcolor{comment}{! Newer form of parameter block, block%, %block or block%param or}
1005       iso=index(line(:last),\textcolor{stringliteral}{'%'})
1006       fullpathparameter = .false.
1007       \textcolor{keywordflow}{if} (iso==1) \textcolor{keywordflow}{then} \textcolor{comment}{! % is first character means this is a close}
1008         \textcolor{keywordflow}{if} (len\_trim(blockname)==0 .and. is\_root\_pe()) \textcolor{keyword}{call }mom\_error(fatal, &
1009             \textcolor{stringliteral}{'get\_variable\_line: An extra close block was encountered. Line="'}// &
1010             trim(line(:last))//\textcolor{stringliteral}{'"'} )
1011         \textcolor{keywordflow}{if} (last>1 .and. trim(blockname)/=trim(line(2:last)) .and. is\_root\_pe()) &
1012             \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{'get\_variable\_line: A named close for a parameter'}// &
1013             \textcolor{stringliteral}{' block did not match the open block. Line="'}//trim(line(:last))//\textcolor{stringliteral}{'"'} )
1014         \textcolor{keywordflow}{if} (last==1 .and. requirenamedclose) & \textcolor{comment}{! line = '%' is a generic (unnamed) close}
1015             \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{'get\_variable\_line: A named close for a parameter'}// &
1016             \textcolor{stringliteral}{' block is required but found "%". Block="'}//trim(blockname)//\textcolor{stringliteral}{'"'} )
1017         blockname = popblocklevel(blockname)
1018         \textcolor{keyword}{call }flag\_line\_as\_read(cs%param\_data(ipf)%line\_used,count)
1019       \textcolor{keywordflow}{elseif} (iso==last) \textcolor{keywordflow}{then} \textcolor{comment}{! This is a new block if % is last character}
1020         blockname = pushblocklevel(blockname, line(:iso-1))
1021         \textcolor{keyword}{call }flag\_line\_as\_read(cs%param\_data(ipf)%line\_used,count)
1022       \textcolor{keywordflow}{else} \textcolor{comment}{! This is of the form block%parameter = ... (full path parameter)}
1023         iso=index(line(:last),\textcolor{stringliteral}{'%'},.true.)
1024         \textcolor{comment}{! Check that the parameter block names on the line matches the state set by the caller}
1025         \textcolor{keywordflow}{if} (iso>0 .and. trim(cs%blockName%name)==trim(line(:iso-1))) \textcolor{keywordflow}{then}
1026           fullpathparameter = .true.
1027           line = trim(line(iso+1:last)) \textcolor{comment}{! Strip away the block name for subsequent processing}
1028           last = len\_trim(line)
1029 \textcolor{keywordflow}{        endif}
1030 \textcolor{keywordflow}{      endif}
1031 
1032       \textcolor{comment}{! We should only interpret this line if this block is the active block}
1033       inwrongblock = .false.
1034       \textcolor{keywordflow}{if} (len\_trim(blockname)>0) \textcolor{keywordflow}{then} \textcolor{comment}{! In a namelist block in file}
1035         \textcolor{keywordflow}{if} (trim(cs%blockName%name)/=trim(blockname)) inwrongblock = .true. \textcolor{comment}{! Not in the required block}
1036 \textcolor{keywordflow}{      endif}
1037       \textcolor{keywordflow}{if} (len\_trim(cs%blockName%name)>0) \textcolor{keywordflow}{then} \textcolor{comment}{! In a namelist block in the model}
1038         \textcolor{keywordflow}{if} (trim(cs%blockName%name)/=trim(blockname)) inwrongblock = .true. \textcolor{comment}{! Not in the required block}
1039 \textcolor{keywordflow}{      endif}
1040 
1041       \textcolor{comment}{! Check for termination of a fortran namelist (with a '/')}
1042       \textcolor{keywordflow}{if} (line(last:last)==\textcolor{stringliteral}{'/'}) \textcolor{keywordflow}{then}
1043         \textcolor{keywordflow}{if} (len\_trim(blockname)==0 .and. is\_root\_pe()) \textcolor{keyword}{call }mom\_error(fatal, &
1044             \textcolor{stringliteral}{'get\_variable\_line: An extra namelist/block end was encountered. Line="'}// &
1045             trim(line(:last))//\textcolor{stringliteral}{'"'} )
1046         blockname = popblocklevel(blockname)
1047         last = last - 1 \textcolor{comment}{! Ignore the termination character from here on}
1048 \textcolor{keywordflow}{      endif}
1049       \textcolor{keywordflow}{if} (inwrongblock .and. .not. fullpathparameter) \textcolor{keywordflow}{then}
1050         \textcolor{keywordflow}{if} (index(\textcolor{stringliteral}{" "}//line(:last+1), \textcolor{stringliteral}{" "}//trim(varname)//\textcolor{stringliteral}{" "})>0) &
1051           \textcolor{keyword}{call }mom\_error(warning,\textcolor{stringliteral}{"MOM\_file\_parser : "}//trim(varname)// &
1052                \textcolor{stringliteral}{' found outside of block '}//trim(cs%blockName%name)//\textcolor{stringliteral}{'%. Ignoring.'})
1053         cycle
1054 \textcolor{keywordflow}{      endif}
1055 
1056       \textcolor{comment}{! Determine whether this line mentions the named parameter or not}
1057       \textcolor{keywordflow}{if} (index(\textcolor{stringliteral}{" "}//line(:last)//\textcolor{stringliteral}{" "}, \textcolor{stringliteral}{" "}//trim(varname)//\textcolor{stringliteral}{" "}) == 0) cycle
1058 
1059       \textcolor{comment}{! Detect keywords}
1060       found\_equals = .false.
1061       isd = index(line(:last), \textcolor{stringliteral}{"define"} )\textcolor{comment}{!; if (isd > 0) found\_define = .true.}
1062       isu = index(line(:last), \textcolor{stringliteral}{"undef"} )\textcolor{comment}{!; if (isu > 0) found\_undef = .true.}
1063       ise = index(line(:last), \textcolor{stringliteral}{" = "} ); \textcolor{keywordflow}{if} (ise > 1) found\_equals = .true.
1064       \textcolor{keywordflow}{if} (index(line(:last), \textcolor{stringliteral}{"#define "})==1) found\_define = .true.
1065       \textcolor{keywordflow}{if} (index(line(:last), \textcolor{stringliteral}{"#undef "})==1) found\_undef = .true.
1066 
1067       \textcolor{comment}{! Check for missing, mutually exclusive or incomplete keywords}
1068       \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}
1069         \textcolor{keywordflow}{if} (.not. (found\_define .or. found\_undef .or. found\_equals)) &
1070                \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"MOM\_file\_parser : the parameter name '"}// &
1071                  trim(varname)//\textcolor{stringliteral}{"' was found without define or undef."}// &
1072                  \textcolor{stringliteral}{" Line: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//&
1073                  \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{"."})
1074         \textcolor{keywordflow}{if} (found\_define .and. found\_undef) \textcolor{keyword}{call }mom\_error(fatal, &
1075                  \textcolor{stringliteral}{"MOM\_file\_parser : Both 'undef' and 'define' occur."}// &
1076                  \textcolor{stringliteral}{" Line: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//&
1077                  \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{"."})
1078         \textcolor{keywordflow}{if} (found\_equals .and. (found\_define .or. found\_undef)) &
1079                \textcolor{keyword}{call }mom\_error(fatal, &
1080                  \textcolor{stringliteral}{"MOM\_file\_parser : Both 'a=b' and 'undef/define' syntax occur."}// &
1081                  \textcolor{stringliteral}{" Line: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//&
1082                  \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{"."})
1083         \textcolor{keywordflow}{if} (found\_override .and. .not. (found\_define .or. found\_undef .or. found\_equals)) &
1084                \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"MOM\_file\_parser : override was found "}// &
1085                  \textcolor{stringliteral}{" without a define or undef."}// &
1086                  \textcolor{stringliteral}{" Line: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//&
1087                  \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{"."})
1088 \textcolor{keywordflow}{      endif}
1089 
1090       \textcolor{comment}{! Interpret the line and collect values, if any}
1091       \textcolor{keywordflow}{if} (found\_define) \textcolor{keywordflow}{then}
1092         \textcolor{comment}{! Move starting pointer to first letter of defined name.}
1093         is = isd + 5 + scan(line(isd+6:last), set)
1094 
1095         id = scan(line(is:last), \textcolor{stringliteral}{' '})  \textcolor{comment}{! Find space between name and value}
1096         \textcolor{keywordflow}{if} ( id == 0 ) \textcolor{keywordflow}{then}
1097           \textcolor{comment}{! There is no space so the name is simply being defined.}
1098           lname = trim(line(is:last))
1099           \textcolor{keywordflow}{if} (trim(lname) /= trim(varname)) cycle
1100           val\_str = \textcolor{stringliteral}{" "}
1101         \textcolor{keywordflow}{else}
1102           \textcolor{comment}{! There is a string or number after the name.}
1103           lname = trim(line(is:is+id-1))
1104           \textcolor{keywordflow}{if} (trim(lname) /= trim(varname)) cycle
1105           val\_str = trim(adjustl(line(is+id:last)))
1106 \textcolor{keywordflow}{        endif}
1107         found = .true. ; defined\_in\_line = .true.
1108       \textcolor{keywordflow}{elseif} (found\_undef) \textcolor{keywordflow}{then}
1109         \textcolor{comment}{! Move starting pointer to first letter of undefined name.}
1110         is = isu + 4 + scan(line(isu+5:last), set)
1111 
1112         id = scan(line(is:last), \textcolor{stringliteral}{' '})  \textcolor{comment}{! Find the first space after the name.}
1113         \textcolor{keywordflow}{if} (id > 0) last = is + id - 1
1114         lname = trim(line(is:last))
1115         \textcolor{keywordflow}{if} (trim(lname) /= trim(varname)) cycle
1116         val\_str = \textcolor{stringliteral}{" "}
1117         found = .true. ; defined\_in\_line = .false.
1118       \textcolor{keywordflow}{elseif} (found\_equals) \textcolor{keywordflow}{then}
1119         \textcolor{comment}{! Move starting pointer to first letter of defined name.}
1120         is = scan(line(1:ise), set)
1121         lname = trim(line(is:ise-1))
1122         \textcolor{keywordflow}{if} (trim(lname) /= trim(varname)) cycle
1123         val\_str = trim(adjustl(line(ise+3:last)))
1124         \textcolor{keywordflow}{if} (variablekindislogical) \textcolor{keywordflow}{then} \textcolor{comment}{! Special handling for logicals}
1125           \textcolor{keyword}{read}(val\_str(:len\_trim(val\_str)),*) defined\_in\_line
1126         \textcolor{keywordflow}{else}
1127           defined\_in\_line = .true.
1128 \textcolor{keywordflow}{        endif}
1129         found = .true.
1130       \textcolor{keywordflow}{else}
1131         \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"MOM\_file\_parser (non-root PE?): the parameter name '"}// &
1132            trim(varname)//\textcolor{stringliteral}{"' was found without an assignment, define or undef."}// &
1133            \textcolor{stringliteral}{" Line: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//\textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{"."})
1134 \textcolor{keywordflow}{      endif}
1135 
1136       \textcolor{comment}{! This line has now been used.}
1137       \textcolor{keyword}{call }flag\_line\_as\_read(cs%param\_data(ipf)%line\_used,count)
1138 
1139       \textcolor{comment}{! Detect inconsistencies}
1140       force\_cycle = .false.
1141       valueissame = (trim(val\_str) == trim(value\_string(max\_vals)))
1142       \textcolor{keywordflow}{if} (found\_override .and. (oval >= max\_vals)) \textcolor{keywordflow}{then}
1143         \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}
1144           \textcolor{keywordflow}{if} ((defined\_in\_line .neqv. defined) .or. .not. valueissame) \textcolor{keywordflow}{then}
1145             \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"MOM\_file\_parser : "}//trim(varname)// &
1146                      \textcolor{stringliteral}{" found with multiple inconsistent overrides."}// &
1147                      \textcolor{stringliteral}{" Line A: '"}//trim(value\_string(max\_vals))//\textcolor{stringliteral}{"'"}//&
1148                      \textcolor{stringliteral}{" Line B: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//&
1149                      \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{" caused the model failure."})
1150           \textcolor{keywordflow}{else}
1151             \textcolor{keyword}{call }mom\_error(warning,\textcolor{stringliteral}{"MOM\_file\_parser : "}//trim(varname)// &
1152                      \textcolor{stringliteral}{" over-ridden more times than is permitted."}// &
1153                      \textcolor{stringliteral}{" Line: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//&
1154                      \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{" is being ignored."})
1155 \textcolor{keywordflow}{          endif}
1156 \textcolor{keywordflow}{        endif}
1157         force\_cycle = .true.
1158 \textcolor{keywordflow}{      endif}
1159       \textcolor{keywordflow}{if} (.not.found\_override .and. (oval > 0)) \textcolor{keywordflow}{then}
1160         \textcolor{keywordflow}{if} (is\_root\_pe()) &
1161           \textcolor{keyword}{call }mom\_error(warning,\textcolor{stringliteral}{"MOM\_file\_parser : "}//trim(varname)// &
1162                    \textcolor{stringliteral}{" has already been over-ridden."}// &
1163                    \textcolor{stringliteral}{" Line: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//&
1164                    \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{" is being ignored."})
1165         force\_cycle = .true.
1166 \textcolor{keywordflow}{      endif}
1167       \textcolor{keywordflow}{if} (.not.found\_override .and. (ival >= max\_vals)) \textcolor{keywordflow}{then}
1168         \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}
1169           \textcolor{keywordflow}{if} ((defined\_in\_line .neqv. defined) .or. .not. valueissame) \textcolor{keywordflow}{then}
1170             \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"MOM\_file\_parser : "}//trim(varname)// &
1171                      \textcolor{stringliteral}{" found with multiple inconsistent definitions."}// &
1172                      \textcolor{stringliteral}{" Line A: '"}//trim(value\_string(max\_vals))//\textcolor{stringliteral}{"'"}//&
1173                      \textcolor{stringliteral}{" Line B: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//&
1174                      \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{" caused the model failure."})
1175           \textcolor{keywordflow}{else}
1176             \textcolor{keyword}{call }mom\_error(warning,\textcolor{stringliteral}{"MOM\_file\_parser : "}//trim(varname)// &
1177                      \textcolor{stringliteral}{" occurs more times than is permitted."}// &
1178                      \textcolor{stringliteral}{" Line: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//&
1179                      \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{" is being ignored."})
1180 \textcolor{keywordflow}{          endif}
1181 \textcolor{keywordflow}{        endif}
1182         force\_cycle = .true.
1183 \textcolor{keywordflow}{      endif}
1184       \textcolor{keywordflow}{if} (force\_cycle) cycle
1185 
1186       \textcolor{comment}{! Store new values}
1187       \textcolor{keywordflow}{if} (found\_override) \textcolor{keywordflow}{then}
1188         oval = oval + 1
1189         value\_string(oval) = trim(val\_str)
1190         defined = defined\_in\_line
1191         \textcolor{keywordflow}{if} (verbose > 0 .and. ival > 0 .and. is\_root\_pe() .and. &
1192             .not. overridewarninghasbeenissued(cs%chain, trim(varname)) ) &
1193           \textcolor{keyword}{call }mom\_error(warning,\textcolor{stringliteral}{"MOM\_file\_parser : "}//trim(varname)// &
1194                  \textcolor{stringliteral}{" over-ridden.  Line: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//&
1195                  \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{"."})
1196       \textcolor{keywordflow}{else} \textcolor{comment}{! (.not. found\_overide)}
1197         ival = ival + 1
1198         value\_string(ival) = trim(val\_str)
1199         defined = defined\_in\_line
1200         \textcolor{keywordflow}{if} (verbose > 1 .and. is\_root\_pe()) &
1201           \textcolor{keyword}{call }mom\_error(warning,\textcolor{stringliteral}{"MOM\_file\_parser : "}//trim(varname)// &
1202                  \textcolor{stringliteral}{" set.  Line: '"}//trim(line(:last))//\textcolor{stringliteral}{"'"}//&
1203                  \textcolor{stringliteral}{" in file "}//trim(filename)//\textcolor{stringliteral}{"."})
1204 \textcolor{keywordflow}{      endif}
1205 
1206 \textcolor{keywordflow}{    enddo} \textcolor{comment}{! CS%param\_data(ipf)%num\_lines}
1207 
1208     \textcolor{keywordflow}{if} (len\_trim(blockname)>0 .and. is\_root\_pe()) \textcolor{keyword}{call }mom\_error(fatal, &
1209       \textcolor{stringliteral}{'A namelist/parameter block was not closed. Last open block appears '}// &
1210       \textcolor{stringliteral}{'to be "'}//trim(blockname)//\textcolor{stringliteral}{'".'})
1211 
1212 \textcolor{keywordflow}{  enddo} paramfile\_loop
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}}
\subsubsection{\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{\tt 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}
474   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{intent(in)} :: string\textcolor{comment}{  !< The input string to process}
475   \textcolor{keywordtype}{integer}                      :: lastNonCommentIndex
476 
477   \textcolor{comment}{! Local variables}
478   \textcolor{keywordtype}{integer} :: icom, last
479 
480   \textcolor{comment}{! This subroutine is the only place where a comment needs to be defined}
481   last = len\_trim(string)
482   icom = index(string(:last), \textcolor{stringliteral}{"!"}) ; \textcolor{keywordflow}{if} (icom > 0) last = icom-1 \textcolor{comment}{! F90 style}
483   icom = index(string(:last), \textcolor{stringliteral}{"//"}) ; \textcolor{keywordflow}{if} (icom > 0) last = icom-1 \textcolor{comment}{! C++ style}
484   icom = index(string(:last), \textcolor{stringliteral}{"/*"}) ; \textcolor{keywordflow}{if} (icom > 0) last = icom-1 \textcolor{comment}{! C style}
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}}
\subsubsection{\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{\tt 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}
490   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{intent(in)} :: string\textcolor{comment}{  !< The input string to process}
491   \textcolor{keywordtype}{integer}                      :: lastNonCommentNonBlank
492 
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em modulename} & The name of the calling module\\
\hline
\mbox{\tt in}  & {\em varname} & The name of the parameter to log\\
\hline
\mbox{\tt in}  & {\em value} & The value of the parameter to log\\
\hline
\mbox{\tt in}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file\\
\hline
\mbox{\tt in}  & {\em units} & The units of this parameter\\
\hline
\mbox{\tt in}  & {\em default} & The default value of the parameter\\
\hline
\mbox{\tt in}  & {\em layoutparam} & If present and true, this parameter is logged in the layout parameter file\\
\hline
\mbox{\tt in}  & {\em debuggingparam} & If present and true, this parameter is logged in the debugging parameter file\\
\hline
\mbox{\tt 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}
1470   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
1471 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
1472   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: modulename\textcolor{comment}{ !< The name of the calling module}
1473   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The name of the parameter to log}
1474   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter to log}
1475   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: desc\textcolor{comment}{    !< A description of this variable; if not}
1476 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}
1477   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: units\textcolor{comment}{   !< The units of this parameter}
1478   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: default\textcolor{comment}{ !< The default value of the parameter}
1479   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: layoutParam\textcolor{comment}{ !< If present and true, this parameter is}
1480 \textcolor{comment}{                                         !! logged in the layout parameter file}
1481   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}
1482 \textcolor{comment}{                                         !! logged in the debugging parameter file}
1483   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: like\_default\textcolor{comment}{ !< If present and true, log this parameter as}
1484 \textcolor{comment}{                                         !! though it has the default value, even if there is no default.}
1485 
1486   \textcolor{keywordtype}{character(len=1024)} :: mesg, myunits
1487 
1488   \textcolor{keyword}{write}(mesg, \textcolor{stringliteral}{'("  ",a," ",a,": ",a)'}) &
1489     trim(modulename), trim(varname), trim(\textcolor{keywordtype}{value})
1490   \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}
1491     \textcolor{keywordflow}{if} (cs%log\_open) \textcolor{keyword}{write}(cs%stdlog,\textcolor{stringliteral}{'(a)'}) trim(mesg)
1492     \textcolor{keywordflow}{if} (cs%log\_to\_stdout) \textcolor{keyword}{write}(cs%stdout,\textcolor{stringliteral}{'(a)'}) trim(mesg)
1493 \textcolor{keywordflow}{  endif}
1494 
1495   myunits=\textcolor{stringliteral}{" "}; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(units)) \textcolor{keyword}{write}(myunits(1:1024),\textcolor{stringliteral}{'(A)'}) trim(units)
1496   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(desc)) &
1497     \textcolor{keyword}{call }doc\_param(cs%doc, varname, desc, myunits, \textcolor{keywordtype}{value}, default, &
1498                    layoutparam=layoutparam, debuggingparam=debuggingparam, like\_default=like\_default)
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em modulename} & The name of the module using this parameter\\
\hline
\mbox{\tt in}  & {\em varname} & The name of the parameter to log\\
\hline
\mbox{\tt in}  & {\em value} & The value of the parameter to log\\
\hline
\mbox{\tt in}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file\\
\hline
\mbox{\tt in}  & {\em units} & The units of this parameter\\
\hline
\mbox{\tt in}  & {\em default} & The default value of the parameter\\
\hline
\mbox{\tt in}  & {\em layoutparam} & If present and true, this parameter is logged in the layout parameter file\\
\hline
\mbox{\tt in}  & {\em debuggingparam} & If present and true, this parameter is logged in the debugging parameter file\\
\hline
\mbox{\tt 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}
1293   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
1294 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
1295   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: modulename\textcolor{comment}{ !< The name of the module using this parameter}
1296   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The name of the parameter to log}
1297   \textcolor{keywordtype}{integer},                    \textcolor{keywordtype}{intent(in)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter to log}
1298   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: desc\textcolor{comment}{    !< A description of this variable; if not}
1299 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}
1300   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: units\textcolor{comment}{   !< The units of this parameter}
1301   \textcolor{keywordtype}{integer},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: default\textcolor{comment}{ !< The default value of the parameter}
1302   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: layoutParam\textcolor{comment}{ !< If present and true, this parameter is}
1303 \textcolor{comment}{                                         !! logged in the layout parameter file}
1304   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}
1305 \textcolor{comment}{                                         !! logged in the debugging parameter file}
1306   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: like\_default\textcolor{comment}{ !< If present and true, log this parameter as}
1307 \textcolor{comment}{                                         !! though it has the default value, even if there is no default.}
1308 
1309   \textcolor{keywordtype}{character(len=240)} :: mesg, myunits
1310 
1311   \textcolor{keyword}{write}(mesg, \textcolor{stringliteral}{'("  ",a," ",a,": ",a)'}) trim(modulename), trim(varname), trim(left\_int(\textcolor{keywordtype}{value}))
1312   \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}
1313     \textcolor{keywordflow}{if} (cs%log\_open) \textcolor{keyword}{write}(cs%stdlog,\textcolor{stringliteral}{'(a)'}) trim(mesg)
1314     \textcolor{keywordflow}{if} (cs%log\_to\_stdout) \textcolor{keyword}{write}(cs%stdout,\textcolor{stringliteral}{'(a)'}) trim(mesg)
1315 \textcolor{keywordflow}{  endif}
1316 
1317   myunits=\textcolor{stringliteral}{" "}; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(units)) \textcolor{keyword}{write}(myunits(1:240),\textcolor{stringliteral}{'(A)'}) trim(units)
1318   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(desc)) &
1319     \textcolor{keyword}{call }doc\_param(cs%doc, varname, desc, myunits, \textcolor{keywordtype}{value}, default, &
1320                    layoutparam=layoutparam, debuggingparam=debuggingparam, like\_default=like\_default)
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em modulename} & The name of the module using this parameter\\
\hline
\mbox{\tt in}  & {\em varname} & The name of the parameter to log\\
\hline
\mbox{\tt in}  & {\em value} & The value of the parameter to log\\
\hline
\mbox{\tt in}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file\\
\hline
\mbox{\tt in}  & {\em units} & The units of this parameter\\
\hline
\mbox{\tt in}  & {\em default} & The default value of the parameter\\
\hline
\mbox{\tt in}  & {\em layoutparam} & If present and true, this parameter is logged in the layout parameter file\\
\hline
\mbox{\tt in}  & {\em debuggingparam} & If present and true, this parameter is logged in the debugging parameter file\\
\hline
\mbox{\tt 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}
1327   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
1328 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
1329   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: modulename\textcolor{comment}{ !< The name of the module using this parameter}
1330   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The name of the parameter to log}
1331   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{dimension(:)},      \textcolor{keywordtype}{intent(in)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter to log}
1332   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: desc\textcolor{comment}{    !< A description of this variable; if not}
1333 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}
1334   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: units\textcolor{comment}{   !< The units of this parameter}
1335   \textcolor{keywordtype}{integer},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: default\textcolor{comment}{ !< The default value of the parameter}
1336   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: layoutParam\textcolor{comment}{ !< If present and true, this parameter is}
1337 \textcolor{comment}{                                         !! logged in the layout parameter file}
1338   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}
1339 \textcolor{comment}{                                         !! logged in the debugging parameter file}
1340   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: like\_default\textcolor{comment}{ !< If present and true, log this parameter as}
1341 \textcolor{comment}{                                         !! though it has the default value, even if there is no default.}
1342 
1343   \textcolor{keywordtype}{character(len=1320)} :: mesg
1344   \textcolor{keywordtype}{character(len=240)} :: myunits
1345 
1346   \textcolor{keyword}{write}(mesg, \textcolor{stringliteral}{'("  ",a," ",a,": ",A)'}) trim(modulename), trim(varname), trim(left\_ints(\textcolor{keywordtype}{value}))
1347   \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}
1348     \textcolor{keywordflow}{if} (cs%log\_open) \textcolor{keyword}{write}(cs%stdlog,\textcolor{stringliteral}{'(a)'}) trim(mesg)
1349     \textcolor{keywordflow}{if} (cs%log\_to\_stdout) \textcolor{keyword}{write}(cs%stdout,\textcolor{stringliteral}{'(a)'}) trim(mesg)
1350 \textcolor{keywordflow}{  endif}
1351 
1352   myunits=\textcolor{stringliteral}{" "}; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(units)) \textcolor{keyword}{write}(myunits(1:240),\textcolor{stringliteral}{'(A)'}) trim(units)
1353   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(desc)) &
1354     \textcolor{keyword}{call }doc\_param(cs%doc, varname, desc, myunits, \textcolor{keywordtype}{value}, default, &
1355                    layoutparam=layoutparam, debuggingparam=debuggingparam, like\_default=like\_default)
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em modulename} & The name of the calling module\\
\hline
\mbox{\tt in}  & {\em varname} & The name of the parameter to log\\
\hline
\mbox{\tt in}  & {\em value} & The value of the parameter to log\\
\hline
\mbox{\tt in}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file\\
\hline
\mbox{\tt in}  & {\em units} & The units of this parameter\\
\hline
\mbox{\tt in}  & {\em default} & The default value of the parameter\\
\hline
\mbox{\tt in}  & {\em layoutparam} & If present and true, this parameter is logged in the layout parameter file\\
\hline
\mbox{\tt in}  & {\em debuggingparam} & If present and true, this parameter is logged in the debugging parameter file\\
\hline
\mbox{\tt 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}
1432   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
1433 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
1434   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: modulename\textcolor{comment}{ !< The name of the calling module}
1435   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The name of the parameter to log}
1436   \textcolor{keywordtype}{logical},                    \textcolor{keywordtype}{intent(in)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter to log}
1437   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: desc\textcolor{comment}{    !< A description of this variable; if not}
1438 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}
1439   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: units\textcolor{comment}{   !< The units of this parameter}
1440   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: default\textcolor{comment}{ !< The default value of the parameter}
1441   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: layoutParam\textcolor{comment}{ !< If present and true, this parameter is}
1442 \textcolor{comment}{                                         !! logged in the layout parameter file}
1443   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}
1444 \textcolor{comment}{                                         !! logged in the debugging parameter file}
1445   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: like\_default\textcolor{comment}{ !< If present and true, log this parameter as}
1446 \textcolor{comment}{                                         !! though it has the default value, even if there is no default.}
1447 
1448   \textcolor{keywordtype}{character(len=240)} :: mesg, myunits
1449 
1450   \textcolor{keywordflow}{if} (\textcolor{keywordtype}{value}) \textcolor{keywordflow}{then}
1451     \textcolor{keyword}{write}(mesg, \textcolor{stringliteral}{'("  ",a," ",a,": True")'}) trim(modulename), trim(varname)
1452   \textcolor{keywordflow}{else}
1453     \textcolor{keyword}{write}(mesg, \textcolor{stringliteral}{'("  ",a," ",a,": False")'}) trim(modulename), trim(varname)
1454 \textcolor{keywordflow}{  endif}
1455   \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}
1456     \textcolor{keywordflow}{if} (cs%log\_open) \textcolor{keyword}{write}(cs%stdlog,\textcolor{stringliteral}{'(a)'}) trim(mesg)
1457     \textcolor{keywordflow}{if} (cs%log\_to\_stdout) \textcolor{keyword}{write}(cs%stdout,\textcolor{stringliteral}{'(a)'}) trim(mesg)
1458 \textcolor{keywordflow}{  endif}
1459 
1460   myunits=\textcolor{stringliteral}{"Boolean"}; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(units)) \textcolor{keyword}{write}(myunits(1:240),\textcolor{stringliteral}{'(A)'}) trim(units)
1461   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(desc)) &
1462     \textcolor{keyword}{call }doc\_param(cs%doc, varname, desc, myunits, \textcolor{keywordtype}{value}, default, &
1463                    layoutparam=layoutparam, debuggingparam=debuggingparam, like\_default=like\_default)
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em modulename} & The name of the calling module\\
\hline
\mbox{\tt in}  & {\em varname} & The name of the parameter to log\\
\hline
\mbox{\tt in}  & {\em value} & The value of the parameter to log\\
\hline
\mbox{\tt in}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file\\
\hline
\mbox{\tt in}  & {\em units} & The units of this parameter\\
\hline
\mbox{\tt in}  & {\em default} & The default value of the parameter\\
\hline
\mbox{\tt in}  & {\em debuggingparam} & If present and true, this parameter is logged in the debugging parameter file\\
\hline
\mbox{\tt 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}
1362   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
1363 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
1364   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: modulename\textcolor{comment}{ !< The name of the calling module}
1365   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The name of the parameter to log}
1366   \textcolor{keywordtype}{real},                       \textcolor{keywordtype}{intent(in)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter to log}
1367   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: desc\textcolor{comment}{    !< A description of this variable; if not}
1368 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}
1369   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: units\textcolor{comment}{   !< The units of this parameter}
1370   \textcolor{keywordtype}{real},             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: default\textcolor{comment}{ !< The default value of the parameter}
1371   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}
1372 \textcolor{comment}{                                         !! logged in the debugging parameter file}
1373   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: like\_default\textcolor{comment}{ !< If present and true, log this parameter as}
1374 \textcolor{comment}{                                         !! though it has the default value, even if there is no default.}
1375 
1376   \textcolor{keywordtype}{character(len=240)} :: mesg, myunits
1377 
1378   \textcolor{keyword}{write}(mesg, \textcolor{stringliteral}{'("  ",a," ",a,": ",a)'}) &
1379     trim(modulename), trim(varname), trim(left\_real(\textcolor{keywordtype}{value}))
1380   \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}
1381     \textcolor{keywordflow}{if} (cs%log\_open) \textcolor{keyword}{write}(cs%stdlog,\textcolor{stringliteral}{'(a)'}) trim(mesg)
1382     \textcolor{keywordflow}{if} (cs%log\_to\_stdout) \textcolor{keyword}{write}(cs%stdout,\textcolor{stringliteral}{'(a)'}) trim(mesg)
1383 \textcolor{keywordflow}{  endif}
1384 
1385   myunits=\textcolor{stringliteral}{"not defined"}; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(units)) \textcolor{keyword}{write}(myunits(1:240),\textcolor{stringliteral}{'(A)'}) trim(units)
1386   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(desc)) &
1387     \textcolor{keyword}{call }doc\_param(cs%doc, varname, desc, myunits, \textcolor{keywordtype}{value}, default, &
1388                    debuggingparam=debuggingparam, like\_default=like\_default)
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em modulename} & The name of the calling module\\
\hline
\mbox{\tt in}  & {\em varname} & The name of the parameter to log\\
\hline
\mbox{\tt in}  & {\em value} & The value of the parameter to log\\
\hline
\mbox{\tt in}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file\\
\hline
\mbox{\tt in}  & {\em units} & The units of this parameter\\
\hline
\mbox{\tt in}  & {\em default} & The default value of the parameter\\
\hline
\mbox{\tt in}  & {\em debuggingparam} & If present and true, this parameter is logged in the debugging parameter file\\
\hline
\mbox{\tt 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}
1395   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
1396 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
1397   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: modulename\textcolor{comment}{ !< The name of the calling module}
1398   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The name of the parameter to log}
1399   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)},         \textcolor{keywordtype}{intent(in)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter to log}
1400   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: desc\textcolor{comment}{    !< A description of this variable; if not}
1401 \textcolor{comment}{                                             !! present, this parameter is not written to a doc file}
1402   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: units\textcolor{comment}{   !< The units of this parameter}
1403   \textcolor{keywordtype}{real},             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: default\textcolor{comment}{ !< The default value of the parameter}
1404   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}
1405 \textcolor{comment}{                                         !! logged in the debugging parameter file}
1406   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: like\_default\textcolor{comment}{ !< If present and true, log this parameter as}
1407 \textcolor{comment}{                                         !! though it has the default value, even if there is no default.}
1408 
1409   \textcolor{keywordtype}{character(len=1320)} :: mesg
1410   \textcolor{keywordtype}{character(len=240)} :: myunits
1411 
1412  \textcolor{comment}{!write(mesg, '("  ",a," ",a,": ",ES19.12,99(",",ES19.12))') &}
1413  \textcolor{comment}{!write(mesg, '("  ",a," ",a,": ",G,99(",",G))') &}
1414  \textcolor{comment}{!  trim(modulename), trim(varname), value}
1415   \textcolor{keyword}{write}(mesg, \textcolor{stringliteral}{'("  ",a," ",a,": ",a)'}) &
1416     trim(modulename), trim(varname), trim(left\_reals(\textcolor{keywordtype}{value}))
1417   \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}
1418     \textcolor{keywordflow}{if} (cs%log\_open) \textcolor{keyword}{write}(cs%stdlog,\textcolor{stringliteral}{'(a)'}) trim(mesg)
1419     \textcolor{keywordflow}{if} (cs%log\_to\_stdout) \textcolor{keyword}{write}(cs%stdout,\textcolor{stringliteral}{'(a)'}) trim(mesg)
1420 \textcolor{keywordflow}{  endif}
1421 
1422   myunits=\textcolor{stringliteral}{"not defined"}; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(units)) \textcolor{keyword}{write}(myunits(1:240),\textcolor{stringliteral}{'(A)'}) trim(units)
1423   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(desc)) &
1424     \textcolor{keyword}{call }doc\_param(cs%doc, varname, desc, myunits, \textcolor{keywordtype}{value}, default, &
1425                    debuggingparam=debuggingparam, like\_default=like\_default)
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em modulename} & The name of the calling module\\
\hline
\mbox{\tt in}  & {\em varname} & The name of the parameter to log\\
\hline
\mbox{\tt in}  & {\em value} & The value of the parameter to log\\
\hline
\mbox{\tt in}  & {\em desc} & A description of this variable; if not present, this parameter is not written to a doc file\\
\hline
\mbox{\tt in}  & {\em units} & The units of this parameter\\
\hline
\mbox{\tt in}  & {\em default} & The default value of the parameter\\
\hline
\mbox{\tt in}  & {\em timeunit} & The number of seconds in a time unit for real-\/number output.\\
\hline
\mbox{\tt in}  & {\em log\+\_\+date} & If true, log the time\+\_\+type in date format. If missing the default is false.\\
\hline
\mbox{\tt in}  & {\em layoutparam} & If present and true, this parameter is logged in the layout parameter file\\
\hline
\mbox{\tt in}  & {\em debuggingparam} & If present and true, this parameter is logged in the debugging parameter file\\
\hline
\mbox{\tt 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}
1506   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
1507 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
1508   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: modulename\textcolor{comment}{ !< The name of the calling module}
1509   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The name of the parameter to log}
1510   \textcolor{keywordtype}{type}(time\_type),            \textcolor{keywordtype}{intent(in)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter to log}
1511   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: desc\textcolor{comment}{    !< A description of this variable; if not}
1512 \textcolor{comment}{                                         !! present, this parameter is not written to a doc file}
1513   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: units\textcolor{comment}{   !< The units of this parameter}
1514   \textcolor{keywordtype}{type}(time\_type),  \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: default\textcolor{comment}{ !< The default value of the parameter}
1515   \textcolor{keywordtype}{real},             \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: timeunit\textcolor{comment}{ !< The number of seconds in a time unit for}
1516 \textcolor{comment}{                                         !! real-number output.}
1517   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: log\_date\textcolor{comment}{   !< If true, log the time\_type in date format.}
1518 \textcolor{comment}{                                         !! If missing the default is false.}
1519   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: layoutParam\textcolor{comment}{ !< If present and true, this parameter is}
1520 \textcolor{comment}{                                         !! logged in the layout parameter file}
1521   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: debuggingParam\textcolor{comment}{ !< If present and true, this parameter is}
1522 \textcolor{comment}{                                         !! logged in the debugging parameter file}
1523   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: like\_default\textcolor{comment}{ !< If present and true, log this parameter as}
1524 \textcolor{comment}{                                         !! though it has the default value, even if there is no default.}
1525 
1526   \textcolor{comment}{! Local variables}
1527   \textcolor{keywordtype}{real} :: real\_time, real\_default
1528   \textcolor{keywordtype}{logical} :: use\_timeunit, date\_format
1529   \textcolor{keywordtype}{character(len=240)} :: mesg, myunits
1530   \textcolor{keywordtype}{character(len=80)} :: date\_string, default\_string
1531   \textcolor{keywordtype}{integer} :: days, secs, ticks, ticks\_per\_sec
1532 
1533   use\_timeunit = .false.
1534   date\_format = .false. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(log\_date)) date\_format = log\_date
1535 
1536   \textcolor{keyword}{call }get\_time(\textcolor{keywordtype}{value}, secs, days, ticks)
1537 
1538   \textcolor{keywordflow}{if} (ticks == 0) \textcolor{keywordflow}{then}
1539     \textcolor{keyword}{write}(mesg, \textcolor{stringliteral}{'("  ",a," ",a," (Time): ",i0,":",i0)'}) trim(modulename), &
1540        trim(varname), days, secs
1541   \textcolor{keywordflow}{else}
1542     \textcolor{keyword}{write}(mesg, \textcolor{stringliteral}{'("  ",a," ",a," (Time): ",i0,":",i0,":",i0)'}) trim(modulename), &
1543        trim(varname), days, secs, ticks
1544 \textcolor{keywordflow}{  endif}
1545   \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}
1546     \textcolor{keywordflow}{if} (cs%log\_open) \textcolor{keyword}{write}(cs%stdlog,\textcolor{stringliteral}{'(a)'}) trim(mesg)
1547     \textcolor{keywordflow}{if} (cs%log\_to\_stdout) \textcolor{keyword}{write}(cs%stdout,\textcolor{stringliteral}{'(a)'}) trim(mesg)
1548 \textcolor{keywordflow}{  endif}
1549 
1550   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(desc)) \textcolor{keywordflow}{then}
1551     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(timeunit)) use\_timeunit = (timeunit > 0.0)
1552     \textcolor{keywordflow}{if} (date\_format) \textcolor{keywordflow}{then}
1553       myunits=\textcolor{stringliteral}{'[date]'}
1554 
1555       date\_string = convert\_date\_to\_string(\textcolor{keywordtype}{value})
1556       \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) \textcolor{keywordflow}{then}
1557         default\_string = convert\_date\_to\_string(default)
1558         \textcolor{keyword}{call }doc\_param(cs%doc, varname, desc, myunits, date\_string, &
1559                        default=default\_string, layoutparam=layoutparam, &
1560                        debuggingparam=debuggingparam, like\_default=like\_default)
1561       \textcolor{keywordflow}{else}
1562         \textcolor{keyword}{call }doc\_param(cs%doc, varname, desc, myunits, date\_string, &
1563                        layoutparam=layoutparam, debuggingparam=debuggingparam, like\_default=like\_default)
1564 \textcolor{keywordflow}{      endif}
1565     \textcolor{keywordflow}{elseif} (use\_timeunit) \textcolor{keywordflow}{then}
1566       \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(units)) \textcolor{keywordflow}{then}
1567         \textcolor{keyword}{write}(myunits(1:240),\textcolor{stringliteral}{'(A)'}) trim(units)
1568       \textcolor{keywordflow}{else}
1569         \textcolor{keywordflow}{if} (abs(timeunit-1.0) < 0.01) \textcolor{keywordflow}{then} ; myunits = \textcolor{stringliteral}{"seconds"}
1570         \textcolor{keywordflow}{elseif} (abs(timeunit-3600.0) < 1.0) \textcolor{keywordflow}{then} ; myunits = \textcolor{stringliteral}{"hours"}
1571         \textcolor{keywordflow}{elseif} (abs(timeunit-86400.0) < 1.0) \textcolor{keywordflow}{then} ; myunits = \textcolor{stringliteral}{"days"}
1572         \textcolor{keywordflow}{elseif} (abs(timeunit-3.1e7) < 1.0e6) \textcolor{keywordflow}{then} ; myunits = \textcolor{stringliteral}{"years"}
1573         \textcolor{keywordflow}{else} ; \textcolor{keyword}{write}(myunits,\textcolor{stringliteral}{'(es8.2," sec")'}) timeunit ;\textcolor{keywordflow}{ endif}
1574 \textcolor{keywordflow}{      endif}
1575       real\_time = (86400.0/timeunit)*days + secs/timeunit
1576       \textcolor{keywordflow}{if} (ticks > 0) real\_time = real\_time + &
1577                            \textcolor{keywordtype}{real(ticks)} / (timeunit*get\_ticks\_per\_second())
1578       \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(default)) \textcolor{keywordflow}{then}
1579         \textcolor{keyword}{call }get\_time(default, secs, days, ticks)
1580         real\_default = (86400.0/timeunit)*days + secs/timeunit
1581         \textcolor{keywordflow}{if} (ticks > 0) real\_default = real\_default + &
1582                            \textcolor{keywordtype}{real(ticks)} / (timeunit*get\_ticks\_per\_second())
1583         \textcolor{keyword}{call }doc\_param(cs%doc, varname, desc, myunits, real\_time, real\_default, like\_default=like\_default)
1584       \textcolor{keywordflow}{else}
1585         \textcolor{keyword}{call }doc\_param(cs%doc, varname, desc, myunits, real\_time, like\_default=like\_default)
1586 \textcolor{keywordflow}{      endif}
1587     \textcolor{keywordflow}{else}
1588       \textcolor{keyword}{call }doc\_param(cs%doc, varname, desc, \textcolor{keywordtype}{value}, default, units=units, like\_default=like\_default)
1589 \textcolor{keywordflow}{    endif}
1590 \textcolor{keywordflow}{  endif}
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}}
\subsubsection{\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{\tt in}  & {\em cs} & File parser type\\
\hline
\mbox{\tt in}  & {\em modulename} & Name of calling module\\
\hline
\mbox{\tt in}  & {\em version} & Version string of module\\
\hline
\mbox{\tt in}  & {\em desc} & Module description\\
\hline
\mbox{\tt 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{\tt in}  & {\em all\+\_\+default} & If true, all parameters take their default values.\\
\hline
\mbox{\tt in}  & {\em layout} & If present and true, this module has layout parameters.\\
\hline
\mbox{\tt 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}
1253   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{         !< File parser type}
1254   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: modulename\textcolor{comment}{ !< Name of calling module}
1255   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: version\textcolor{comment}{    !< Version string of module}
1256   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: desc\textcolor{comment}{       !< Module description}
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}
1258 \textcolor{comment}{                                                       !! ...\_doc.all files, even if this module also has
       layout}
1259 \textcolor{comment}{                                                       !! or debugging parameters.}
1260   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: all\_default\textcolor{comment}{ !< If true, all parameters take their default
       values.}
1261   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: layout\textcolor{comment}{     !< If present and true, this module has layout
       parameters.}
1262   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: debugging\textcolor{comment}{  !< If present and true, this module has debugging
       parameters.}
1263   \textcolor{comment}{! Local variables}
1264   \textcolor{keywordtype}{character(len=240)} :: mesg
1265 
1266   mesg = trim(modulename)//\textcolor{stringliteral}{": "}//trim(version)
1267   \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}
1268     \textcolor{keywordflow}{if} (cs%log\_open) \textcolor{keyword}{write}(cs%stdlog,\textcolor{stringliteral}{'(a)'}) trim(mesg)
1269     \textcolor{keywordflow}{if} (cs%log\_to\_stdout) \textcolor{keyword}{write}(cs%stdout,\textcolor{stringliteral}{'(a)'}) trim(mesg)
1270 \textcolor{keywordflow}{  endif}
1271 
1272   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(desc)) \textcolor{keyword}{call }doc\_module(cs%doc, modulename, desc, log\_to\_all, all\_default, layout, debugging)
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}}
\subsubsection{\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{\tt in}  & {\em modulename} & Name of calling module\\
\hline
\mbox{\tt in}  & {\em version} & Version string of module \\
\hline
\end{DoxyParams}


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


\begin{DoxyCode}
1278   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: modulename\textcolor{comment}{ !< Name of calling module}
1279   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: version\textcolor{comment}{    !< Version string of module}
1280   \textcolor{comment}{! Local variables}
1281   \textcolor{keywordtype}{character(len=240)} :: mesg
1282 
1283   mesg = trim(modulename)//\textcolor{stringliteral}{": "}//trim(version)
1284   \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keywordflow}{then}
1285     \textcolor{keyword}{write}(stdlog(),\textcolor{stringliteral}{'(a)'}) trim(mesg)
1286 \textcolor{keywordflow}{  endif}
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}}
\subsubsection{\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{\tt in}  & {\em filename} & An input file name, optionally with the full path\\
\hline
\mbox{\tt 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{\tt in}  & {\em checkable} & If this is false, it disables checks of this file for unused parameters. The default is True.\\
\hline
\mbox{\tt 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{\tt 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}
117   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: filename\textcolor{comment}{ !< An input file name, optionally with the full path}
118   \textcolor{keywordtype}{type}(param\_file\_type),   \textcolor{keywordtype}{intent(inout)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
119 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
120   \textcolor{keywordtype}{logical},          \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: checkable\textcolor{comment}{   !< If this is false, it disables checks of this}
121 \textcolor{comment}{                                         !! file for unused parameters.  The default is True.}
122   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: component\textcolor{comment}{   !< If present, this component name is used}
123 \textcolor{comment}{                                         !! to generate parameter documentation file names; the default
       is"MOM"}
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}
125 \textcolor{comment}{                                         !! the documentation files.  The default is effectively './'.}
126 
127   \textcolor{comment}{! Local variables}
128   \textcolor{keywordtype}{logical} :: file\_exists, unit\_in\_use, Netcdf\_file, may\_check
129   \textcolor{keywordtype}{integer} :: ios, iounit, strlen, i
130   \textcolor{keywordtype}{character(len=240)} :: doc\_path
131   \textcolor{keywordtype}{type}(parameter\_block), \textcolor{keywordtype}{pointer} :: block => null()
132 
133   may\_check = .true. ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(checkable)) may\_check = checkable
134 
135   \textcolor{comment}{! Check for non-blank filename}
136   strlen = len\_trim(filename)
137   \textcolor{keywordflow}{if} (strlen == 0) \textcolor{keywordflow}{then}
138     \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"open\_param\_file: Input file has not been specified."})
139 \textcolor{keywordflow}{  endif}
140 
141   \textcolor{comment}{! Check that this file has not already been opened}
142   \textcolor{keywordflow}{if} (cs%nfiles > 0) \textcolor{keywordflow}{then}
143     \textcolor{keyword}{inquire}(file=trim(filename), number=iounit)
144     \textcolor{keywordflow}{if} (iounit /= -1) \textcolor{keywordflow}{then}
145       \textcolor{keywordflow}{do} i = 1, cs%nfiles
146         \textcolor{keywordflow}{if} (cs%iounit(i) == iounit) \textcolor{keywordflow}{then}
147           \textcolor{keywordflow}{if} (trim(cs%filename(1)) /= trim(filename)) \textcolor{keywordflow}{then}
148             \textcolor{keyword}{call }mom\_error(fatal, &
149               \textcolor{stringliteral}{"open\_param\_file: internal inconsistency! "}//trim(filename)// &
150               \textcolor{stringliteral}{" is registered as open but has the wrong unit number!"})
151           \textcolor{keywordflow}{else}
152             \textcolor{keyword}{call }mom\_error(warning, &
153               \textcolor{stringliteral}{"open\_param\_file: file "}//trim(filename)// &
154               \textcolor{stringliteral}{" has already been opened. This should NOT happen!"}// &
155               \textcolor{stringliteral}{" Did you specify the same file twice in a namelist?"})
156             \textcolor{keywordflow}{return}
157 \textcolor{keywordflow}{          endif} \textcolor{comment}{! filenames}
158 \textcolor{keywordflow}{        endif} \textcolor{comment}{! unit numbers}
159 \textcolor{keywordflow}{      enddo} \textcolor{comment}{! i}
160 \textcolor{keywordflow}{    endif}
161 \textcolor{keywordflow}{  endif}
162 
163   \textcolor{comment}{! Check that the file exists to readstdlog}
164   \textcolor{keyword}{inquire}(file=trim(filename), exist=file\_exists)
165   \textcolor{keywordflow}{if} (.not.file\_exists) \textcolor{keyword}{call }mom\_error(fatal, &
166       \textcolor{stringliteral}{"open\_param\_file: Input file "}// trim(filename)//\textcolor{stringliteral}{" does not exist."})
167 
168   netcdf\_file = .false.
169   \textcolor{keywordflow}{if} (strlen > 3) \textcolor{keywordflow}{then}
170     \textcolor{keywordflow}{if} (filename(strlen-2:strlen) == \textcolor{stringliteral}{".nc"}) netcdf\_file = .true.
171 \textcolor{keywordflow}{  endif}
172 
173   \textcolor{keywordflow}{if} (netcdf\_file) &
174     \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{"open\_param\_file: NetCDF files are not yet supported."})
175 
176   \textcolor{keywordflow}{if} (all\_pes\_read .or. is\_root\_pe()) \textcolor{keywordflow}{then}
177     \textcolor{comment}{! Find an unused unit number.}
178     \textcolor{keywordflow}{do} iounit=10,512
179       \textcolor{keyword}{INQUIRE}(iounit,opened=unit\_in\_use) ; \textcolor{keywordflow}{if} (.not.unit\_in\_use) \textcolor{keywordflow}{exit}
180 \textcolor{keywordflow}{    enddo}
181     \textcolor{keywordflow}{if} (iounit >= 512) \textcolor{keyword}{call }mom\_error(fatal, &
182         \textcolor{stringliteral}{"open\_param\_file: No unused file unit could be found."})
183 
184     \textcolor{comment}{! Open the parameter file.}
185     \textcolor{keyword}{open}(iounit, file=trim(filename), access=\textcolor{stringliteral}{'SEQUENTIAL'}, &
186          form=\textcolor{stringliteral}{'FORMATTED'}, action=\textcolor{stringliteral}{'READ'}, position=\textcolor{stringliteral}{'REWIND'}, iostat=ios)
187     \textcolor{keywordflow}{if} (ios /= 0) \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"open\_param\_file: Error opening "}// &
188                                        trim(filename))
189   \textcolor{keywordflow}{else}
190     iounit = 1
191 \textcolor{keywordflow}{  endif}
192 
193   \textcolor{comment}{! Store/register the unit and details}
194   i = cs%nfiles + 1
195   cs%nfiles = i
196   cs%iounit(i) = iounit
197   cs%filename(i) = filename
198   cs%NetCDF\_file(i) = netcdf\_file
199   \textcolor{keyword}{allocate}(block) ; block%name = \textcolor{stringliteral}{''} ; cs%blockName => block
200 
201   \textcolor{keyword}{call }mom\_mesg(\textcolor{stringliteral}{"open\_param\_file: "}// trim(filename)// &
202                  \textcolor{stringliteral}{" has been opened successfully."}, 5)
203 
204   \textcolor{keyword}{call }populate\_param\_data(iounit, filename, cs%param\_data(i))
205 
206   \textcolor{keyword}{call }read\_param(cs,\textcolor{stringliteral}{"SEND\_LOG\_TO\_STDOUT"},cs%log\_to\_stdout)
207   \textcolor{keyword}{call }read\_param(cs,\textcolor{stringliteral}{"REPORT\_UNUSED\_PARAMS"},cs%report\_unused)
208   \textcolor{keyword}{call }read\_param(cs,\textcolor{stringliteral}{"FATAL\_UNUSED\_PARAMS"},cs%unused\_params\_fatal)
209   cs%doc\_file = \textcolor{stringliteral}{"MOM\_parameter\_doc"}
210   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(component)) cs%doc\_file = trim(component)//\textcolor{stringliteral}{"\_parameter\_doc"}
211   \textcolor{keyword}{call }read\_param(cs,\textcolor{stringliteral}{"DOCUMENT\_FILE"}, cs%doc\_file)
212   \textcolor{keywordflow}{if} (.not.may\_check) \textcolor{keywordflow}{then}
213     cs%report\_unused = .false.
214     cs%unused\_params\_fatal = .false.
215 \textcolor{keywordflow}{  endif}
216 
217   \textcolor{comment}{! Open the log file.}
218   cs%stdlog = stdlog() ; cs%stdout = stdout()
219   cs%log\_open = (stdlog() > 0)
220 
221   doc\_path = cs%doc\_file
222   \textcolor{keywordflow}{if} (len\_trim(cs%doc\_file) > 0) \textcolor{keywordflow}{then}
223     cs%complete\_doc = complete\_doc\_default
224     \textcolor{keyword}{call }read\_param(cs, \textcolor{stringliteral}{"COMPLETE\_DOCUMENTATION"}, cs%complete\_doc)
225     cs%minimal\_doc = minimal\_doc\_default
226     \textcolor{keyword}{call }read\_param(cs, \textcolor{stringliteral}{"MINIMAL\_DOCUMENTATION"}, cs%minimal\_doc)
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}
228       doc\_path = trim(slasher(doc\_file\_dir))//trim(cs%doc\_file)
229 \textcolor{keywordflow}{    endif} ;\textcolor{keywordflow}{ endif}
230   \textcolor{keywordflow}{else}
231     cs%complete\_doc = .false.
232     cs%minimal\_doc = .false.
233 \textcolor{keywordflow}{  endif}
234   \textcolor{keyword}{call }doc\_init(doc\_path, cs%doc, minimal=cs%minimal\_doc, complete=cs%complete\_doc, &
235                 layout=cs%complete\_doc, debugging=cs%complete\_doc)
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}}
\subsubsection{\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{\tt 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}
446   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{intent(in)} :: string\textcolor{comment}{  !< The input string to process}
447   \textcolor{keywordtype}{logical}                      :: openMultiLineComment
448 
449   \textcolor{comment}{! Local variables}
450   \textcolor{keywordtype}{integer} :: icom, last
451 
452   openmultilinecomment = .false.
453   last = lastnoncommentindex(string)+1
454   icom = index(string(last:), \textcolor{stringliteral}{"/*"})
455   \textcolor{keywordflow}{if} (icom > 0) \textcolor{keywordflow}{then}
456     openmultilinecomment=.true.
457     last = last+icom+1
458 \textcolor{keywordflow}{  endif}
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em blockname} & The name of a parameter block being added\\
\hline
\mbox{\tt 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}
2043   \textcolor{keywordtype}{type}(param\_file\_type),      \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
2044 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
2045   \textcolor{keywordtype}{character(len=*)},           \textcolor{keywordtype}{intent(in)} :: blockName\textcolor{comment}{ !< The name of a parameter block being added}
2046   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: desc\textcolor{comment}{    !< A description of the parameter block being added}
2047 
2048   \textcolor{keywordtype}{type}(parameter\_block), \textcolor{keywordtype}{pointer} :: block => null()
2049   \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(cs%blockName)) \textcolor{keywordflow}{then}
2050     block => cs%blockName
2051     block%name = pushblocklevel(block%name,blockname)
2052     \textcolor{keyword}{call }doc\_openblock(cs%doc,block%name,desc)
2053   \textcolor{keywordflow}{else}
2054     \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keyword}{call }mom\_error(fatal, &
2055       \textcolor{stringliteral}{'openParameterBlock: A push was attempted before allocation.'})
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}}
\subsubsection{\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{\tt 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}
1225   \textcolor{keywordtype}{type}(link\_parameter), \textcolor{keywordtype}{pointer}    :: chain\textcolor{comment}{   !< The linked list of variables that have already had}
1226 \textcolor{comment}{                                              !! override warnings issued}
1227   \textcolor{keywordtype}{character(len=*)},     \textcolor{keywordtype}{intent(in)} :: varName\textcolor{comment}{ !< The name of the variable being queried for warnings}
1228   \textcolor{keywordtype}{logical}                          :: overrideWarningHasBeenIssued
1229   \textcolor{comment}{! Local variables}
1230   \textcolor{keywordtype}{type}(link\_parameter), \textcolor{keywordtype}{pointer} :: newLink => null(), this => null()
1231 
1232   overridewarninghasbeenissued = .false.
1233   this => chain
1234   \textcolor{keywordflow}{do} \textcolor{keywordflow}{while}( \textcolor{keyword}{associated}(this) )
1235     \textcolor{keywordflow}{if} (trim(varname) == trim(this%name)) \textcolor{keywordflow}{then}
1236       overridewarninghasbeenissued = .true.
1237       \textcolor{keywordflow}{return}
1238 \textcolor{keywordflow}{    endif}
1239     this => this%next
1240 \textcolor{keywordflow}{  enddo}
1241   \textcolor{keyword}{allocate}(newlink)
1242   newlink%name = trim(varname)
1243   newlink%hasIssuedOverrideWarning = .true.
1244   newlink%next => chain
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}}
\subsubsection{\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{\tt 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}
2094   \textcolor{keywordtype}{character(len=*)},        \textcolor{keywordtype}{intent(in)} :: oldBlockName\textcolor{comment}{ !< A sequence of hierarchical parameter block names}
2095   \textcolor{keywordtype}{character(len=len(oldBlockName)+40)} :: popBlockLevel
2096 
2097   \textcolor{keywordtype}{integer} :: i
2098   i = index(trim(oldblockname), \textcolor{stringliteral}{'%'}, .true.)
2099   \textcolor{keywordflow}{if} (i>1) \textcolor{keywordflow}{then}
2100     popblocklevel = trim(oldblockname(1:i-1))
2101   \textcolor{keywordflow}{elseif} (i==0) \textcolor{keywordflow}{then}
2102     popblocklevel = \textcolor{stringliteral}{''}
2103   \textcolor{keywordflow}{else} \textcolor{comment}{! i==1}
2104     \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keyword}{call }mom\_error(fatal, &
2105       \textcolor{stringliteral}{'popBlockLevel: A pop was attempted leaving an empty block name.'})
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}}
\subsubsection{\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{\tt in}  & {\em iounit} & The IO unit number that is open for filename\\
\hline
\mbox{\tt in}  & {\em filename} & An input file name, optionally with the full path\\
\hline
\mbox{\tt 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}
347   \textcolor{keywordtype}{integer},                 \textcolor{keywordtype}{intent(in)} :: iounit\textcolor{comment}{ !< The IO unit number that is open for filename}
348   \textcolor{keywordtype}{character(len=*)},        \textcolor{keywordtype}{intent(in)} :: filename\textcolor{comment}{ !< An input file name, optionally with the full path}
349   \textcolor{keywordtype}{type}(file\_data\_type), \textcolor{keywordtype}{intent(inout)} :: param\_data\textcolor{comment}{ !< A list of the input lines that set parameters}
350 \textcolor{comment}{                                                !! after comments have been stripped out.}
351 
352   \textcolor{comment}{! Local variables}
353   \textcolor{keywordtype}{character(len=INPUT\_STR\_LENGTH)} :: line
354   \textcolor{keywordtype}{integer} :: num\_lines
355   \textcolor{keywordtype}{logical} :: inMultiLineComment
356 
357   \textcolor{comment}{! Find the number of keyword lines in a parameter file}
358   \textcolor{comment}{! Allocate the space to hold the lines in param\_data%line}
359   \textcolor{comment}{! Populate param\_data%line with the keyword lines from parameter file}
360 
361   \textcolor{keywordflow}{if} (iounit <= 0) \textcolor{keywordflow}{return}
362 
363   \textcolor{keywordflow}{if} (all\_pes\_read .or. is\_root\_pe()) \textcolor{keywordflow}{then}
364     \textcolor{comment}{! rewind the parameter file}
365     rewind(iounit)
366 
367     \textcolor{comment}{! count the number of valid entries in the parameter file}
368     num\_lines = 0
369     inmultilinecomment = .false.
370     \textcolor{keywordflow}{do} \textcolor{keywordflow}{while}(.true.)
371       \textcolor{keyword}{read}(iounit, \textcolor{stringliteral}{'(a)'}, end=8, err=9) line
372       line = replacetabs(line)
373       \textcolor{keywordflow}{if} (inmultilinecomment) \textcolor{keywordflow}{then}
374         \textcolor{keywordflow}{if} (closemultilinecomment(line)) inmultilinecomment=.false.
375       \textcolor{keywordflow}{else}
376         \textcolor{keywordflow}{if} (lastnoncommentnonblank(line)>0) num\_lines = num\_lines + 1
377         \textcolor{keywordflow}{if} (openmultilinecomment(line)) inmultilinecomment=.true.
378 \textcolor{keywordflow}{      endif}
379 \textcolor{keywordflow}{    enddo} \textcolor{comment}{! while (.true.)}
380  8  \textcolor{keywordflow}{continue} \textcolor{comment}{! get here when read() reaches EOF}
381 
382     \textcolor{keywordflow}{if} (inmultilinecomment .and. is\_root\_pe()) &
383       \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{'MOM\_file\_parser : A C-style multi-line comment '}// &
384                       \textcolor{stringliteral}{'(/* ... */) was not closed before the end of '}//trim(filename))
385 
386     \textcolor{comment}{! allocate space to hold contents of the parameter file}
387     param\_data%num\_lines = num\_lines
388 \textcolor{keywordflow}{  endif}  \textcolor{comment}{! (is\_root\_pe())}
389 
390   \textcolor{comment}{! Broadcast the number of valid entries in parameter file}
391   \textcolor{keywordflow}{if} (.not. all\_pes\_read) \textcolor{keywordflow}{then}
392     \textcolor{keyword}{call }broadcast(param\_data%num\_lines, root\_pe())
393 \textcolor{keywordflow}{  endif}
394 
395   \textcolor{comment}{! Set up the space for storing the actual lines.}
396   num\_lines = param\_data%num\_lines
397   \textcolor{keyword}{allocate} (param\_data%line(num\_lines))
398   \textcolor{keyword}{allocate} (param\_data%line\_used(num\_lines))
399   param\_data%line(:) = \textcolor{stringliteral}{' '}
400   param\_data%line\_used(:) = .false.
401 
402   \textcolor{comment}{! Read the actual lines.}
403   \textcolor{keywordflow}{if} (all\_pes\_read .or. is\_root\_pe()) \textcolor{keywordflow}{then}
404     \textcolor{comment}{! rewind the parameter file}
405     rewind(iounit)
406 
407     \textcolor{comment}{! Populate param\_data%line}
408     num\_lines = 0
409     \textcolor{keywordflow}{do} \textcolor{keywordflow}{while}(.true.)
410       \textcolor{keyword}{read}(iounit, \textcolor{stringliteral}{'(a)'}, end=18, err=9) line
411       line = replacetabs(line)
412       \textcolor{keywordflow}{if} (inmultilinecomment) \textcolor{keywordflow}{then}
413         \textcolor{keywordflow}{if} (closemultilinecomment(line)) inmultilinecomment=.false.
414       \textcolor{keywordflow}{else}
415         \textcolor{keywordflow}{if} (lastnoncommentnonblank(line)>0) \textcolor{keywordflow}{then}
416           line = removecomments(line)
417           line = simplifywhitespace(line(:len\_trim(line)))
418           num\_lines = num\_lines + 1
419           param\_data%line(num\_lines) = line
420 \textcolor{keywordflow}{        endif}
421         \textcolor{keywordflow}{if} (openmultilinecomment(line)) inmultilinecomment=.true.
422 \textcolor{keywordflow}{      endif}
423 \textcolor{keywordflow}{    enddo} \textcolor{comment}{! while (.true.)}
424 18  \textcolor{keywordflow}{continue} \textcolor{comment}{! get here when read() reaches EOF}
425 
426     \textcolor{keywordflow}{if} (num\_lines /= param\_data%num\_lines) &
427       \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{'MOM\_file\_parser : Found different number of '}// &
428                       \textcolor{stringliteral}{'valid lines on second reading of '}//trim(filename))
429 \textcolor{keywordflow}{  endif}  \textcolor{comment}{! (is\_root\_pe())}
430 
431   \textcolor{comment}{! Broadcast the populated array param\_data%line}
432   \textcolor{keywordflow}{if} (.not. all\_pes\_read) \textcolor{keywordflow}{then}
433     \textcolor{keyword}{call }broadcast(param\_data%line, input\_str\_length, root\_pe())
434 \textcolor{keywordflow}{  endif}
435 
436   \textcolor{keywordflow}{return}
437 
438 9 \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"MOM\_file\_parser : "}//&
439                   \textcolor{stringliteral}{"Error while reading file "}//trim(filename))
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}}
\subsubsection{\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{\tt in}  & {\em oldblockname} & A sequence of hierarchical parameter block names\\
\hline
\mbox{\tt 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}
2081   \textcolor{keywordtype}{character(len=*)},        \textcolor{keywordtype}{intent(in)} :: oldBlockName\textcolor{comment}{  !< A sequence of hierarchical parameter block names}
2082   \textcolor{keywordtype}{character(len=*)},        \textcolor{keywordtype}{intent(in)} :: newBlockName\textcolor{comment}{  !< A new block name to add to the end of the
       sequence}
2083   \textcolor{keywordtype}{character(len=len(oldBlockName)+40)} :: pushBlockLevel
2084 
2085   \textcolor{keywordflow}{if} (len\_trim(oldblockname)>0) \textcolor{keywordflow}{then}
2086     pushblocklevel=trim(oldblockname)//\textcolor{stringliteral}{'%'}//trim(newblockname)
2087   \textcolor{keywordflow}{else}
2088     pushblocklevel=trim(newblockname)
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em varname} & The case-\/sensitive name of the parameter to read\\
\hline
\mbox{\tt in,out}  & {\em value} & The value of the parameter that may be read from the parameter file\\
\hline
\mbox{\tt 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}
720   \textcolor{keywordtype}{type}(param\_file\_type),  \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
721 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
722   \textcolor{keywordtype}{character(len=*)},       \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The case-sensitive name of the parameter to read}
723   \textcolor{keywordtype}{character(len=*)},    \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}
724 \textcolor{comment}{                                         !! read from the parameter file}
725   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}
726 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}
727   \textcolor{comment}{! Local variables}
728   \textcolor{keywordtype}{character(len=INPUT\_STR\_LENGTH)} :: value\_string(1)
729   \textcolor{keywordtype}{logical}            :: found, defined
730 
731   \textcolor{keyword}{call }get\_variable\_line(cs, varname, found, defined, value\_string)
732   \textcolor{keywordflow}{if} (found) \textcolor{keywordflow}{then}
733     \textcolor{keywordtype}{value} = trim(strip\_quotes(value\_string(1)))
734   \textcolor{keywordflow}{elseif} (\textcolor{keyword}{present}(fail\_if\_missing)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (fail\_if\_missing) \textcolor{keywordflow}{then}
735     \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'Unable to find variable '}//trim(varname)// &
736                          \textcolor{stringliteral}{' in any input files.'})
737 \textcolor{keywordflow}{  endif} ;\textcolor{keywordflow}{ endif}
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em varname} & The case-\/sensitive name of the parameter to read\\
\hline
\mbox{\tt in,out}  & {\em value} & The value of the parameter that may be read from the parameter file\\
\hline
\mbox{\tt 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}
743   \textcolor{keywordtype}{type}(param\_file\_type),  \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
744 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
745   \textcolor{keywordtype}{character(len=*)},       \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The case-sensitive name of the parameter to read}
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}
747 \textcolor{comment}{                                         !! read from the parameter file}
748   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}
749 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}
750 
751   \textcolor{comment}{! Local variables}
752   \textcolor{keywordtype}{character(len=INPUT\_STR\_LENGTH)} :: value\_string(1), loc\_string
753   \textcolor{keywordtype}{logical}            :: found, defined
754   \textcolor{keywordtype}{integer}            :: i, i\_out
755 
756   \textcolor{keyword}{call }get\_variable\_line(cs, varname, found, defined, value\_string)
757   \textcolor{keywordflow}{if} (found) \textcolor{keywordflow}{then}
758     loc\_string = trim(value\_string(1))
759     i = index(loc\_string,\textcolor{stringliteral}{","})
760     i\_out = 1
761     \textcolor{keywordflow}{do} \textcolor{keywordflow}{while}(i>0)
762       value(i\_out) = trim(strip\_quotes(loc\_string(:i-1)))
763       i\_out = i\_out+1
764       loc\_string = trim(adjustl(loc\_string(i+1:)))
765       i = index(loc\_string,\textcolor{stringliteral}{","})
766 \textcolor{keywordflow}{    enddo}
767     \textcolor{keywordflow}{if} (len\_trim(loc\_string)>0) \textcolor{keywordflow}{then}
768       value(i\_out) = trim(strip\_quotes(adjustl(loc\_string)))
769       i\_out = i\_out+1
770 \textcolor{keywordflow}{    endif}
771     \textcolor{keywordflow}{do} i=i\_out,\textcolor{keyword}{SIZE}(\textcolor{keywordtype}{value}) ; value(i) = \textcolor{stringliteral}{" "} ;\textcolor{keywordflow}{ enddo}
772   \textcolor{keywordflow}{elseif} (\textcolor{keyword}{present}(fail\_if\_missing)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (fail\_if\_missing) \textcolor{keywordflow}{then}
773     \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'Unable to find variable '}//trim(varname)// &
774                          \textcolor{stringliteral}{' in any input files.'})
775 \textcolor{keywordflow}{  endif} ;\textcolor{keywordflow}{ endif}
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em varname} & The case-\/sensitive name of the parameter to read\\
\hline
\mbox{\tt in,out}  & {\em value} & The value of the parameter that may be read from the parameter file\\
\hline
\mbox{\tt 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}
581   \textcolor{keywordtype}{type}(param\_file\_type),  \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
582 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
583   \textcolor{keywordtype}{character(len=*)},       \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The case-sensitive name of the parameter to read}
584   \textcolor{keywordtype}{integer},             \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}
585 \textcolor{comment}{                                         !! read from the parameter file}
586   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}
587 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}
588   \textcolor{comment}{! Local variables}
589   \textcolor{keywordtype}{character(len=INPUT\_STR\_LENGTH)} :: value\_string(1)
590   \textcolor{keywordtype}{logical}            :: found, defined
591 
592   \textcolor{keyword}{call }get\_variable\_line(cs, varname, found, defined, value\_string)
593   \textcolor{keywordflow}{if} (found .and. defined .and. (len\_trim(value\_string(1)) > 0)) \textcolor{keywordflow}{then}
594     \textcolor{keyword}{read}(value\_string(1),*,err = 1001) \textcolor{keywordtype}{value}
595   \textcolor{keywordflow}{else}
596     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(fail\_if\_missing)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (fail\_if\_missing) \textcolor{keywordflow}{then}
597       \textcolor{keywordflow}{if} (.not.found) \textcolor{keywordflow}{then}
598         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_int: Unable to find variable '}//trim(varname)// &
599                              \textcolor{stringliteral}{' in any input files.'})
600       \textcolor{keywordflow}{else}
601         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_int: Variable '}//trim(varname)// &
602                              \textcolor{stringliteral}{' found but not set in input files.'})
603 \textcolor{keywordflow}{      endif}
604 \textcolor{keywordflow}{    endif} ;\textcolor{keywordflow}{ endif}
605 \textcolor{keywordflow}{  endif}
606   \textcolor{keywordflow}{return}
607  1001 \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_int: read error for integer variable '}//trim(varname)// &
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em varname} & The case-\/sensitive name of the parameter to read\\
\hline
\mbox{\tt in,out}  & {\em value} & The value of the parameter that may be read from the parameter file\\
\hline
\mbox{\tt 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}
613   \textcolor{keywordtype}{type}(param\_file\_type),  \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
614 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
615   \textcolor{keywordtype}{character(len=*)},       \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The case-sensitive name of the parameter to read}
616   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{dimension(:)},  \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}
617 \textcolor{comment}{                                         !! read from the parameter file}
618   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}
619 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}
620   \textcolor{comment}{! Local variables}
621   \textcolor{keywordtype}{character(len=INPUT\_STR\_LENGTH)} :: value\_string(1)
622   \textcolor{keywordtype}{logical}            :: found, defined
623 
624   \textcolor{keyword}{call }get\_variable\_line(cs, varname, found, defined, value\_string)
625   \textcolor{keywordflow}{if} (found .and. defined .and. (len\_trim(value\_string(1)) > 0)) \textcolor{keywordflow}{then}
626     \textcolor{keyword}{read}(value\_string(1),*,end=991,err=1002) \textcolor{keywordtype}{value}
627  991 \textcolor{keywordflow}{return}
628   \textcolor{keywordflow}{else}
629     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(fail\_if\_missing)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (fail\_if\_missing) \textcolor{keywordflow}{then}
630       \textcolor{keywordflow}{if} (.not.found) \textcolor{keywordflow}{then}
631         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_int\_array: Unable to find variable '}//trim(varname)// &
632                              \textcolor{stringliteral}{' in any input files.'})
633       \textcolor{keywordflow}{else}
634         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_int\_array: Variable '}//trim(varname)// &
635                              \textcolor{stringliteral}{' found but not set in input files.'})
636 \textcolor{keywordflow}{      endif}
637 \textcolor{keywordflow}{    endif} ;\textcolor{keywordflow}{ endif}
638 \textcolor{keywordflow}{  endif}
639   \textcolor{keywordflow}{return}
640  1002 \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_int\_array: read error for integer array '}//trim(varname)// &
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em varname} & The case-\/sensitive name of the parameter to read\\
\hline
\mbox{\tt in,out}  & {\em value} & The value of the parameter that may be read from the parameter file\\
\hline
\mbox{\tt 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}
781   \textcolor{keywordtype}{type}(param\_file\_type),  \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
782 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
783   \textcolor{keywordtype}{character(len=*)},       \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The case-sensitive name of the parameter to read}
784   \textcolor{keywordtype}{logical},             \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}
785 \textcolor{comment}{                                         !! read from the parameter file}
786   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}
787 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}
788 
789   \textcolor{comment}{! Local variables}
790   \textcolor{keywordtype}{character(len=INPUT\_STR\_LENGTH)} :: value\_string(1)
791   \textcolor{keywordtype}{logical}            :: found, defined
792 
793   \textcolor{keyword}{call }get\_variable\_line(cs, varname, found, defined, value\_string, paramislogical=.true.)
794   \textcolor{keywordflow}{if} (found) \textcolor{keywordflow}{then}
795     \textcolor{keywordtype}{value} = defined
796   \textcolor{keywordflow}{elseif} (\textcolor{keyword}{present}(fail\_if\_missing)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (fail\_if\_missing) \textcolor{keywordflow}{then}
797     \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'Unable to find variable '}//trim(varname)// &
798                          \textcolor{stringliteral}{' in any input files.'})
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em varname} & The case-\/sensitive name of the parameter to read\\
\hline
\mbox{\tt in,out}  & {\em value} & The value of the parameter that may be read from the parameter file\\
\hline
\mbox{\tt 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{\tt 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}
646   \textcolor{keywordtype}{type}(param\_file\_type), \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
647 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
648   \textcolor{keywordtype}{character(len=*)},      \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The case-sensitive name of the parameter to read}
649   \textcolor{keywordtype}{real},               \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}
650 \textcolor{comment}{                                         !! read from the parameter file}
651   \textcolor{keywordtype}{logical},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}
652 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}
653   \textcolor{keywordtype}{real},        \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: scale\textcolor{comment}{   !< A scaling factor that the parameter is multiplied}
654 \textcolor{comment}{                                         !! by before it is returned.}
655 
656   \textcolor{comment}{! Local variables}
657   \textcolor{keywordtype}{character(len=INPUT\_STR\_LENGTH)} :: value\_string(1)
658   \textcolor{keywordtype}{logical}            :: found, defined
659 
660   \textcolor{keyword}{call }get\_variable\_line(cs, varname, found, defined, value\_string)
661   \textcolor{keywordflow}{if} (found .and. defined .and. (len\_trim(value\_string(1)) > 0)) \textcolor{keywordflow}{then}
662     \textcolor{keyword}{read}(value\_string(1),*,err=1003) \textcolor{keywordtype}{value}
663     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) \textcolor{keywordtype}{value} = scale*\textcolor{keywordtype}{value}
664   \textcolor{keywordflow}{else}
665     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(fail\_if\_missing)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (fail\_if\_missing) \textcolor{keywordflow}{then}
666       \textcolor{keywordflow}{if} (.not.found) \textcolor{keywordflow}{then}
667         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_real: Unable to find variable '}//trim(varname)// &
668                              \textcolor{stringliteral}{' in any input files.'})
669       \textcolor{keywordflow}{else}
670         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_real: Variable '}//trim(varname)// &
671                              \textcolor{stringliteral}{' found but not set in input files.'})
672 \textcolor{keywordflow}{      endif}
673 \textcolor{keywordflow}{    endif} ;\textcolor{keywordflow}{ endif}
674 \textcolor{keywordflow}{  endif}
675   \textcolor{keywordflow}{return}
676  1003 \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_real: read error for real variable '}//trim(varname)// &
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em varname} & The case-\/sensitive name of the parameter to read\\
\hline
\mbox{\tt in,out}  & {\em value} & The value of the parameter that may be read from the parameter file\\
\hline
\mbox{\tt 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{\tt 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}
682   \textcolor{keywordtype}{type}(param\_file\_type), \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
683 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
684   \textcolor{keywordtype}{character(len=*)},      \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The case-sensitive name of the parameter to read}
685   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:)}, \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}
686 \textcolor{comment}{                                         !! read from the parameter file}
687   \textcolor{keywordtype}{logical},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}
688 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}
689   \textcolor{keywordtype}{real},        \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: scale\textcolor{comment}{   !< A scaling factor that the parameter is multiplied}
690 \textcolor{comment}{                                         !! by before it is returned.}
691 
692   \textcolor{comment}{! Local variables}
693   \textcolor{keywordtype}{character(len=INPUT\_STR\_LENGTH)} :: value\_string(1)
694   \textcolor{keywordtype}{logical}                         :: found, defined
695 
696   \textcolor{keyword}{call }get\_variable\_line(cs, varname, found, defined, value\_string)
697   \textcolor{keywordflow}{if} (found .and. defined .and. (len\_trim(value\_string(1)) > 0)) \textcolor{keywordflow}{then}
698     \textcolor{keyword}{read}(value\_string(1),*,end=991,err=1004) \textcolor{keywordtype}{value}
699 991 \textcolor{keywordflow}{continue}
700     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) value(:) = scale*value(:)
701     \textcolor{keywordflow}{return}
702   \textcolor{keywordflow}{else}
703     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(fail\_if\_missing)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (fail\_if\_missing) \textcolor{keywordflow}{then}
704       \textcolor{keywordflow}{if} (.not.found) \textcolor{keywordflow}{then}
705         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_real\_array: Unable to find variable '}//trim(varname)// &
706                              \textcolor{stringliteral}{' in any input files.'})
707       \textcolor{keywordflow}{else}
708         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_real\_array: Variable '}//trim(varname)// &
709                              \textcolor{stringliteral}{' found but not set in input files.'})
710 \textcolor{keywordflow}{      endif}
711 \textcolor{keywordflow}{    endif} ;\textcolor{keywordflow}{ endif}
712 \textcolor{keywordflow}{  endif}
713   \textcolor{keywordflow}{return}
714  1004 \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_real\_array: read error for real array '}//trim(varname)// &
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}}
\subsubsection{\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{\tt in}  & {\em cs} & The control structure for the file\+\_\+parser module, it is also a structure to parse for run-\/time parameters\\
\hline
\mbox{\tt in}  & {\em varname} & The case-\/sensitive name of the parameter to read\\
\hline
\mbox{\tt in,out}  & {\em value} & The value of the parameter that may be read from the parameter file\\
\hline
\mbox{\tt in}  & {\em timeunit} & The number of seconds in a time unit for real-\/number input.\\
\hline
\mbox{\tt 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{\tt 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}
804   \textcolor{keywordtype}{type}(param\_file\_type),  \textcolor{keywordtype}{intent(in)} :: CS\textcolor{comment}{      !< The control structure for the file\_parser module,}
805 \textcolor{comment}{                                         !! it is also a structure to parse for run-time parameters}
806   \textcolor{keywordtype}{character(len=*)},       \textcolor{keywordtype}{intent(in)} :: varname\textcolor{comment}{ !< The case-sensitive name of the parameter to read}
807   \textcolor{keywordtype}{type}(time\_type),     \textcolor{keywordtype}{intent(inout)} :: \textcolor{keywordtype}{value}\textcolor{comment}{   !< The value of the parameter that may be}
808 \textcolor{comment}{                                         !! read from the parameter file}
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.}
810   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: fail\_if\_missing\textcolor{comment}{ !< If present and true, a fatal error occurs}
811 \textcolor{comment}{                                         !! if this variable is not found in the parameter file}
812   \textcolor{keywordtype}{logical},     \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(out)} :: date\_format\textcolor{comment}{ !< If present, this indicates whether this}
813 \textcolor{comment}{                                         !! parameter was read in a date format, so that it can}
814 \textcolor{comment}{                                         !! later be logged in the same format.}
815 
816   \textcolor{comment}{! Local variables}
817   \textcolor{keywordtype}{character(len=INPUT\_STR\_LENGTH)} :: value\_string(1)
818   \textcolor{keywordtype}{character(len=240)} :: err\_msg
819   \textcolor{keywordtype}{logical}            :: found, defined
820   \textcolor{keywordtype}{real}               :: real\_time, time\_unit
821   \textcolor{keywordtype}{integer}            :: vals(7)
822 
823   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(date\_format)) date\_format = .false.
824 
825   \textcolor{keyword}{call }get\_variable\_line(cs, varname, found, defined, value\_string)
826   \textcolor{keywordflow}{if} (found .and. defined .and. (len\_trim(value\_string(1)) > 0)) \textcolor{keywordflow}{then}
827     \textcolor{comment}{! Determine whether value string should be parsed for a real number}
828     \textcolor{comment}{! or a date, in either a string format or a comma-delimited list of values.}
829     \textcolor{keywordflow}{if} ((index(value\_string(1),\textcolor{stringliteral}{'-'}) > 0) .and. &
830         (index(value\_string(1),\textcolor{stringliteral}{'-'},back=.true.) > index(value\_string(1),\textcolor{stringliteral}{'-'}))) \textcolor{keywordflow}{then}
831       \textcolor{comment}{! There are two dashes, so this must be a date format.}
832       \textcolor{keywordtype}{value} = set\_date(value\_string(1), err\_msg=err\_msg)
833       \textcolor{keywordflow}{if} (len\_trim(err\_msg) > 0) \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_time: '}//&
834           trim(err\_msg)//\textcolor{stringliteral}{' in integer list read error for time-type variable '}//&
835           trim(varname)// \textcolor{stringliteral}{' parsing "'}//trim(value\_string(1))//\textcolor{stringliteral}{'"'})
836       \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(date\_format)) date\_format = .true.
837     \textcolor{keywordflow}{elseif} (index(value\_string(1),\textcolor{stringliteral}{','}) > 0) \textcolor{keywordflow}{then}
838       \textcolor{comment}{! Initialize vals with an invalid date.}
839       vals(:) = (/ -999, -999, -999, 0, 0, 0, 0 /)
840       \textcolor{keyword}{read}(value\_string(1),*,end=995,err=1005) vals
841      995 \textcolor{keywordflow}{continue}
842       \textcolor{keywordflow}{if} ((vals(1) < 0) .or. (vals(2) < 0) .or. (vals(3) < 0)) &
843         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_time: integer list read error for time-type variable '}//&
844                        trim(varname)// \textcolor{stringliteral}{' parsing "'}//trim(value\_string(1))//\textcolor{stringliteral}{'"'})
845       \textcolor{keywordtype}{value} = set\_date(vals(1), vals(2), vals(3), vals(4), vals(5), vals(6), &
846                        vals(7), err\_msg=err\_msg)
847       \textcolor{keywordflow}{if} (len\_trim(err\_msg) > 0) \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_time: '}//&
848           trim(err\_msg)//\textcolor{stringliteral}{' in integer list read error for time-type variable '}//&
849           trim(varname)// \textcolor{stringliteral}{' parsing "'}//trim(value\_string(1))//\textcolor{stringliteral}{'"'})
850       \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(date\_format)) date\_format = .true.
851     \textcolor{keywordflow}{else}
852       time\_unit = 1.0 ; \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(timeunit)) time\_unit = timeunit
853       \textcolor{keyword}{read}( value\_string(1), *) real\_time
854       \textcolor{keywordtype}{value} = real\_to\_time(real\_time*time\_unit)
855 \textcolor{keywordflow}{    endif}
856   \textcolor{keywordflow}{else}
857     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(fail\_if\_missing)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (fail\_if\_missing) \textcolor{keywordflow}{then}
858       \textcolor{keywordflow}{if} (.not.found) \textcolor{keywordflow}{then}
859         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'Unable to find variable '}//trim(varname)// &
860                              \textcolor{stringliteral}{' in any input files.'})
861       \textcolor{keywordflow}{else}
862         \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'Variable '}//trim(varname)// &
863                              \textcolor{stringliteral}{' found but not set in input files.'})
864 \textcolor{keywordflow}{      endif}
865 \textcolor{keywordflow}{    endif} ;\textcolor{keywordflow}{ endif}
866 \textcolor{keywordflow}{  endif}
867   \textcolor{keywordflow}{return}
868  1005 \textcolor{keyword}{call }mom\_error(fatal,\textcolor{stringliteral}{'read\_param\_time: read error for time-type variable '}//&
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}}
\subsubsection{\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{\tt 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}
514   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{intent(in)} :: string\textcolor{comment}{  !< The input string to process}
515   \textcolor{keywordtype}{character(len=len(string))}   :: removeComments
516 
517   \textcolor{keywordtype}{integer} :: last
518 
519   removecomments=repeat(\textcolor{stringliteral}{" "},len(string))
520   last = lastnoncommentnonblank(string)
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}}
\subsubsection{\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{\tt 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}
498   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{intent(in)} :: string\textcolor{comment}{  !< The input string to process}
499   \textcolor{keywordtype}{character(len=len(string))}   :: replaceTabs
500 
501   \textcolor{keywordtype}{integer} :: i
502 
503   \textcolor{keywordflow}{do} i=1, len(string)
504     \textcolor{keywordflow}{if} (string(i:i)==achar(9)) \textcolor{keywordflow}{then}
505       replacetabs(i:i)=\textcolor{stringliteral}{" "}
506     \textcolor{keywordflow}{else}
507       replacetabs(i:i)=string(i:i)
508 \textcolor{keywordflow}{    endif}
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}}
\subsubsection{\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{\tt 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}
527   \textcolor{keywordtype}{character(len=*)}, \textcolor{keywordtype}{intent(in)} :: string\textcolor{comment}{ !< A string to modify to simpify white space}
528   \textcolor{keywordtype}{character(len=len(string)+16)}   :: simplifyWhiteSpace
529 
530   \textcolor{comment}{! Local variables}
531   \textcolor{keywordtype}{integer} :: i,j
532   \textcolor{keywordtype}{logical} :: nonBlank = .false., insidestring = .false.
533   \textcolor{keywordtype}{character(len=1)} :: quoteChar=\textcolor{stringliteral}{" "}
534 
535   nonblank  = .false.; insidestring = .false. \textcolor{comment}{! NOTE: For some reason this line is needed??}
536   i=0
537   simplifywhitespace=repeat(\textcolor{stringliteral}{" "},len(string)+16)
538   \textcolor{keywordflow}{do} j=1,len\_trim(string)
539     \textcolor{keywordflow}{if} (insidestring) \textcolor{keywordflow}{then} \textcolor{comment}{! Do not change formatting inside strings}
540       i=i+1
541       simplifywhitespace(i:i)=string(j:j)
542       \textcolor{keywordflow}{if} (string(j:j)==quotechar) insidestring=.false. \textcolor{comment}{! End of string}
543     \textcolor{keywordflow}{else} \textcolor{comment}{! The following is outside of string delimiters}
544       \textcolor{keywordflow}{if} (string(j:j)==\textcolor{stringliteral}{" "} .or. string(j:j)==achar(9)) \textcolor{keywordflow}{then} \textcolor{comment}{! Space or tab}
545         \textcolor{keywordflow}{if} (nonblank) \textcolor{keywordflow}{then} \textcolor{comment}{! Only copy a blank if the preceeding character was non-blank}
546           i=i+1
547           simplifywhitespace(i:i)=\textcolor{stringliteral}{" "} \textcolor{comment}{! Not string(j:j) so that tabs are replace by blanks}
548           nonblank=.false.
549 \textcolor{keywordflow}{        endif}
550       \textcolor{keywordflow}{elseif} (string(j:j)==\textcolor{stringliteral}{'"'} .or. string(j:j)==\textcolor{stringliteral}{"'"}) \textcolor{keywordflow}{then} \textcolor{comment}{! Start a sting}
551         i=i+1
552         simplifywhitespace(i:i)=string(j:j)
553         insidestring=.true.
554         quotechar=string(j:j) \textcolor{comment}{! Keep copy of starting quote}
555         nonblank=.true.       \textcolor{comment}{! For exit from string}
556       \textcolor{keywordflow}{elseif} (string(j:j)==\textcolor{stringliteral}{'='}) \textcolor{keywordflow}{then}
557         \textcolor{comment}{! Insert spaces if this character is "=" so that line contains " = "}
558         \textcolor{keywordflow}{if} (nonblank) \textcolor{keywordflow}{then}
559           i=i+1
560           simplifywhitespace(i:i)=\textcolor{stringliteral}{" "}
561 \textcolor{keywordflow}{        endif}
562         i=i+2
563         simplifywhitespace(i-1:i)=string(j:j)//\textcolor{stringliteral}{" "}
564         nonblank=.false.
565       \textcolor{keywordflow}{else} \textcolor{comment}{! All other characters}
566         i=i+1
567         simplifywhitespace(i:i)=string(j:j)
568         nonblank=.true.
569 \textcolor{keywordflow}{      endif}
570 \textcolor{keywordflow}{    endif} \textcolor{comment}{! if (insideString)}
571 \textcolor{keywordflow}{  enddo} \textcolor{comment}{! j}
572   \textcolor{keywordflow}{if} (insidestring) \textcolor{keywordflow}{then} \textcolor{comment}{! A missing close quote should be flagged}
573     \textcolor{keywordflow}{if} (is\_root\_pe()) \textcolor{keyword}{call }mom\_error(fatal, &
574       \textcolor{stringliteral}{"There is a mismatched quote in the parameter file line: "}// &
575       trim(string))
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}}
\subsubsection{\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}
874   \textcolor{keywordtype}{character(len=*)} :: val\_str\textcolor{comment}{ !< The character string to work on}
875   \textcolor{keywordtype}{character(len=INPUT\_STR\_LENGTH)} :: strip\_quotes
876   \textcolor{comment}{! Local variables}
877   \textcolor{keywordtype}{integer} :: i
878   strip\_quotes = val\_str
879   i = index(strip\_quotes,achar(34)) \textcolor{comment}{! Double quote}
880   \textcolor{keywordflow}{do} \textcolor{keywordflow}{while} (i>0)
881     \textcolor{keywordflow}{if} (i > 1) \textcolor{keywordflow}{then} ; strip\_quotes = strip\_quotes(:i-1)//strip\_quotes(i+1:)
882     \textcolor{keywordflow}{else} ; strip\_quotes = strip\_quotes(2:) ;\textcolor{keywordflow}{ endif}
883     i = index(strip\_quotes,achar(34)) \textcolor{comment}{! Double quote}
884 \textcolor{keywordflow}{  enddo}
885   i = index(strip\_quotes,achar(39)) \textcolor{comment}{! Single quote}
886   \textcolor{keywordflow}{do} \textcolor{keywordflow}{while} (i>0)
887     \textcolor{keywordflow}{if} (i > 1) \textcolor{keywordflow}{then} ; strip\_quotes = strip\_quotes(:i-1)//strip\_quotes(i+1:)
888     \textcolor{keywordflow}{else} ; strip\_quotes = strip\_quotes(2:) ;\textcolor{keywordflow}{ endif}
889     i = index(strip\_quotes,achar(39)) \textcolor{comment}{! Single quote}
890 \textcolor{keywordflow}{  enddo}
\end{DoxyCode}
