At 9:15 pm +0100 11/5/99, Charles A. Rendleman wrote:
>program t
> type A
> integer , pointer :: I
> type (A), pointer :: N
> end type A
> type (A), pointer :: A_p
> integer :: As
> !
> ! Note that I allocate a pointer member of the containing
> ! structure...
> !
> allocate(A_p, A_p%i, stat = As)
> !
> ! ^- This is the problematic statement
My understanding of the allocate statement is that the order in which the
allocates within a single statement is done is undefined. Therefore, one
compiler might choose to do it left to right and it'll work (Solaris f90v2
is happy), but another might choose to do it right to left and then you'd
be in trouble.
What happens if you split the allocate into two statements; doing A_p first?
Glenn
----
Dr. Glenn Carver, Senior Research Associate,
Centre for Atmospheric Science, Chemistry Dept., Cambridge University, UK
[log in to unmask] http://www.atm.ch.cam.ac.uk/~glenn/
"I never think of the future, it comes soon enough"
- Albert Einstein
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|