PUT DATA can do it; NAMELIST can't 
Author Message
 PUT DATA can do it; NAMELIST can't

Quote:



> > Rot!  Namelist is a pain in the neck.

> > Why all that jibberish, when a simple

> >    PUT SKIP DATA (...) will do.

> What jibberish?
> the list is declared with 1 namelist statement and output on separate lines
> as Tim requested with 1 write statement.

No it doesn't.  It comes out any way the compiler wants to do it.
This is how your fortran program prints it when run under another Fortran compiler:

 &PARAM FXPARM = 2 0001-01-019999-12-31 11   3.5000000/

Jibberish.  And where are the names?

PL/I's PUT DATA always prints the names.



Mon, 06 Jun 2005 21:10:08 GMT  
 PUT DATA can do it; NAMELIST can't


Quote:



> > > Rot!  Namelist is a pain in the neck.

> > > Why all that jibberish, when a simple

> > >    PUT SKIP DATA (...) will do.

> > What jibberish?
> > the list is declared with 1 namelist statement and output on separate
lines
> > as Tim requested with 1 write statement.

> No it doesn't.  It comes out any way the compiler wants to do it.
> This is how your Fortran program prints it when run under another Fortran
compiler:

>  &PARAM FXPARM = 2 0001-01-019999-12-31 11   3.5000000/

> Jibberish.  And where are the names?

> PL/I's PUT DATA always prints the names.

Definition of namelist says names are to be output with values, your dodo
Fortran compiler screws up on this syntax? so whats new..
How many times do you have to be told to pay several hundred dollars and get
a decent Fortran compiler and abandon the IBM junk that cost your boss
thousands of dollars..

When are you going to admit you cant translate my  flip function into PL/I ?



Mon, 06 Jun 2005 21:31:14 GMT  
 PUT DATA can do it; NAMELIST can't

Date: Thu, 19 Dec 2002 13:31:14 GMT

Quote:



> > > Rot!  Namelist is a pain in the neck.

> > > Why all that jibberish, when a simple

> > >    PUT SKIP DATA (...) will do.

> > What jibberish?
> > the list is declared with 1 namelist statement and output on separate lines
> > as Tim requested with 1 write statement.

> No it doesn't.  It comes out any way the compiler wants to do it.
> This is how your Fortran program prints it when run under another Fortran
> compiler:
>  &PARAM FXPARM = 2 0001-01-019999-12-31 11   3.5000000/

> Jibberish.  And where are the names?

> PL/I's PUT DATA always prints the names.
> Definition of namelist says names are to be output with values, your dodo
> Fortran compiler screws up on this syntax? so whats new..

Read the manual.  Namelist has never had to write out the names.
It's been that way since the beginning.

"The name of each namelist group object list item is placed in the output
record followed by an equals AND A LIST OF VALUES of the namelist group
object list item." [emphasis added]

If that wasn't clear enough, the manual also says that repeated values
can be written as r*value, where r is a repeat count.  Again, no names.

PL/I writes out ALL the names.



Tue, 07 Jun 2005 20:09:45 GMT  
 PUT DATA can do it; NAMELIST can't

Examples

Consider the following statements:

CHARACTER*19 NAME(2)/2*' '/
REAL PITCH, ROLL, YAW, POSITION(3)
LOGICAL DIAGNOSTICS
INTEGER ITERATIONS
NAMELIST /PARAM/ NAME, PITCH, ROLL, YAW, POSITION,        &
         DIAGNOSTICS, ITERATIONS
...
READ (UNIT=1,NML=PARAM)
WRITE (UNIT=2,NML=PARAM)
Suppose the following input is read:

&PARAM
    NAME(2)(10:)='HEISENBERG',
    PITCH=5.0, YAW=0.0, ROLL=5.0,
    DIAGNOSTICS=.TRUE.
    ITERATIONS=10
/
The following is then written to the file connected to unit 2:

&PARAM
NAME   = '                         ', '        HEISENBERG',
PITCH  =    5.000000    ,
ROLL   =    5.000000    ,
YAW    =   0.0000000E+00,
POSITION        = 3*0.0000000E+00,
DIAGNOSTICS     = T,
ITERATIONS      =                10
/
Note that character values are not enclosed in apostrophes unless the output
file is opened with DELIM='APOSTROPHE'. The value of POSITION is not defined
in the namelist input, so the current value of POSITION is written.

The following example declares a number of variables, which are placed in a
namelist, initialized, and then written to the screen with namelist I/O:

       INTEGER(1) int1
       INTEGER    int2, int3, array(3)
       LOGICAL(1) log1
       LOGICAL log2, log3
       REAL    real1
       REAL(8) real2
       COMPLEX z1, z2
       CHARACTER(1)  char1
       CHARACTER(10) char2

       NAMELIST /example/ int1, int2, int3, log1, log2, log3,       &
      &          real1, real2, z1, z2, char1, char2, array

       int1     = 11
       int2     = 12
       int3     = 14
       log1     = .TRUE.
       log2     = .TRUE.
       log3     = .TRUE.
       real1    = 24.0
       real2    = 28.0d0
       z1       = (38.0,0.0)
       z2       = (316.0d0,0.0d0)
       char1    = 'A'
       char2    = '0123456789'
       array(1) = 41
       array(2) = 42
       array(3) = 43
       WRITE (*, example)
The preceding example produces the following output:

 &EXAMPLE
 INT1  =   11,
 INT2  =          12,
 INT3  =          14,
 LOG1  = T,
 LOG2  = T,
 LOG3  = T,
 REAL1 =   24.00000    ,
 REAL2 =   28.0000000000000     ,
 Z1    = (38.00000,0.0000000E+00),
 Z2    = (316.0000,0.0000000E+00),
 CHAR1 = A,
 CHAR2 = 0123456789,
 ARRAY =          41,          42,          43
 /
For More Information:

  a.. See the NAMELIST statement.
  b.. See Rules for Formatted Sequential WRITE Statements.
  c.. On namelist input, see Rules for Namelist Sequential READ Statements.



Tue, 07 Jun 2005 21:46:50 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Using CGI module with 'canned queries'

2. It's not bad canned meat...

3. It's not bad canned meat...

4. It's not bad canned meat...

5. It's not bad canned meat...

6. CA Cans VO ?

7. Where are good sources of canned VI's for Digital I/O?

8. spin doctors at O'reilly canned tcl/tk event due to important developments. woohoo!!

9. How to hide Tk root window when using only canned dialogs?

10. block data and namelist

11. ANNOUNCE: perl 5 package to parse Fortran NAMELIST data

12. Reading ASCII data file with DVF NAMELIST

 

 
Powered by phpBB® Forum Software