Drew McCormack wrote:
> Is this legal?
>
> real, pointer :: a(:), b(:)
> allocate( a(10) )
> b => a
> deallocate( b )
Yes, the restriction is that b has to be associated with the whole of
the allocation, which it is in this case. Essentially as far as Fortran
is concerned b=>a makes b equivalent to a.
I think it would have been legal even if
b=>a(1:10)
Right?
Best,
Aleksandar
P.S. This is taken from the F2x standard (6.3.3.2), but I am pretty sure
it has not changed since F90.
|