10 final
:: fini3
, fini2
, fini_elm
13 type, extends(t
) :: t2
16 final
:: f2ini2
, f2ini_elm
27 type(t
), intent(in
), contiguous
:: x(:,:)
28 if (.not
. rank2_call
) call abort ()
29 if (size(x
,1) /= 2 .or
. size(x
,2) /= 3) call abort()
30 !print *, 'fini2:', x%i
31 if (any (x
%i
/= reshape([11, 12, 21, 22, 31, 32], [2,3]))) call abort()
32 fini_call
= fini_call
+ 1
36 type(t
), intent(in
) :: x(2,2,*)
38 if (.not
. elem_call
) call abort ()
39 if (.not
. rank3_call
) call abort ()
40 if (cnt2
/= 9) call abort()
41 if (cnt
/= 1) call abort()
45 !print *, k,j,i,x(k,j,i)%i
46 if (x(k
,j
,i
)%i
/= k
+10*j
+100*i
) call abort()
50 fini_call
= fini_call
+ 1
53 impure elemental
subroutine fini_elm (x
)
54 type(t
), intent(in
) :: x
55 if (.not
. elem_call
) call abort ()
56 if (rank3_call
) call abort ()
57 if (cnt2
/= 6) call abort()
58 if (cnt
/= x
%i
) call abort()
59 !print *, 'fini_elm:', cnt, x%i
60 fini_call
= fini_call
+ 1
65 type(t2
), intent(in
), target
:: x(:,:)
66 if (.not
. rank2_call
) call abort ()
67 if (size(x
,1) /= 2 .or
. size(x
,2) /= 3) call abort()
68 !print *, 'f2ini2:', x%i
69 !print *, 'f2ini2:', x%j
70 if (any (x
%i
/= reshape([11, 12, 21, 22, 31, 32], [2,3]))) call abort()
71 if (any (x
%j
/= 100*reshape([11, 12, 21, 22, 31, 32], [2,3]))) call abort()
72 fini_call
= fini_call
+ 1
75 impure elemental
subroutine f2ini_elm (x
)
76 type(t2
), intent(in
) :: x
77 integer, parameter :: exprected(*) &
78 = [111, 112, 121, 122, 211, 212, 221, 222]
80 if (.not
. elem_call
) call abort ()
81 !print *, 'f2ini_elm:', cnt2, x%i, x%j
83 if (x
%i
/= exprected(cnt2
)) call abort ()
84 if (x
%j
/= 1000*exprected(cnt2
)) call abort ()
86 if (cnt2
/= x
%i
.or
. cnt2
*10 /= x
%j
) call abort()
89 fini_call
= fini_call
+ 1
97 class(t
), save, allocatable
:: y(:), z(:,:), zz(:,:,:)
104 allocate (t2
:: y(5))
117 if (fini_call
/= 10) call abort ()
122 allocate (t2
:: z(2,3))
128 z(j
,i
)%j
= (j
+10*i
)*100
137 if (fini_call
/= 2) call abort ()
142 allocate (t2
:: zz(2,2,2))
148 zz(k
,j
,i
)%i
= k
+10*j
+100*i
149 zz(k
,j
,i
)%j
= (k
+10*j
+100*i
)*1000
160 if (fini_call
/= 2*2*2+1) call abort ()