The program below shows a different behavior for SIZE and ALLOCATED across coarray images. Naively, I would assume that both work (SIZE does, ALLOCATED does not) if the only thing they do is read the array descriptor data. Is there an explanation for this?
PROGRAM MAIN IMPLICIT NONE TYPE TT INTEGER,ALLOCATABLE :: VALUES(:) END TYPE TT TYPE(TT) :: T
There is an explanation - the standard forbids the use of ALLOCATED here, since a coindexed object is not allocatable (you can't say ALLOCATE(T%VALUES), but the compiler fails to diagnose the error. I will let the developers know. Issue ID is DPD200381147.
I was mistaken in saying that ALLOCATED is not allowed here - it is, because the only requirement is that it be an array or scalar with the ALLOCATABLE attribute. But we are still returning the wrong value.
I am glad to hear that the query function ALLOCATED() can be used across coarray images. It is very useful since I suspect many of us use the strategy of having a top-level derived-type coarray variable that contains many image-specific allocatable arrays of variable size. When an image wants to access data on an other image, a check regarding the allocation status of such arrays may be desirable or necessary, for a host of reasons.
The work around right now is to have custom ALLOCATE/DEALLOCATE subroutines that store a logical variable representing the status of the array they are associated with. It's not a huge burden, but it seems it should not be necessary.
I hope a fix for this can make it into the next update. 16 Update 2 is looking really good otherwise.
Thanks Steve - I saw that it was fixed in the beta version already, which is great.
As an aside, will a license for XE16 allow for upgrade to XE17 when it is released (assuming that this occurs within one year of the purchase of the original license)? I think it is the case but just want to check.