The ALLOCATED function returns a true or false value indicating the status of an allocatable variable.
Syntax
ALLOCATED (array)
array is an INTENT(IN) array with the allocatable attribute.
The result is a scalar of default LOGICAL type. It has the value true if array is currently allocated and false if array is not currently allocated.
Example
integer, allocatable :: i(:) write(*,*) allocated(i) ! writes F allocate (i(2)) write(*,*) allocated(i) ! writes T