(j3.2006) DEALLOCATE and image control

Van Snyder van.snyder
Fri Apr 4 02:13:07 EDT 2014

Malcolm Cohen wrote:
>> I couldn't find anything about whether a variable of a type that has an
>> allocatable coarray ultimate component can be a pointer.
> That would be
> C525 An entity whose type has a coarray ultimate component shall be a nonpointer 
> nonallocatable scalar, shall not be a coarray, and shall not be a function 
> result.

Thanks; I was concerned about deallocating an object using a pointer, 
thereby not automatically deallocating coarray components, and therefore 
not synchronizing.  If had something like, this 
couldn't happen.

Since "entity" includes "pointer," it's possible to have a pointer to a 
coarray, but not to an object of a type that has a coarray component.  
It would be better to allow pointers of those types, but not allow to 
allocate or deallocate them.  Otherwise, one cannot make linked lists of 
objects that have coarray components.

While thinking about this, and having found, I started 
wondering the order in which allocatable components of allocatable 
objects are deallocated.  It should be specified, perhaps "in component 
order."  If there are, say, two allocatable coarray components, and one 
image deallocates them in one order, while another one deallocates in 
another order, deadlock results.

> Cheers,

More information about the J3 mailing list