# FORALL

Fortran 95 introduced the FORALL statement which allowed the programmer to indicate where the same operation would be applied to elements of an array and could be implemented in any order. This is a necessary condition to run the operation in parallel.

```
FORALL (i=1:n,j=1:m)
A(i,j) = A(i,j) * B(i)
END FORALL
```

These operations are independent. That is, for any given i and j, A(i,j) is not affected by any other element of the array and therefore the order of the operations is unimportant. A sufficiently large array could be split up into smaller parts and the operations distributed among many cores in a parallel architecture or take advantage of a vector processor where available.

This statement came into the language from High-Performance Fortran (HPF). It was superceded by the more general DO CONCURRENT construct in Fortran 2008.