Clicky

Fortran Wiki
allocated (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

allocated(array) (削除) checks (削除ここまで)(追記) and (追記ここまで)(削除) the (削除ここまで)(削除) status (削除ここまで)(削除) of (削除ここまで)(削除) whether (削除ここまで)(削除) x (削除ここまで)(追記) allocated(scalar) (追記ここまで) (削除) is (削除ここまで)(追記) check (追記ここまで)(削除) allocated. (削除ここまで)(追記) the (追記ここまで)(追記) allocation (追記ここまで)(追記) status (追記ここまで)(追記) of (追記ここまで)(追記) array (追記ここまで)(追記) and (追記ここまで)(追記) scalar (追記ここまで)(追記) , respectively. (追記ここまで)

Standard

Fortran 95 and(削除) later (削除ここまで)(追記) later. (追記ここまで)(追記) Note, (追記ここまで)(追記) the (追記ここまで)(追記) scalar= (追記ここまで)(追記) keyword and allocatable scalar entities are available in Fortran 2003 and later. (追記ここまで)

Class

Inquiry function

Syntax

(削除)

result = allocated(array)

(削除ここまで)
(追記)
  • result = allocated(array)
  • result = allocated(scalar)
(追記ここまで)

Arguments

  • array - the argument shall be an allocatable array.
  • (追記) (追記ここまで)(追記)
  • scalar - the argument shall be an allocatable scalar.
  • (追記ここまで)

Return value

The return value is a scalar logical with the default logical kind type parameter. If(追記) the (追記ここまで)(追記) argument (追記ここまで)(追記) is (追記ここまで)(追記) allocated (追記ここまで)(追記) then (追記ここまで)(追記) the (追記ここまで)(追記) result (追記ここまで)(追記) is (追記ここまで)(削除) array (削除ここまで)(削除) is allocated, (削除ここまで)(削除) allocated(array) (削除ここまで)(削除) is (削除ここまで).true.; otherwise, it returns .false.(追記) . (追記ここまで)

Example

program test_allocated
 integer :: i = 4
 real(4), allocatable :: x(:)
 if (allocated(x) .eqv. .false.) allocate(x(i))
end program test_allocated

See Also

move_alloc

category: intrinsics

Revised on April 2, 2016 09:06:24 by Jason Blevins (173.88.47.127) (953 characters / 0.0 pages)
Edit | Back in time (4 revisions) | Hide changes | History | Views: Print | TeX | Source | Linked from: Intrinsic procedures, move_alloc

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