[UP]


Manual Reference Pages  - move_alloc (3)

NAME

move_alloc(3f) - [FORTRAN:INTRINSIC] Move allocation from one object to another

CONTENTS

Syntax
Description
Arguments
Example
Standard
Class
See Also

SYNTAX

call move_alloc(src, dest)

DESCRIPTION

move_alloc(src, dest) moves the allocation from SRC to DEST. SRC will become deallocated in the process.

ARGUMENTS

SRC - ALLOCATABLE, intent(inout), may be of any type and kind.
DEST - ALLOCATABLE, intent(out), shall be of the same type, kind and rank as SRC.

EXAMPLE

Sample program:

   program demo_move_alloc
       integer, allocatable :: a(:), b(:)

allocate(a(3)) a = [ 1, 2, 3 ] call move_alloc(a, b) print *, allocated(a), allocated(b) print *, b end program demo_move_alloc

STANDARD

[[Fortran 2003]] and later

CLASS

Pure subroutine

SEE ALSO

[[allocated]]


move_alloc (3) March 18, 2019
Generated by manServer 1.08 from e45fed50-c183-4624-adc6-6fd71fb64d8d using man macros.