The statement allows specification of a set of index values and an
assignment expression utilizing the index values (or using a masked subset of the
index values). The computation involving the index values for the assignment
expression may be performed in an any order on a scalar machine, or in
parallel on a parallel system. For more details on the definition of FORALL
refer to [18]. The following example shows a simple masked FORALL and
the Fortran 77 code generated by the Fortran 90D/HPF compiler.
FORALL(I=1:15, X(I)>5) X(I)=Y(I)
call set_bound(x_dist,1,1,15,1,llb,lub)
do i1 = llb, lub
if (x(i) .gt. 5) then
x(i) = y(i)
endif
enddo
Note that intrinsic functions can be called from the expression part of a FORALL statement.