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) argument. The corresponding actual argument must be an allocatable object. The actual argument can be a scalar or an array.
TO
An INTENT(INOUT) argument. The corresponding actual argument 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 the actual argument associated with TO must have the same value as the corresponding parameter of the declared type of the actual argument associated with FROM.

Result value

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

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.