The masked array assignment using WHERE in the program below is perfectly valid; indeed, FTN95 8.4 and 7.2 accept it and the output they give is correct, as well. However, FTN95 8.65 rejects it with the message:
0007) x(idx) = 2.5*idx
*** The test of the enclosing WHERE statement is rank 1, whereas the left hand side of this assignment is a scalar
and similarly for Line-9.
program Where_Bug
implicit none
integer :: idx(8) = (/ 4, 3, 7, 5, 2, 6, 2, 1 /)
real :: x(8)
!
where (idx > 4)
x(idx) = 2.5*idx
else where
x(idx) = 3.1*idx
end where
print '(8F5.1)',x ! Expected: 3.1 6.2 9.3 12.4 12.5 15.0 17.5 0.0
end program