/Healpix_2.13a/doc/html/subroutinesnode66.htm
HTML | 304 lines | 256 code | 39 blank | 9 comment | 0 complexity | f066638b12dc31504d272c7a64b0ad6b MD5 | raw file
Possible License(s): GPL-2.0
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <!--Converted with LaTeX2HTML 2002-2-1 (1.71)
- original version by: Nikos Drakos, CBLU, University of Leeds
- * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
- * with significant contributions from:
- Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
- <HTML>
- <HEAD>
- <TITLE>parse_xxx</TITLE>
- <META NAME="description" CONTENT="parse_xxx">
- <META NAME="keywords" CONTENT="subroutines">
- <META NAME="resource-type" CONTENT="document">
- <META NAME="distribution" CONTENT="global">
- <META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1">
- <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
- <LINK REL="STYLESHEET" HREF="subroutines.css">
- <LINK REL="next" HREF="subroutinesnode67.htm">
- <LINK REL="previous" HREF="subroutinesnode65.htm">
- <LINK REL="up" HREF="subroutines.htm">
- <LINK REL="next" HREF="subroutinesnode67.htm">
- </HEAD>
- <BODY >
- <DIV CLASS="navigation"><body text="#000000" bgcolor="#FFFFFA">
- <!--Navigation Panel-->
- <A NAME="tex2html1001"
- HREF="subroutinesnode65.htm">
- <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
- <A NAME="tex2html1007"
- HREF="subroutines.htm">
- <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
- <A NAME="tex2html1011"
- HREF="subroutinesnode67.htm">
- <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
- <A NAME="tex2html1009"
- HREF="subroutinesnode1.htm">
- <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
- <BR>
- <B> Previous:</B> <A NAME="tex2html1002"
- HREF="subroutinesnode65.htm">output_map*</A>
- <B>Up:</B> <A NAME="tex2html1008"
- HREF="subroutines.htm">Healpix/F90 subroutines</A>
- <B> Next:</B> <A NAME="tex2html1012"
- HREF="subroutinesnode67.htm">pixel_window</A>
- <B> Top:</B> <a href="main.htm">Main Page</a></DIV>
- <!--End of Navigation Panel-->
- <H1><A NAME="SECTION000660000000000000000"></A>
- <A NAME="sub:parse_xxx"></A>
- <BR>
-
- </H1>
- <P>
- <b><font size=+6><FONT COLOR="#CC0000">parse_xxx</FONT></font></b><hr><H2>The Fortran90 module paramfile_io contains functions to obtain
- parameters from parameter files or interactively</H2><br>Location in HEALPix directory tree: <b>
- src/f90/mod/paramfile_io.F90
- </b>
- <P>
- <hr><H1>ARGUMENTS</H1>
- <TABLE CELLPADDING=3 BORDER="1">
- <TR><TH ALIGN="LEFT" VALIGN="TOP" WIDTH=150><SPAN CLASS="textbf">name&dimensionality</SPAN></TH>
- <TH ALIGN="LEFT" VALIGN="TOP" WIDTH=25><SPAN CLASS="textbf">kind</SPAN></TH>
- <TH ALIGN="LEFT" VALIGN="TOP" WIDTH=50><SPAN CLASS="textbf">in/out</SPAN></TH>
- <TH ALIGN="LEFT" VALIGN="TOP" WIDTH=225><SPAN CLASS="textbf">description</SPAN></TH>
- </TR>
- <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150> </TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25> </TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50> </TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225> </TD>
- </TR>
- <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>
- fname</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>CHR</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>IN</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>file containing the simulation parameters.
- If empty, parameters are obtained interactively.</TD>
- </TR>
- <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>handle</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>PMF</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>INOUT</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>Object of type (paramfile_handle) used to store parameter information</TD>
- </TR>
- <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>keyname</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>CHR</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>IN</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>name of the required parameter</TD>
- </TR>
- <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>default</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>XXX</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>IN</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>optional argument containing the default value for
- a given simulation parameter; must be of
- appropriate type.</TD>
- </TR>
- <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>vmin</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>XXX</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>IN</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>optional argument containing the minimum value for
- a given simulation parameter; must be of
- appropriate type.</TD>
- </TR>
- <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>vmax</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>XXX</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>IN</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>optional argument containing the maximum value for
- a given simulation parameter; must be of
- appropriate type.</TD>
- </TR>
- <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>descr</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>CHR</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>IN</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>optional argument containing a description of the
- required simulation parameter</TD>
- </TR>
- <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>filestatus</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>CHR</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>IN</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>optional argument. If present, the parameter
- must be a valid filename. If filestatus=='new',
- the file must not exist; if filestatus=='old',
- the file must exist.</TD>
- </TR>
- <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>code</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>CHR</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>IN</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>optional argument. Contains the name of the executable.</TD>
- </TR>
- <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>silent</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>LGT</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>IN</TD>
- <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>optional argument. If set to <TT>.true.</TT> the parsing
- routines will run silently in non-interactive mode (except for warning or error
- messages, which will always appear). This is mainly intended for MPI usage where
- many processors parse the same parameter file: <TT>silent</TT> can be set to
- <TT>.true.</TT> on all CPUs except one.</TD>
- </TR>
- </TABLE>
- <P>
- <BIG CLASS="LARGE"><SPAN CLASS="textbf">ROUTINES: </SPAN></BIG>
- <BR>
- <TT>handle = parse_init (fname [,silent])</TT>
- <P>
- initializes the parser to work on the file fname, or interactively, if fname is empty
- <P>
- <TT>intval = parse_int (handle, keyname [, default, vmin, vmax, descr])</TT>
- <P>
- <TT>longval = parse_long (handle, keyname [, default, vmin, vmax, descr])</TT>
- <P>
- <TT>realval = parse_real (handle, keyname [, default, vmin, vmax, descr])</TT>
- <P>
- <TT>doubleval = parse_double (handle, keyname [, default, vmin, vmax, descr])</TT>
- <P>
- <TT>stringval = parse_string (handle, keyname [, default, descr, filestatus])</TT>
- <P>
- <TT>logicval = parse_lgt (handle, keyname [, default, descr])</TT>
- <P>
- These routines obtain integer(i4b), integer(i8b), real(sp), real(dp), character(len=*) and logical values,
- respectively.
- <BR>
- Note: <TT>parse_string</TT> will expand all environment variables of
- the form ${XXX} (eg: ${HOME}). It will also replace a <EM>leading</EM>
- <code>~</code><SPAN CLASS="MATH"><IMG
- WIDTH="1" HEIGHT="17" ALIGN="BOTTOM" BORDER="0"
- SRC="subroutinesimg5.png"
- ALT="$\!$"></SPAN><TT>/</TT>
- by the user's home directory.
- <P>
- <TT>call parse_summarize (handle [, code])</TT>
- <P>
- if the parameters were set interactively, this routine will print out a
- parameter file performing the same settings.
- <P>
- <TT>call parse_check_unused (handle [, code])</TT>
- <P>
- if a parameter file was read, this routine will print out all the parameters
- found in the file but not used by the code. Intended at detecting typos in
- parameter names.
- <P>
- <TT>call parse_finish (handle)</TT>
- <P>
- frees the memory
- <P>
- <HR><H1>EXAMPLE:</H1><tt><FONT SIZE=+1>
- program who_r_u
- <BR>
- use healpix_types
- <BR>
- use paramfile_io
- <BR>
- use extension
- <BR>
- <BR>
- implicit none
- <BR>
- type(paramfile_handle) :: handle
- <BR>
- character(len=256) :: parafile, name
- <BR>
- real(DP) :: age
- <BR>
- <BR>
- parafile = ''
- <BR>
- if (<A HREF="subroutinesnode59.htm#sub:narguments">nArguments()</A> == 1) call <A HREF="subroutinesnode34.htm#sub:getargument">getArgument</A>(1, parafile)
- <BR>
- handle = parse_init(parafile)
- <BR>
- name = parse_string(handle, 'name',descr='Enter your last name: ')
- <BR>
- age = parse_double(handle, 'age', descr='Enter your age in years: ', &
- <BR> & default=18.d0,vmin=0.d0)
- <BR>
- call parse_summarize(handle, 'who_r_u')
- <BR>
- end program who_r_u
- </font></tt>
- <BR><blockquote>If a file is provided as command line argument when running the executable <TT>who_r_u</TT>, that file
- will be parsed in search of the lines starting with 'name =' and 'age =',
- otherwise the same questions will be asked interactively.
- </blockquote>
- <P>
- <hr><H1>RELATED ROUTINES</H1><h3>This section lists the routines related to <b><FONT COLOR="#CC0000">parse_xxx</FONT></b></h3>
- <BR>
- <DL COMPACT><DT>
- <B><A HREF="subroutinesnode20.htm#sub:concatnl">concatnl</A></B>
- <DD>generates from a set of strings the
- multi-line description
- <DT>
- <B><A HREF="subroutinesnode59.htm#sub:narguments">nArguments</A></B>
- <DD>returns the number of
- command line arguments
- <DT>
- <B><A HREF="#sub:getArgument">getArgument</A></B>
- <DD>returns the list of command line arguments
- </DL>
- <P>
- <P>
- <P>
- <P>
- <DIV CLASS="navigation"><HR>
- <!--Navigation Panel-->
- <A NAME="tex2html1001"
- HREF="subroutinesnode65.htm">
- <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
- <A NAME="tex2html1007"
- HREF="subroutines.htm">
- <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
- <A NAME="tex2html1011"
- HREF="subroutinesnode67.htm">
- <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
- <A NAME="tex2html1009"
- HREF="subroutinesnode1.htm">
- <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
- <BR>
- <B> Previous:</B> <A NAME="tex2html1002"
- HREF="subroutinesnode65.htm">output_map*</A>
- <B>Up:</B> <A NAME="tex2html1008"
- HREF="subroutines.htm">Healpix/F90 subroutines</A>
- <B> Next:</B> <A NAME="tex2html1012"
- HREF="subroutinesnode67.htm">pixel_window</A>
- <B> Top:</B> <a href="main.htm">Main Page</a></DIV>
- <!--End of Navigation Panel-->
- <ADDRESS>
- Eric Hivon
- 2009-11-27
- </ADDRESS>
- </BODY>
- </HTML>