Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Namelist and Arrays

Dishaw__Jim
Beginner
482 Views
According to the documentation and the compiler error messages, allocatable arrays and static arrays with nonconstant bounds cannot be used with a NAMELIST. For example,
REAL :: arr(gMax)
NAMELIST /NLIST/ arr
results in the error
Error: A NAMELIST group object must not be an array with nonconstant bounds.

This seems to be an arbitrary limit--is there a basis for it? I guess the only work around is to make the array large enough for the expected range of values for gMax.
0 Kudos
1 Reply
Steven_L_Intel1
Employee
482 Views
The restriction is stated in the Fortran 95 standard, but in Fortran 2003 the rule is simply that the object cannot be an assumed-size array, so eventually we'll relax the implementation to meet the standard.
0 Kudos
Reply