!-----------------------------------------------------------------------
!  fusnrm -- renormalize total fusion source to match data
!
subroutine fusnrm(ident,zdata)
  !
  !  dmc 7 jul 1992
  !
  ! input:
  !  ident -- identifies the fusion product species
  !  zdata -- identifies the total source magnitude desired
  !
  ! output: -- the source functions in transp common are renormalized.
  !
  !
  !
  use nbi_com
  !
  !  set .true. for reactions that produce a desired fusion product:
  !============
  implicit none
  integer :: ident,ireact,iz
  !============
  real(fp) :: zdata,zsum,znorm
  !============
  logical ilreact(mireact)
  !
  !  initial energy (ev) of fusion product so produced:
  real(fp) :: zereact(mireact)
  !
  !-------------------------------------------------------------
  !
  !  get the list of reactions with this fusion product, and the product
  !  energy from these reactions
  !
  call fuslis(ident,ilreact,zereact)
  !
  zsum=0.0_fp
  do ireact=1,nreact
     if(ilreact(ireact)) then
        do iz=1,nfbzns
           !
           !  ptcl sum
           !
           zsum=zsum+sfusion(iz,ireact)
           !

        end do
     end if

  end do
  !
  !  evaluate the normalization
  !
  if(zsum.le.0.0_fp) then
     znorm=1.0_fp
  else
     znorm=zdata/zsum
  end if
  !

  write(nonlin,1001) znorm,ident,abeams(ident),xzbeams(ident)
1001 format( &
       ' %fusnrm -- applying normalization factor ',1pe11.4,' to fusion'/ &
       '  product species ident=',i1,' a=',1pe11.4,' z=',1pe11.4)
  !
  !  apply the normalization
  !
  do ireact=1,nreact
     if(ilreact(ireact)) then
        do iz=1,nfbzns
           !
           sfusion(iz,ireact)=sfusion(iz,ireact) * znorm
           !
        end do
     end if
  end do
  !
  return
end subroutine fusnrm
