Clicky

Fortran Wiki
allocated (Rev #4, changes)

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

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

Description

allocated(array) checks the status of whether x is allocated.

Standard

Fortran 95 and later

Class

Inquiry function

Syntax

result = allocated(array)

Arguments

  • array - the argument shall be an allocatable array.

Return value

The return value is a scalar logical with the default logical kind type parameter. If 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

Revision from September 4, 2010 12:05:38 by Jason Blevins
Forward in time (to current) | Back in time (3 more) | See current | Hide changes | History | Rollback | View: Source | Linked from: Intrinsic procedures, move_alloc

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