subroutine gen_excit_mol_tc(nI, ilut, nJ, ilutJ, exFlag, ic, ExcitMat, &
tParity, pGen, HelGen, store, part_type)
use ueg_excit_gens, only: gen_ueg_excit
integer, intent(in) :: nI(nel), exFlag
integer(n_int), intent(in) :: ilut(0:NIfTot)
integer, intent(out) :: nJ(nel), IC, ExcitMat(2, maxExcit)
logical, intent(out) :: tParity
real(dp), intent(out) :: pGen
HElement_t(dp), intent(out) :: HElGen
type(excit_gen_store_type), intent(inout), target :: store
integer, intent(in), optional :: part_type
integer(n_int), intent(out) :: ilutJ(0:NIfTot)
character(*), parameter :: this_routine = 'gen_excit_mol_tc'
real(dp) :: r
r = genrand_real2_dSFMT()
! select if a triple shall be generate
if (r < pTriples) then
call generate_triple_excit(nI, ilut, nJ, ilutJ, ExcitMat, tParity, pGen, &
HelGen, store)
pGen = pGen * pTriples
IC = 3
else
call generate_two_body_excitation(nI, ilut, nJ, ilutJ, exFlag, ic, ExcitMat, &
tParity, pGen, HelGen, store, part_type)
pGen = pGen * (1.0 - pTriples)
end if
end subroutine gen_excit_mol_tc