This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]