subroutine set_initiator_space_flags()
use bit_rep_data, only: flag_static_init
use bit_reps, only: set_flag, get_initiator_flag_by_run
use FciMCData, only: CurrentDets, TotWalkers
integer(int64) :: i
integer :: j
integer :: nI(nel)
logical :: tInitiatorDet
tInitiatorDet = .false.
do i = 1_int64, TotWalkers
call decode_bit_det(nI, CurrentDets(:, i))
tInitiatorDet = is_in_initiator_space(CurrentDets(:, i), nI)
if (tInitiatorDet) then
do j = 1, inum_runs
call set_flag(CurrentDets(:, i), get_initiator_flag_by_run(j))
call set_flag(CurrentDets(:, i), flag_static_init(j))
end do
end if
end do
end subroutine set_initiator_space_flags