subroutine generate_ref_space()
use LoggingData, only: ref_filename, tWriteRefs
implicit none
integer :: refs_found, all_refs_found
integer(n_int) :: ref_buf(0:NIfTot, maxNRefs), si_buf(0:NIfTot, maxNRefs)
if (NoTypeN > InitiatorWalkNo) then
call get_threshold_based_SIs(ref_buf, refs_found)
! communicate the SIs
call communicate_threshold_based_SIs(si_buf, ref_buf, refs_found, all_refs_found)
! And write the so-merged references to ilutRef
! we need to be sure ilutRefAdi has the right size
nRefs = all_refs_found
call reallocate_ilutRefAdi(nRefs)
ilutRefAdi(0:NIfTot, 1:nRefs) = si_buf(0:NIfTot, 1:nRefs)
else
call fixed_number_SI_generation()
end if
if (iProcIndex == root) &
write(stdout, *) "Getting superinitiators for all-doubs-initiators: ", nRefs, " SIs found"
if (tWriteRefs) call output_reference_space(ref_filename)
end subroutine generate_ref_space