Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Fortran Programming Language

Namelist formatting


I am writing a namelist using the preconnected output (I am using
redirects on the command line to change this from screen to specific
file name).  The write statement:

write (*,namelist_name)

and later with another program reading that same output with

read (*,namelist_name)

The proplem is if a namelist variable is a character string that has a
intermediate space the default delimiters are apostrophes.  However a
write will not put them in.  Any suggestions.  I would like to keep
the nonspecified unit so I can do the redirects on the command line.

Thanks

<dancerch@earthlink.net> wrote in message

news:1180657774.040563.176670@p47g2000hsd.googlegroups.com...

>I am writing a namelist using the preconnected output (I am using
> redirects on the command line to change this from screen to specific
> file name).  The write statement:

> write (*,namelist_name)

> and later with another program reading that same output with

> read (*,namelist_name)

> The proplem is if a namelist variable is a character string that has a
> intermediate space the default delimiters are apostrophes.  However a
> write will not put them in.  Any suggestions.  I would like to keep
> the nonspecified unit so I can do the redirects on the command line.

The OPEN statement as a DELIM specifier that allows
you to control NAMELIST output in that way.  However,
since you want to use the asterisk unit you can't portably
apply the OPEN statement to it (though many implementations
provide a way).  The F2003 standard provides a way to
determine the unit number (if any) that corresponds to
the asterisk unit.  Full F2003 implementations are around
yet.  I don't know if this feature is one that implementers
consider a priority.

--
J. Giles

"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies."   --  C. A. R. Hoare

On May 31, 7:28 pm, "James Giles" <jamesgi@att.net> wrote:

> The OPEN statement as a DELIM specifier that allows
> you to control NAMELIST output in that way.  However,
> since you want to use the asterisk unit you can't portably
> apply the OPEN statement to it (though many implementations
> provide a way).  The F2003 standard provides a way to
> determine the unit number (if any) that corresponds to
> the asterisk unit.  Full F2003 implementations are around
> yet.  I don't know if this feature is one that implementers
> consider a priority.

> --
> J. Giles

Yeah, I knew about the Open (unit=,delim=).  The problem was what
unit.  I ended up converting my writes to unit 6  (and declaring the
delimiter in an open statement) and it solved the problem although the
newer method of using an asterisk would be more elegant.

Thanks

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc