LinSearchParts Subroutine

private subroutine LinSearchParts(DetArray, iLut, MinInd, MaxInd, PartInd, tSuccess)

Arguments

Type IntentOptional Attributes Name
integer(kind=n_int) :: DetArray(0:NIfTot,1:MaxInd)
integer(kind=n_int) :: iLut(0:NIfTot)
integer :: MinInd
integer :: MaxInd
integer :: PartInd
logical :: tSuccess

Contents

Source Code


Source Code

    SUBROUTINE LinSearchParts(DetArray, iLut, MinInd, MaxInd, PartInd, tSuccess)
        INTEGER :: MinInd, MaxInd, PartInd
        INTEGER(KIND=n_int) :: iLut(0:NIfTot), DetArray(0:NIfTot, 1:MaxInd)
        INTEGER :: N, Comp
        LOGICAL :: tSuccess

        N = MinInd
        do while (N <= MaxInd)
            Comp = DetBitLT(DetArray(:, N), iLut(:), nifd)
            IF (Comp == 1) THEN
                N = N + 1
            else if (Comp == -1) THEN
                PartInd = N - 1
                tSuccess = .false.
                RETURN
            ELSE
                tSuccess = .true.
                PartInd = N
                RETURN
            end if
        end do
        tSuccess = .false.
        PartInd = MaxInd - 1

    END SUBROUTINE LinSearchParts