Thanks Aleksandar. Here is something a bit similar. Is this one legal?
real, pointer :: a(:), b(:)
nullify( a )
b => a
print *, 'Is b associated?', associated(b)
On Apr 13, 2004, at 4:04 PM, Aleksandar Donev wrote:
> 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.
>
========================================
Dr. Drew McCormack (Kmr. R153)
Afd. Theoretische Chemie
Faculteit Exacte Wetenschappen
Vrije Universiteit Amsterdam
De Boelelaan 1083
1081 HV Amsterdam
The Netherlands
Email [log in to unmask]
Telephone +31 20 44 47623
Mobile +31 6 483 21307
Fax +31 20 44 47629
|