Clicky

Fortran Wiki
move_alloc (Rev #3, changes)

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

Showing changes from revision #2 to #3: (追記) 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

Syntax

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.
(削除)

Return value

(削除ここまで)
(削除) (削除ここまで)(削除)

None

(削除ここまで)
(削除) (削除ここまで)

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 (削除ここまで)(追記) 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 (追記ここまで)

category: intrinsics

Revision from September 4, 2010 11:32:02 by Jason Blevins
Forward in time (2 more) | Back in time (2 more) | See current | Hide changes | History | Rollback | View: Source | Linked from: Intrinsic procedures, allocated, Fortran 2003 status

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