Hi: I noticed that whenever I use a math function (such as sqrt, cos, log) in a forall all statement that further uses of that function caused gfortran to say that the function has no implicit type. I've shown an example program below: program test implicit none integer :: i real :: a, c(5) = (/1.0,2.0,3.0,4.0,5.0/), d(5) a = sqrt(2.0) d(:) = 0.0 forall (i = 1:5, sqrt(c(i)) < 2.0) d(i) = i end forall end program test If I try to compile the above program I get the following error: In file test.f90:8 a = sqrt(2.0) 1 Error: Symbol 'sqrt' at (1) has no IMPLICIT type If I comment out the line "a = sqrt(2.0)", everything works fine. Also, if I don't use the sqrt test in the forall statement, everything works fine. If you substitute other mathematical functions for sqrt (such as log or cos) it fails to compile in a similar way. I tried this in the latest experimental build (downloaded from the gfortran wiki) and had similar problems. Thank You
Confirmed with gfortran 4.3.0 20070116.
A workaround for this problem is place parentheses around the mask in the forall. The parentheses force evaluation of the expression whereas gfortran is apparently taking a different path through the compiler without. *** This bug has been marked as a duplicate of 30400 ***