At 01:50 17-11-98 +0100, you wrote:
>Fellow Fortran:ers
>
>The following is an excerpt from The Standard regarding Initialization
>Expressions:
>
>------------------- begin snip -------------------
>
>7.1.6.1 Constant expression
>
> / ... /
>
>An initialization expression is a constant expression in which the
>exponentiation operation is permitted only with an integer power, and each
>primary is one of the following:
>
> (1) A constant or subobject of a constant where each subscript,
>section subscript, substring
> starting point, and substring ending point is an initialization expression,
>
> (2) An array constructor where each element and the bounds and strides
>of each implied-DO are
> expressions whose primaries are either initialization expressions or
>implied-DO variables,
>
> (3) A structure constructor where each component is an initialization
>expression,
>
> (4) An elemental intrinsic function reference of type integer or
>character where each argument is
> an initialization expression of type integer or character,
>
> (5) A reference to one of the transformational functions,
>REPEAT, RESHAPE,
> SELECTED_INT_KIND, SELECTED_REAL_KIND, TRANSFER, or TRIM, where each
> argument is an initialization expression,
>
> (6) A reference to an array inquiry function (13.10.15) other than
>ALLOCATED, the bit inquiry
> function BIT_SIZE, the character inquiry function LEN, the kind inquiry
>function KIND, or a
> numeric inquiry function (13.10.8), where each argument is either an
>initialization expression
> or a variable whose type parameters or bounds inquired about are not
>assumed or defined by
> an ALLOCATE statement or a pointer assignment, or
>
> (7) An initialization expression enclosed in parentheses.
>
>------------------- end snip -------------------
>
>The problem is whether this code is Standard F90.
>
>!------------- begin code ---------------------------
>program standardQ
>integer, parameter :: &
> a( 5 ) = (/(i,i=1,5)/), &
> b( 5 ) = (/(mod (i, 2), i=1,5)/), &
> c( 5 ) = mod ((/(i,i=1,5)/), 2), &
> d( 5 ) = (/(mod (a( i ), 2), i=1,5)/), &
> e( 5 ) = mod (a, 2), &
> f( 5 ) = a - 2 * (a / 2)
>end program standardQ
>!-------------- end code ---------------------------
>
>Laheys ELF90 3.0 compiler accepts them all.
>IBM's xlf90 compiler does not accept line b and d
>SUN's f90 compiler does not accept line c and e
>Absoft's compiler does not accept line b and d
>Cray's f90 compiler accepts them all.
>
>Which compiler is wrong? Which lines are really Standard F90?
>
>/Per Hakan Lundow
>
Salford FTN95 does not accept b and d .
Absoft f90 v5 does not accept c and e . (in my case)
---
Meilleures Salutations,
Best Greetings,
/---
Jan van Oosterwijk
Computing Centre
Delft University of Technology
Postbus 354
2600 AJ Delft
Netherlands / Pays Bas
Phone: +31 15 278 50 17
Fax: +31 15 278 37 87
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|