subroutine fuslis_sub(mireact,ilreact,zereact, &
     tritium_product, proton_product, proton14_product, he3_product, he4_product, &
     nlfst,nlfhe3,nlrfdeut,nlrftrit,nlrfhe3, &
     ierr)

  !-----------------------------------------------------------------
  ! dmc: guts of fuslis in a subroutine with no module dependency
  !   get information on indexed fusion reactions

  use iso_c_binding, only: fp => c_double
  implicit none

  integer, intent(in) :: mireact   ! reaction index dimension
  logical, intent(out) :: ilreact(mireact)
                                   ! t if reaction produces selected product
  real(fp), intent(out) :: zereact(mireact)
                                   ! energy (ev) of fusion product (estimated)

  !  zero or at most one of the following should be set:
  !  these flags indicate that information is sought on reactions that
  !  produce the given product

  logical, intent(in) :: tritium_product
  logical, intent(in) :: proton_product
  logical, intent(in) :: proton14_product
  logical, intent(in) :: he3_product
  logical, intent(in) :: he4_product

  !  these flags indicate what populations are assumed to exist in the
  !  caller's plasma model:

  logical, intent(in) :: nlfst    ! t means: fusion tritium ions present
  logical, intent(in) :: nlfhe3   ! t means: fusion he3 ions present

  logical, intent(in) :: nlrfdeut ! t means: d rf minority present
  logical, intent(in) :: nlrftrit ! t means: tritium rf minority present
  logical, intent(in) :: nlrfhe3  ! t means: he3 rf minority present

  integer, intent(out) :: ierr    ! 0 means ok; >0: error; -1: no product flag.
  !  ierr=1 -- catfus error; ierr=2 -- more than one product flag set.

  !---------------------------------------------
  !  local

  integer :: icount,iertmp
  !---------------------------------------------

  ierr = 0
  icount = 0

  ilreact = .false.
  zereact = 0.0_fp

  if(tritium_product) then
     !  tritium comes from the d+d reaction (proton branch)

     call catfuslis_r8('t',ilreact,zereact,mireact,nlfst,nlfhe3, &
          nlrfdeut,nlrftrit, nlrfhe3, iertmp)

     ierr=max(ierr,iertmp)
     icount = icount + 1
  endif

  if(proton_product) then
     !  proton comes from the d+d reaction (proton branch) & d+he3 reaction

     call catfuslis_r8('p',ilreact,zereact,mireact,nlfst,nlfhe3, &
          nlrfdeut,nlrftrit, nlrfhe3, iertmp)

     ierr=max(ierr,iertmp)
     icount = icount + 1
  endif

  if(proton14_product) then
     !  proton comes from the d+he3  reaction (proton branch) & d+he3 reaction

     call catfuslis_r8('p14',ilreact,zereact,mireact,nlfst,nlfhe3, &
          nlrfdeut,nlrftrit, nlrfhe3, iertmp)

     ierr=max(ierr,iertmp)
     icount = icount + 1
  endif

  if(he3_product) then
     !  helium-3 comes from the d+d reaction (neutron branch)

     call catfuslis_r8('he3',ilreact,zereact,mireact,nlfst,nlfhe3, &
          nlrfdeut,nlrftrit, nlrfhe3, iertmp)

     ierr=max(ierr,iertmp)
     icount = icount + 1
  endif

  if(he4_product) then
     !  helium-4 comes from d+t, d+he3, and t+t reactions

     call catfuslis_r8('he4',ilreact,zereact,mireact,nlfst,nlfhe3, &
          nlrfdeut,nlrftrit, nlrfhe3, iertmp)

     ierr=max(ierr,iertmp)
     icount = icount + 1
  endif

  if(ierr.ne.0) then
     ierr = 1

  else
     if(icount.eq.0) then
        ierr = -1

     else if(icount.gt.1) then
        ierr = 2
     endif
  endif

end subroutine fuslis_sub
