(j3.2006) Allocattable and namelist object

Dan Nagle danlnagle
Mon Feb 15 06:32:02 EST 2010


kargls at comcast.net posted this to comp.lang.fortran
He now wants to submit an interp about it.

I've asked him to write his question in the form he'd
like to submit, and I'll post it to the list.

If there's something obvious that makes this go away,
I missed it.  Richard's reply in c.l.f also indicates
there may be an issue.  It appears to be awkward language
at best.

Have fun in Vegas.  ;-)

On 2010-02-14 15:50:20 -0500, steve <kargls at comcast.net> said:

 > All,
 > Someone has reported a bug against gfortran that suggests that
 > following code is legal Fortran 2003.
 > Gfortran currently issues an error in accordance with a
 > constraint in Fortran 95:
 >    F95, Sec 5.4, p. 66
 >    Constraint:
 >    A namelist-group-object shall not be an array dummy
 >    argument with a nonconstant bound, a variable with
 >    nonconstant character length, an automatic object,
 >    a pointer, a variable of a type that has an ultimate
 >    component that is a pointer, or an allocatable array.
 > In checking the Fortran 2003 standard, the above constraint
 > has been removed.  Further searching leads to two passages
 > that appear to be in conflict.
 >    F2003, Sec. 5.4, p. 95
 >    A namelist group object shall either be accessed by use
 >    or host association or shall have its type, type parameters,
 >    and shape specified by previous specification statements or
 >    the procedure heading in the same scoping unit or by the
 >    implicit typing rules in effect for the scoping unit.
 >    F2003, Sec.,
 >    Every allocatable namelist-group-object in the namelist group
 >    shall be allocated and every namelist-group-object that is a
 >    pointer shall be associated with a target.
 > The statement from Sec. 5.4 states that a "namelist group object
 > ... shall have its type, type parameters, and shape specified
 > by previous specification statements".  In the above code, the
 > shape has not been specified prior to the namelist statement.
 > However, the statement from Sec. suggests that an allocatable
 > array can be in a namelist object.
 > Are these statements in conflict or am I missing some other
 > part of the Fortran 2003 standard?
 > --
 > steve


Dan Nagle

More information about the J3 mailing list