function unset_incoherent_initiator(exLevel, ilut, nI, sgn, iRef, &
staticInit, run) result(tSuspendADI)
use adi_data, only: tStrictCoherentDoubles, nIncoherentDets
use adi_references, only: check_sign_coherence
! This version of the coherence check now only prevents us from setting
! the initiator flag via ADI, but not by regular means. So we can't remove 'normal'
! initiators anymore and also not make deterministic space determinants non-initiators
implicit none
integer, intent(in) :: exLevel, iRef
integer(n_int), intent(in) :: ilut(0:NIfTot)
real(dp), intent(in) :: sgn(lenof_sign)
logical, intent(inout) :: staticInit
integer, intent(in) :: run, nI(nel)
logical :: tSuspendADI
tSuspendADI = .false.
if (tStrictCoherentDoubles .and. (exLevel > 0)) then
if (.not. check_sign_coherence(ilut, nI, sgn, iRef, run)) then
! If not, do not let the determinant be an initiator
! Note that this strikes anytime, even if it is coherent with
! the reference to which it is the double, but not with some other one
! (if we have e.g. another reference that is a single)
tSuspendADI = .true.
staticInit = .false.
nIncoherentDets = nIncoherentDets + 1
end if
end if
end function unset_incoherent_initiator