create_avail_neighbors_list Subroutine

public subroutine create_avail_neighbors_list(ilutI, neighbors, orbs, n_orbs)

Arguments

Type IntentOptional Attributes Name
integer(kind=n_int), intent(in) :: ilutI(0:NIfTot)
integer, intent(in) :: neighbors(:)
integer, intent(out), allocatable :: orbs(:)
integer, intent(out) :: n_orbs

Contents


Source Code

    subroutine create_avail_neighbors_list(ilutI, neighbors, orbs, n_orbs)
        integer(n_int), intent(in) :: ilutI(0:NIfTot)
        integer, intent(in) :: neighbors(:)
        integer, intent(out), allocatable :: orbs(:)
        integer, intent(out) :: n_orbs

        integer :: i, temp_orbs(size(neighbors))

        n_orbs = 0
        temp_orbs = 0

        do i = 1, ubound(neighbors, 1)
            if (IsNotOcc(ilutI, neighbors(i))) then
                n_orbs = n_orbs + 1
                temp_orbs(n_orbs) = neighbors(i)
            end if
        end do

        allocate(orbs(n_orbs), source=temp_orbs(1:n_orbs))

    end subroutine create_avail_neighbors_list