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