3 integer, parameter :: q
= 2
4 integer, parameter :: nx
=3, ny
=2*q
, nz
=5
5 integer, parameter, dimension(nx
,ny
,nz
) :: p
= &
6 & reshape ((/ (i
**2, i
=1,size(p
)) /), shape(p
))
7 integer, parameter, dimension( ny
,nz
) :: px
= &
9 & + nx
*(nx
-1)*(2*nx
-1)/6, &
10 & j
=0,ny
-1), k
=0,nz
-1) /), shape(px
))
11 integer, parameter, dimension(nx
, nz
) :: py
= &
13 & +(nx
)**2*ny
*(ny
-1)*(2*ny
-1)/6, &
14 & i
=0,nx
-1), k
=0,nz
-1) /), shape(py
))
15 integer, parameter, dimension(nx
,ny
) :: pz
= &
17 & +(nx
*ny
)**2*nz
*(nz
-1)*(2*nz
-1)/6, &
18 & i
=0,nx
-1), j
=0,ny
-1) /), shape(pz
))
19 integer, dimension(nx
,ny
,nz
) :: a
20 integer, dimension(nx
,ny
) :: az
21 if (sum(sum(sum(a
,1),2),1) /= sum(a
)) STOP 1
22 if (sum(sum(sum(a
,3),1),1) /= sum(a
)) STOP 2
23 if (any(1+sum(eid(a
),1)+ax
+sum( &
25 1)+1 /= 3*ax
+2)) STOP 3
26 if (any(1+eid(sum(a
,2))+ay
+ &
29 )+1 /= 3*ay
+2)) STOP 4
30 if (any(sum(eid(sum(a
,3))+az
+2* &
32 ,1)+1 /= 4*sum(az
,1)+1)) STOP 5
34 elemental
function eid (x
)
35 integer, intent(in
) :: x
38 integer, intent(in
) :: x(:,:)
39 integer :: neid2(size(x
,1),size(x
,2))
43 integer, intent(in
) :: x(:,:,:)
44 integer :: neid3(size(x
,1),size(x
,2),size(x
,3))
46 elemental
subroutine set (o
, i
)
47 integer, intent(in
) :: i
48 integer, intent(out
) :: o
50 elemental
subroutine tes (i
, o
)
51 integer, intent(in
) :: i
52 integer, intent(out
) :: o