3 ! Verify that the bounds are correctly set when assigning pointers.
9 real, target
:: a(-10:10)
10 real, pointer :: p(:),p2(:)
17 if((lbound(p
, dim
=1) /= -10) .or
. (ubound(p
, dim
=1) /= 10)) &
19 if((lbound(p2
,dim
=1) /= -10) .or
. (ubound(p2
,dim
=1) /= 10)) &
22 if(p(i
) /= real(i
)) call abort()
23 if(p2(i
) /= real(i
)) call abort()
27 if((lbound(p
, dim
=1) /= 1) .or
. (ubound(p
, dim
=1) /= 21)) &
29 if((lbound(p2
,dim
=1) /= 1) .or
. (ubound(p2
,dim
=1) /= 21)) &
32 if((lbound(p2
,dim
=1) /= 1) .or
. (ubound(p2
,dim
=1) /= 21)) &
37 real, target
, allocatable
:: b(:,:,:)
38 real, pointer :: ptr(:,:,:)
40 allocate(b(-5:5,10:20,0:3))
44 b(k
,j
,i
) = real(i
+10*j
+100*k
)
49 if((lbound(ptr
,dim
=1) /= -5) .or
. (ubound(ptr
,dim
=1) /= 5) .or
. &
50 (lbound(ptr
,dim
=2) /= 10) .or
. (ubound(ptr
,dim
=2) /= 20) .or
. &
51 (lbound(ptr
,dim
=3) /= 0) .or
. (ubound(ptr
,dim
=3) /= 3)) &
56 if(ptr(k
,j
,i
) /= real(i
+10*j
+100*k
)) call abort()
61 if((lbound(ptr
,dim
=1) /= 1) .or
. (ubound(ptr
,dim
=1) /= 11) .or
. &
62 (lbound(ptr
,dim
=2) /= 1) .or
. (ubound(ptr
,dim
=2) /= 11) .or
. &
63 (lbound(ptr
,dim
=3) /= 1) .or
. (ubound(ptr
,dim
=3) /= 4)) &
65 end subroutine multdim