Bug in FORALL masking condition

Steve Kargl sgk@troutmask.apl.washington.edu
Thu Jun 2 19:27:00 GMT 2005


On Thu, Jun 02, 2005 at 11:41:32AM -0700, Mark Hesselink wrote:
> 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.
> 

Yep. Looks like a bug.  If you change "==" to ".eq." in
the mask.  The code appears to work.  Can you submit a 
bug report with bugzilla?

-- 
Steve



More information about the Fortran mailing list