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