(j3.2006) MOVE_ALLOC with coarrays

John Reid John.Reid
Wed May 30 05:36:58 EDT 2012

Tobias Burnus wrote:
> 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.

This is the subject of an interp., which unfortunately was not ready in 
time for corrigendum 1. It is F08/0040 in 12-006A and makes this edit:

[372:19] In 13.7.118p3 MOVE_ALLOC, TO argument,
          After "same rank" insert "and corank".

Hopefully, this will be in corrigendum 2.



> 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)
> end
> Tobias
> 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
> attribute."
> _______________________________________________
> J3 mailing list
> J3 at j3-fortran.org
> http://j3-fortran.org/mailman/listinfo/j3

More information about the J3 mailing list