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