> do i=1,4
> a(i)=rand()
> c if the following line is added, it works again.
> c write(*,*)a(i)
> end do
The compiler sees a function called with unchanged (no) arguments, and
optimizes the calls to a single reference. Clever compiler. With the write
statement in place, the optimization is not performed as this is equivalent
to to a call to a subroutine.
Regards,
Mike Metcalf
|