Home > Archive > Fortran > May 2005 > Re: block data and namelist
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: block data and namelist
|
|
| James Giles 2005-05-14, 4:05 pm |
| Thomas Koenig wrote:
> Is it OK to have a namelist in block data, like this?
>
> block data
> common /foo/ a
> namelist /foo_n/ a
> data a /1.0/
> end
Aside from the comments of others to the effect that it is
not allowed, what would it mean if it was allowed? The
NAMELIST declaration identifies a set of variables that
can be used in namelist I/O transfers. But you can't do
I/O in a block data. And, the declaration isn't visible
outside of the block data.
--
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
| |
| Thomas Koenig 2005-05-14, 4:05 pm |
| James Giles <jamesgiles@worldnet.att.net> wrote:
>Thomas Koenig wrote:
>
>Aside from the comments of others to the effect that it is
>not allowed, what would it mean if it was allowed?
You could put
common /foo/ a
namelist /foo_n/ a
into an include file, and you could include this into a block data.
| |
| James Giles 2005-05-14, 4:05 pm |
| Thomas Koenig wrote:
.....
> You could put
>
> common /foo/ a
> namelist /foo_n/ a
>
> into an include file, and you could include this into a block data.
Yes, that was my theory about how your problem arose
to begin with. I was just trying to explain the motives of
the language designers. Why would you expect to be able
to make declarations that could not possibly have any meaning
in the context?
--
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
|
|
|
|
|