Clicky
Showing changes from revision #3 to #4:
(追記) Added (追記ここまで) | (削除) Removed (削除ここまで) | (削除) Chan (削除ここまで)(追記) ged (追記ここまで)
allocated(array)
checks the status of whether x
is allocated.
Fortran 95 and later
result = allocated(array)
array
- the argument shall be an allocatable
array.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.
program test_allocated
integer :: i = 4
real(4), allocatable :: x(:)
if (allocated(x) .eqv. .false.) allocate(x(i))
end program test_allocated
(追記)