Re: flexible input parameter file



Or as Glen pointed out the input file could look like:
&global
x2 = 0.2 !Time Step size
x1 = 0.1 !Number of Time Step
/

Skip

On Thu, 15 Sep 2005 17:52:56 +0000 (UTC), SC Huang <schuang21@xxxxxxxxx> wrote:

-|Thank you all for suggestions! After some trials, it appears that the
-|NAMELIST approach is the simplest solution for my original problem.
-|In the following, a simple sample code that I tested is listed below,
-|in case some "rookies" (like me) are looking for the same
-|solution. :-)
-|
-|To creates a namelist called "global", which contains two real numbers
-|(x1,x2):
-|
-| real :: x1,x2
-| integer :: fid=20
-| namelist /global/ x1,x2
-|
-| open(fid,file="nlist.in",form="formatted")
-| read(fid, NML=global)
-| close(fid)
-|
-|The input file "nlist.in" looks like:
-|
-|#
-|# input file for nlist.f
-|#
-|
-|&global
-|
-| !* time step size
-|
-| x2= 0.2
-|
-| !* number of time step
-|
-| x1= 0.1
-|/
-|
-|To print out the whole namelist (for checking), I used:
-|
-| write(*, NML=global)
-|
-|One can also print out variables x1 or x2 as usual:
-|
-| write(*, '(f10.3)') x1
-|
-|
-|Note that the order of x1 and x2 in the input file "nlist.in" does not
-|matter. This is a good feature for having more freedom in input file
-|format.
-|
-|Thank you all again. The NAMELIST usage has been an eye-opener for
-|me! :-)

.



Relevant Pages

  • Re: Howto construct a message for a simple WebService call?
    ... A very good answer, but still, I would like to see sample code to that ... >> to use the construct message shape to transform the input FILE to a web ... > When BizTalk imports a WSDL, it will create Multi-part message types for the ... > Assignment shape. ...
    (microsoft.public.biztalk.general)
  • Re: flexible input parameter file
    ... NAMELIST approach is the simplest solution for my original problem. ... in case some "rookies" are looking for the same ... The input file "nlist.in" looks like: ...
    (comp.lang.fortran)