MOVE_ALLOC(FROM, TO) (Fortran 2003)

Purpose

Allows you to move allocation status, dynamic type, type parameter values, bounds information, and values from one object to another.

Class

subroutine

Argument type and attributes

FROM
An INTENT(INOUT) dummy argument that must be an allocatable object. It may be scalar or an array.
TO
An INTENT(OUT) dummy argument that must be an allocatable object. It must be type-compatible and have the same rank as FROM. It must be polymorphic if FROM is polymorphic. Each nondeferred parameter of the declared type of TO must have the same value as the corresponding parameter of the declared type of FROM.

Result value

If FROM is unallocated, the allocation status of TO is unallocated.

If FROM is allocated, TO is allocated with the same dynamic type, type parameters, array bounds, and value as those of FROM.

If TO has the TARGET attribute, any pointer associated with FROM is correspondingly associated with TO.

If TO does not have the TARGET attribute, the association status of any pointer that was associated with FROM when you call MOVE_ALLOC becomes undefined.