--On 22 September 2004 13:52 -0600 James Giles
<[log in to unmask]> wrote:
> P => A
> Q => A(:)
Anyone who deallocates either pointer is likely to be creating a problem. A
may not have been allocatable but merely a target. In either case the
deallocate will likely try to deallocate space that is still accessible via
A (possibly on a stack not a heap). I would have said deallocate should
only be used if the pointer was previously associated with space by
allocation. The appropriate operation in such cases is surely NULLIFY in
such circumstances the question of whole array or slice is not relevant.
I also think the distinction between a slice and the whole array is
important even if on occasions the difference is subtle, and users who
employ arrays and pointers to array slices need to be aware of the subtle
distinctions. The most obvious one being that in one case the lower bounds
are always 1 regardless of the declared bounds of the whole array and that
can be very significant for subsequent use of the slice.
--
Dr. Lawrie Schonfelder
Honorary Senior Fellow, University of Liverpool
Home: 1 Marine Park, West Kirby, Wirral, UK, CH48 5HN
Phone: +44 (151) 625 6986
|