Clicky

Fortran Wiki
move_alloc (changes)

Skip the Navigation Links | Home Page | All Pages | Recently Revised | Authors | Feeds | Export |

Showing changes from revision #4 to #5: (追記) Added (追記ここまで) | (削除) Removed (削除ここまで) | (削除) Chan (削除ここまで)(追記) ged (追記ここまで)

Description

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

Standard

Fortran 2003 and later

Class

(削除) Subroutine (削除ここまで)(追記) Pure (追記ここまで)(追記) subroutine (追記ここまで)

Syntax

(削除)

call move_alloc(src, dest)

(削除ここまで)
(追記)
call move_alloc(src, dest)
(追記ここまで)

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

program test_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 test_move_alloc

See Also

allocated

category: intrinsics

Revised on April 4, 2016 15:00:48 by Jason Blevins (128.146.137.52) (895 characters / 0.0 pages)
Edit | Back in time (4 revisions) | Hide changes | History | Views: Print | TeX | Source | Linked from: Intrinsic procedures, allocated, Fortran 2003 status

AltStyle によって変換されたページ (->オリジナル) /