(j3.2006) MOVE_ALLOC with coarrays

Tobias Burnus burnus
Wed May 30 04:49:59 EDT 2012

Dear all,

I received the follow code, which is accepted by two compilers but 
rejected (with an internal compiler error) by GCC/gfortran. I believe 
that the code is invalid, but I cannot find anything but a rather 
indirect hint for that.

Namely, the dummy arguments of MOVE_ALLOC are allocatable and " 
Allocatable dummy variables" states: "The corank of the actual argument 
shall be the same as that of the dummy argument." If one now assumes (!) 
that the dummy arguments have no corank, the code becomes invalid.

Do you concur that it is invalid? (If so, I think it should be made more 
explicit in MOVE_ALLOC, e.g. in the revision next standard.)

real ,allocatable :: coarray(:,:)[:]
real ,allocatable :: local(:,:)
call move_alloc (local, coarray)


PS: Coindexed actual arguments are more explicitly excluded as FROM is 
INTENT(INOUT) and TO is INTENT(OUT) - but requires" "If the 
actual argument is a coindexed object with an allocatable ultimate 
component, the dummy argument shall have the INTENT (IN) or the VALUE 

More information about the J3 mailing list