Date: Thu, 18 Dec 2003 14:20:33 -0500
From: Aleksandar Donev <[log in to unmask]>
...
It just seems like a restriction that is too strict. Maybe allowing array
elements with constant subscripts or alike would be better...
What about
pointer :: a
...
do a(3) = 1,n
call maybeReTargetOrNullify(a)
end do
BTW, the following compiles with Compaq Fortran Compiler
T5.5-1775-48B9D
subroutine ttt(a,b,n)
integer :: n, a(:), b(n,n,n)
pointer :: a
integer, pointer :: i,j,k
i => a(1)
j => a(2)
k => a(3)
do i = 1,n
do j = 1,n
do k = 1,n
b(i,j,k) = sum(a(1:3))
end do
end do
end do
end subroutine
Here, it is clear what happens if A were go get retargeted (the
previous contents continue to get updated) or nullified (undefined,
because of usage of pointers into nullified data).
|