David,
(a) is the right way. The way that I use to remember this is by recognizing
that the memory allocation and deallocation is handled by the RTL (run-time
library) of your O/S which knows nothing about your compiler, hence it cannot
know that x is of type ab etc...
BTW, I think that:
> allocate(x,x%a,x%b)
> deallocate(x%a,x%b,x)
should be:
allocate(x); allocate(x%a); allocate(x%b)
deallocate(x%a); deallocate(x%b); deallocate(x)
as I believe that the allocation order in:
> allocate(x,x%a,x%b)
may not necessarily be x,x%a,x%b (at least I cannot find in the standard ISO
F90 a note to this regard).
Regards,
Petros
----------------------
Petros Dafniotis, PhD
DuPont de Nemours Intl. S.A. - Central Research & Development
[log in to unmask]
---
DISCLAIMER: My employer, DuPont de Nemours, has nothing to do with
the opinions and ideas expressed in this post / message.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|