5 integer, parameter, dimension(3,3) :: a
= &
6 reshape([1,2,3,4,5,6,7,8,9], shape(a
))
7 integer, dimension(3,3) :: b
8 integer, parameter, dimension(3,4,5) :: c
= &
9 reshape([(i
**2,i
=1,3*4*5)],shape(c
))
10 integer, dimension(3,4,5) :: d
11 integer, dimension(4,5), parameter :: sh1
=&
12 reshape([(i
**3-12*i
**2,i
=1,4*5)],shape(sh1
))
13 integer, dimension(3,5), parameter :: sh2
= &
14 reshape([(i
**3-7*i
**2,i
=1,3*5)], shape(sh2
))
15 integer, dimension(3,4), parameter :: sh3
= &
16 reshape([(i
**3-3*i
**2,i
=1,3*4)], shape(sh3
))
17 integer, parameter, dimension(3,4,5) :: c1
= cshift(c
,shift
=sh1
,dim
=1)
18 integer, parameter, dimension(3,4,5) :: c2
= cshift(c
,shift
=sh2
,dim
=2)
19 integer, parameter, dimension(3,4,5) :: c3
= cshift(c
,shift
=sh3
,dim
=3)
22 if (any(cshift(a
,1) /= cshift(b
,1))) STOP 1
23 if (any(cshift(a
,2) /= cshift(b
,2))) STOP 2
24 if (any(cshift(a
,1,dim
=2) /= cshift(b
,1,dim
=2))) STOP 3
26 if (any(cshift(c
,1) /= cshift(d
,1))) STOP 4
27 if (any(cshift(c
,2) /= cshift(d
,2))) STOP 5
28 if (any(cshift(c
,3) /= cshift(d
,3))) STOP 6
30 if (any(cshift(c
,1,dim
=2) /= cshift(d
,1,dim
=2))) STOP 7
31 if (any(cshift(c
,2,dim
=2) /= cshift(d
,2,dim
=2))) STOP 8
32 if (any(cshift(c
,3,dim
=3) /= cshift(d
,3,dim
=3))) STOP 9
34 if (any(cshift(d
,shift
=sh1
,dim
=1) /= c1
)) STOP 10
35 if (any(cshift(d
,shift
=sh2
,dim
=2) /= c2
)) STOP 11
36 if (any(cshift(d
,shift
=sh3
,dim
=3) /= c3
)) STOP 12