FORALL is more versatile than array assignment:
FORALL (i=1:n) A(i,i) = B(i) ! diagonal DO j = 1, n FORALL (i=1:j) A(i,j) = B(i) ! triangular END DO
FORALL (i=1:n,j=1:n,i/=j) A(i,j) = REAL(i+j)
FORALL (i=1:n:3,j=1:n:5) A(i,j) = SIN(A(j,i))
FORALL (i=1:n,j=1:n) A(VS(i),j) = i+VS(j)
The above are very difficult to express in Fortran 90.
For more information, click here