function check_static_init(ilut, nI, sgn, ex, run) result(staticInit)
use bit_rep_data, only: flag_adi_checked, flag_static_init
use adi_data, only: tReferenceChanged
implicit none
integer(n_int), intent(inout) :: ilut(0:NIfTot)
real(dp), intent(in) :: sgn(lenof_sign)
integer, intent(in) :: nI(nel), ex, run
logical :: staticInit
staticInit = .false.
! Doubles are always initiators if the corresponding flag is set
if (tAdiActive) then
! Only check for the adi flags if this was not done before, or
! if the superinitiator pool changed
if (.not. test_flag(ilut, flag_adi_checked) .or. tReferenceChanged) &
call set_adi_flags(ilut, nI, sgn, ex)
! Check if the sign of the determinant changed, if yes, re-evaluate the adi flags
! only for this run
! suspend the sign change check for now
! else
! if(check_sign_changed(ilut, sgn, run)) &
! call set_adi_flags_run(ilut, nI, sgn, run)
! end if
! If the adi check was not done yet, do it now for all runs and then
! set the corresponding flags
! By doing so, we ensure the check is done exactly one per run
! return the flag of the requested run
staticInit = test_flag(ilut, flag_static_init(run))
end if
end function check_static_init