1 ! Like vector_subscript_1.f90, but check subscripts in multi-dimensional
6 integer, parameter :: n
= 5
8 integer, dimension (n
, n
, n
) :: a
, b
9 integer, dimension (n
) :: idx
, id
11 idx
= (/ 3, 1, 5, 2, 4 /)
12 id
= (/ (i1
, i1
= 1, n
) /)
13 forall (i1
= 1:n
, i2
= 1:n
, i3
= 1:n
)
14 b (i1
, i2
, i3
) = i1
+ i2
* 10 + i3
* 100
18 a (foo (i1
), 1, :) = b (2, :, foo (i1
))
21 if (a (idx (i1
), 1, i2
) .ne
. b (2, i1
, idx (i2
))) call abort
26 a (1, idx (1:4), 2:4) = b (2:5, idx (3:5), 2)
29 if (a (1, idx (i1
), 1 + i2
) .ne
. b (1 + i1
, idx (i2
+ 2), 2)) call abort
36 integer, dimension (n
) :: foo