PageRenderTime 44ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/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
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <!--Converted with LaTeX2HTML 2002-2-1 (1.71)
  3. original version by: Nikos Drakos, CBLU, University of Leeds
  4. * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
  5. * with significant contributions from:
  6. Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
  7. <HTML>
  8. <HEAD>
  9. <TITLE>parse_xxx</TITLE>
  10. <META NAME="description" CONTENT="parse_xxx">
  11. <META NAME="keywords" CONTENT="subroutines">
  12. <META NAME="resource-type" CONTENT="document">
  13. <META NAME="distribution" CONTENT="global">
  14. <META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1">
  15. <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
  16. <LINK REL="STYLESHEET" HREF="subroutines.css">
  17. <LINK REL="next" HREF="subroutinesnode67.htm">
  18. <LINK REL="previous" HREF="subroutinesnode65.htm">
  19. <LINK REL="up" HREF="subroutines.htm">
  20. <LINK REL="next" HREF="subroutinesnode67.htm">
  21. </HEAD>
  22. <BODY >
  23. <DIV CLASS="navigation"><body text="#000000" bgcolor="#FFFFFA">
  24. <!--Navigation Panel-->
  25. <A NAME="tex2html1001"
  26. HREF="subroutinesnode65.htm">
  27. <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
  28. <A NAME="tex2html1007"
  29. HREF="subroutines.htm">
  30. <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
  31. <A NAME="tex2html1011"
  32. HREF="subroutinesnode67.htm">
  33. <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
  34. <A NAME="tex2html1009"
  35. HREF="subroutinesnode1.htm">
  36. <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
  37. <BR>
  38. <B> Previous:</B> <A NAME="tex2html1002"
  39. HREF="subroutinesnode65.htm">output_map*</A>
  40. <B>Up:</B> <A NAME="tex2html1008"
  41. HREF="subroutines.htm">Healpix/F90 subroutines</A>
  42. <B> Next:</B> <A NAME="tex2html1012"
  43. HREF="subroutinesnode67.htm">pixel_window</A>
  44. <B> Top:</B> <a href="main.htm">Main Page</a></DIV>
  45. <!--End of Navigation Panel-->
  46. <H1><A NAME="SECTION000660000000000000000"></A>
  47. <A NAME="sub:parse_xxx"></A>
  48. <BR>
  49. </H1>
  50. <P>
  51. <b><font size=+6><FONT COLOR="#CC0000">parse_xxx</FONT></font></b><hr><H2>The Fortran90 module paramfile_io contains functions to obtain
  52. parameters from parameter files or interactively</H2><br>Location in HEALPix directory tree: <b>
  53. src/f90/mod/paramfile_io.F90
  54. </b>
  55. <P>
  56. <hr><H1>ARGUMENTS</H1>
  57. <TABLE CELLPADDING=3 BORDER="1">
  58. <TR><TH ALIGN="LEFT" VALIGN="TOP" WIDTH=150><SPAN CLASS="textbf">name&amp;dimensionality</SPAN></TH>
  59. <TH ALIGN="LEFT" VALIGN="TOP" WIDTH=25><SPAN CLASS="textbf">kind</SPAN></TH>
  60. <TH ALIGN="LEFT" VALIGN="TOP" WIDTH=50><SPAN CLASS="textbf">in/out</SPAN></TH>
  61. <TH ALIGN="LEFT" VALIGN="TOP" WIDTH=225><SPAN CLASS="textbf">description</SPAN></TH>
  62. </TR>
  63. <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>&nbsp;</TD>
  64. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>&nbsp;</TD>
  65. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>&nbsp;</TD>
  66. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>&nbsp;</TD>
  67. </TR>
  68. <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>
  69. fname</TD>
  70. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>CHR</TD>
  71. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>IN</TD>
  72. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>file containing the simulation parameters.
  73. If empty, parameters are obtained interactively.</TD>
  74. </TR>
  75. <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>handle</TD>
  76. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>PMF</TD>
  77. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>INOUT</TD>
  78. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>Object of type (paramfile_handle) used to store parameter information</TD>
  79. </TR>
  80. <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>keyname</TD>
  81. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>CHR</TD>
  82. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>IN</TD>
  83. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>name of the required parameter</TD>
  84. </TR>
  85. <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>default</TD>
  86. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>XXX</TD>
  87. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>IN</TD>
  88. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>optional argument containing the default value for
  89. a given simulation parameter; must be of
  90. appropriate type.</TD>
  91. </TR>
  92. <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>vmin</TD>
  93. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>XXX</TD>
  94. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>IN</TD>
  95. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>optional argument containing the minimum value for
  96. a given simulation parameter; must be of
  97. appropriate type.</TD>
  98. </TR>
  99. <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>vmax</TD>
  100. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>XXX</TD>
  101. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>IN</TD>
  102. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>optional argument containing the maximum value for
  103. a given simulation parameter; must be of
  104. appropriate type.</TD>
  105. </TR>
  106. <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>descr</TD>
  107. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>CHR</TD>
  108. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>IN</TD>
  109. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>optional argument containing a description of the
  110. required simulation parameter</TD>
  111. </TR>
  112. <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>filestatus</TD>
  113. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>CHR</TD>
  114. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>IN</TD>
  115. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>optional argument. If present, the parameter
  116. must be a valid filename. If filestatus=='new',
  117. the file must not exist; if filestatus=='old',
  118. the file must exist.</TD>
  119. </TR>
  120. <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>code</TD>
  121. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>CHR</TD>
  122. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>IN</TD>
  123. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>optional argument. Contains the name of the executable.</TD>
  124. </TR>
  125. <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>silent</TD>
  126. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>LGT</TD>
  127. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>IN</TD>
  128. <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>optional argument. If set to <TT>.true.</TT> the parsing
  129. routines will run silently in non-interactive mode (except for warning or error
  130. messages, which will always appear). This is mainly intended for MPI usage where
  131. many processors parse the same parameter file: <TT>silent</TT> can be set to
  132. <TT>.true.</TT> on all CPUs except one.</TD>
  133. </TR>
  134. </TABLE>
  135. <P>
  136. <BIG CLASS="LARGE"><SPAN CLASS="textbf">ROUTINES: </SPAN></BIG>
  137. <BR>
  138. <TT>handle = parse_init (fname [,silent])</TT>
  139. <P>
  140. &nbsp;&nbsp;&nbsp;&nbsp;initializes the parser to work on the file fname, or interactively, if fname is empty
  141. <P>
  142. <TT>intval = parse_int (handle, keyname [, default, vmin, vmax, descr])</TT>
  143. <P>
  144. <TT>longval = parse_long (handle, keyname [, default, vmin, vmax, descr])</TT>
  145. <P>
  146. <TT>realval = parse_real (handle, keyname [, default, vmin, vmax, descr])</TT>
  147. <P>
  148. <TT>doubleval = parse_double (handle, keyname [, default, vmin, vmax, descr])</TT>
  149. <P>
  150. <TT>stringval = parse_string (handle, keyname [, default, descr, filestatus])</TT>
  151. <P>
  152. <TT>logicval = parse_lgt (handle, keyname [, default, descr])</TT>
  153. <P>
  154. &nbsp;&nbsp;&nbsp;&nbsp;These routines obtain integer(i4b), integer(i8b), real(sp), real(dp), character(len=*) and logical values,
  155. respectively.
  156. <BR>
  157. Note: <TT>parse_string</TT> will expand all environment variables of
  158. the form ${XXX} (eg: ${HOME}). It will also replace a <EM>leading</EM>
  159. <code>~</code><SPAN CLASS="MATH"><IMG
  160. WIDTH="1" HEIGHT="17" ALIGN="BOTTOM" BORDER="0"
  161. SRC="subroutinesimg5.png"
  162. ALT="$\!$"></SPAN><TT>/</TT>
  163. by the user's home directory.
  164. <P>
  165. <TT>call parse_summarize (handle [, code])</TT>
  166. <P>
  167. &nbsp;&nbsp;&nbsp;&nbsp;if the parameters were set interactively, this routine will print out a
  168. parameter file performing the same settings.
  169. <P>
  170. <TT>call parse_check_unused (handle [, code])</TT>
  171. <P>
  172. &nbsp;&nbsp;&nbsp;&nbsp;if a parameter file was read, this routine will print out all the parameters
  173. found in the file but not used by the code. Intended at detecting typos in
  174. parameter names.
  175. <P>
  176. <TT>call parse_finish (handle)</TT>
  177. <P>
  178. &nbsp;&nbsp;&nbsp;&nbsp;frees the memory
  179. <P>
  180. <HR><H1>EXAMPLE:</H1><tt><FONT SIZE=+1>
  181. program who_r_u
  182. <BR>
  183. use healpix_types
  184. <BR>
  185. use paramfile_io
  186. <BR>
  187. use extension
  188. <BR>
  189. <BR>
  190. implicit none
  191. <BR>
  192. type(paramfile_handle) :: handle
  193. <BR>
  194. character(len=256) :: parafile, name
  195. <BR>
  196. real(DP) :: age
  197. <BR>
  198. <BR>
  199. parafile = ''
  200. <BR>
  201. if (<A HREF="subroutinesnode59.htm#sub:narguments">nArguments()</A> == 1) call <A HREF="subroutinesnode34.htm#sub:getargument">getArgument</A>(1, parafile)
  202. <BR>
  203. handle = parse_init(parafile)
  204. <BR>
  205. name = parse_string(handle, 'name',descr='Enter your last name: ')
  206. <BR>
  207. age = parse_double(handle, 'age', descr='Enter your age in years: ', &amp;
  208. <BR> &amp; default=18.d0,vmin=0.d0)
  209. <BR>
  210. call parse_summarize(handle, 'who_r_u')
  211. <BR>
  212. end program who_r_u
  213. </font></tt>
  214. <BR><blockquote>If a file is provided as command line argument when running the executable <TT>who_r_u</TT>, that file
  215. will be parsed in search of the lines starting with 'name =' and 'age =',
  216. otherwise the same questions will be asked interactively.
  217. </blockquote>
  218. <P>
  219. <hr><H1>RELATED ROUTINES</H1><h3>This section lists the routines related to <b><FONT COLOR="#CC0000">parse_xxx</FONT></b></h3>
  220. <BR>
  221. <DL COMPACT><DT>
  222. <B><A HREF="subroutinesnode20.htm#sub:concatnl">concatnl</A></B>
  223. <DD>generates from a set of strings the
  224. multi-line description
  225. <DT>
  226. <B><A HREF="subroutinesnode59.htm#sub:narguments">nArguments</A></B>
  227. <DD>returns the number of
  228. command line arguments
  229. <DT>
  230. <B><A HREF="#sub:getArgument">getArgument</A></B>
  231. <DD>returns the list of command line arguments
  232. </DL>
  233. <P>
  234. <P>
  235. <P>
  236. <P>
  237. <DIV CLASS="navigation"><HR>
  238. <!--Navigation Panel-->
  239. <A NAME="tex2html1001"
  240. HREF="subroutinesnode65.htm">
  241. <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
  242. <A NAME="tex2html1007"
  243. HREF="subroutines.htm">
  244. <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
  245. <A NAME="tex2html1011"
  246. HREF="subroutinesnode67.htm">
  247. <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
  248. <A NAME="tex2html1009"
  249. HREF="subroutinesnode1.htm">
  250. <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
  251. <BR>
  252. <B> Previous:</B> <A NAME="tex2html1002"
  253. HREF="subroutinesnode65.htm">output_map*</A>
  254. <B>Up:</B> <A NAME="tex2html1008"
  255. HREF="subroutines.htm">Healpix/F90 subroutines</A>
  256. <B> Next:</B> <A NAME="tex2html1012"
  257. HREF="subroutinesnode67.htm">pixel_window</A>
  258. <B> Top:</B> <a href="main.htm">Main Page</a></DIV>
  259. <!--End of Navigation Panel-->
  260. <ADDRESS>
  261. Eric Hivon
  262. 2009-11-27
  263. </ADDRESS>
  264. </BODY>
  265. </HTML>