1 ! Like array_alloc_1.f90, but check multi-dimensional arrays.
5 call test ((/ 3, 4, 5 /), f ((/ 3, 4, 5 /)))
7 subroutine test (expected
, x
)
8 integer, dimension (:,:,:) :: x
9 integer, dimension (3) :: expected
10 integer :: i
, i1
, i2
, i3
12 if (size (x
, i
) .ne
. expected (i
)) call abort
14 do i1
= 1, expected (1)
15 do i2
= 1, expected (2)
16 do i3
= 1, expected (3)
17 if (x (i1
, i2
, i3
) .ne
. i1
+ i2
* 10 + i3
* 100) call abort
24 integer, dimension (3) :: x
25 integer, dimension (x(1), x(2), x(3)) :: f
30 f (i1
, i2
, i3
) = i1
+ i2
* 10 + i3
* 100