This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Bug in FORALL masking condition
- From: Mark Hesselink <mhesseli at caltech dot edu>
- To: fortran at gcc dot gnu dot org
- Date: Thu, 2 Jun 2005 11:41:32 -0700
- Subject: Bug in FORALL masking condition
Dear developers,
I would like to report a bug in the implementation of the FORALL
construct. Please consider the following code,
PROGRAM forall_1
REAL(KIND(0.0d0)), DIMENSION(10) :: A
INTEGER :: i,n
n=SIZE(A)
A=(/ (0.0d0,i=1,n) /)
n=INT(SIZE(A)/2)
A(1:n)=(/ (1.0d0,i=1,n) /)
n=SIZE(A)
FORALL (i=1:n:1,A(i)==1.0d0)
A(i)=1.0d0
END FORALL
WRITE (*,'(F8.6)') A
END PROGRAM forall_1
Changing the masking condition in the FORALL construct from A(i)==1.0d0
to A(i)/=0.0d0 makes the code compile. As far as I understand from my
copy of Fortran 90/95 Explained, both masking conditions should work.
Thanks,
Mark Hesselink