(j3.2006) Namelist output
Tue Jan 13 12:04:28 EST 2009
John Reid wrote:
> Bill Long wrote:
>> John Reid wrote:
>>> It has been pointed out to me that the standard is not clear on
>>> acceptable forms of namelist output for a structure and that compilers
>>> are inconsistent as to whether they provide the name and a list of
>>> values of the components or a list of component designators, each
>>> followed by a value. My correspondent strongly prefers the latter.
>>> In 10.10.2 of F2003, we have: "The form of the output produced is the
>>> same as that required for input, except for the forms of real,
>>> character, and logical values.". This suggests that using component
>>> designators is OK, but 10.10.2.2 says "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.".
>> This last sentence does not seem ambiguous to me. A namelist group
>> object is a well defined syntax term (R564, page 109 of 09-007).
> Agreed. If this was intended, the sentence at the start of 10.10.2 is wrong.
That sentence says that the output looks like valid input. Are you
saying that for
type(t) :: z
if the namelist object is z then it is legal in an input data record to
... z%x = 1.0, z%y = 2.0 ...
instead of z followed by two real constants? I don't see where that is
allowed in the standard.
> These words are unchanged from f90 and I remember then that the i/o group was
> inclined to say 'name' when they meant 'name or designator'. I would like to
> know if everyone is agreed that compilers that use component designators in
> namelist output are non-conforming. Or did we intend that this be an allowed
> J3 mailing list
> J3 at j3-fortran.org
Bill Long longb at cray.com
Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9142
Cray Inc., 1340 Mendota Heights Rd., Mendota Heights, MN, 55120
More information about the J3