You would certainly have to be careful, where you have different size arrays, such as
integer, parameter :: n=5
integer b2(n,n)
integer b3(10,10,3)
k=...
FORALL (i=1:n,j=1:n)
b2(i,j)=b3(i,j,k)
end forall
The forall would work here, but the use of (:,:) requires the same size for the first 2 dimensions.
If you are looking for a faster approach, move@ might help, although (:,:) should work well. If you need array sections, or the arrays are not the same size then you should consider an alternative, such as using move@ in a loop, such as:
do j = 1,n
call move@ ( b3(1,j,k), b2(1,j), n*4 )
end do
Another alternative could be the following without any /check option
do I = 1,n*n
b2(I,1) = b3(I,1,k)
end do
or
call move@ ( b3(1,1,k), b2, nn4 )
John