Jan van Oosterwijk wrote:
> Hello all,
>
> One compiler gives an error message withe the following:
>
> forall(i = 1:n-1, j = i:m-1) ! <== line 39
> b(i, j) = a(merge(i,i+1,i<p), merge(j,j+1,j<q))
> end forall
>
> ! D:\Fortran\Cursus\F90\6\Opg>f95 forall-err.f90
> ! error on line 39 of forall-err.f90: "I" is a FORALL index variable
> ! it can not appear in the subscript list expressions.
>
> The intent of this statement is to remove one row and one column from array
> "a".
> 1 <= p <= n and 1 <= q <= m are given.
>
> I can't find a restriction in the standard that forbids this.
In F95 it's the 5th constraint after R753, if you have a
standard handy. It says it backwards and says that the
right hand part (the i:m-1 part) can't contain a reference
to ANY index-name in the forall list. That makes it harder
to find (at least it ways hard for me) if you're looking for
restrictions on use of the index-name.
The fix is to run j from 1 to m-1 and add a logical test
forall(i = 1:n-1, j = 1:m-1, J >= I )
>
That's the only way to get relations between forall indexes
Dick Hendrickson
> BTW, another compiler compiles OK, but gives the expected result or
> partly strange values, depending on the order of surrounding statements.
>
> Can one of you help me here?
>
> --
>
> Met vriendelijke groet,
>
> ___ ___
> / \/ / /
> __/ /__/
>
> Jan van Oosterwijk
>
> mailto: Jan.vanOosterwijk @ DTO.TUDelft.nl
> mailto: Jan.vanOosterwijk @ HCCnet.nl
> mailto: Jan.vanOosterwijk @ wanadoo.nl
>
|