subroutine hatom_sigv(irtype,Eova,n,izneut,izchrg, sigv, istat)
 
  use iso_c_binding, only: fp => c_double
  use hatom_mod
 
  implicit NONE
 
  !  get sigma*v of a charge exchange or impact ionization reaction
  !  between two colliding beams of light neutral atoms with light
  !  fully stripped ions [H,HE,LI]x[H+,HE++,LI+++], where the interaction
  !  energy "per nucleon" is Eova = mp*vrel**2/2, in KeV.
  !
  !    ---caution-- as of June 2001, the atomic physics database does
  !                 not have all good data on LI.
  !
  !  here, "charge exchange" refers to an ion-neutral reaction, in which
  !  charges are exchanged ***and the ion is neutralized***; a reaction
  !  in which an electron is exchanged but the receiving particle is
  !  not neutralized, should be counted as an impact ionization event.
  !  The rationale:  this routine is intended for use in modeling of
  !  high temperature plasmas; a partially stripped light impurity is
  !  quickly fully stripped, so that the net result of a partial
  !  charge exchange reaction is two fully stripped ions, same as
  !  a "pure" impact ionization reaction.
  !
  !  if charge exchange is requested,
  !  a result of ZERO is returned if there is no neutralizing
  !  charge exchange reaction (e.g He++ cannot be neutralized by cx
  !  with an H neutral beam)
  !
  !  a result of ERROR (-1) is returned if invalid arguments
  !  are passed.
 
  integer, parameter :: CX=1, II=2
 
  integer, parameter :: H=1, HE=2, LI=3
 
  real*8, parameter :: ZERO=0.0d0, ERROR=-1.0D0
  integer, parameter :: IZERO=-1, IERROR=-2
 
  !--------------------------------------------
  !  **subroutine arguments**
 
  integer, intent(in) :: irtype   ! reaction type: =cx or =ii
 
  integer, intent(in) :: n        ! **vector size**
  real(fp), intent(in) :: eova(n)   ! E/A, KeV/nucleon, rel. energy  **vector**
 
  integer, intent(in)  :: izneut  ! Z of neutral species
  integer, intent(in)  :: izchrg  ! Z of ion species
 
  !  **result**
 
  real(fp), intent(out) :: sigv(n)  ! sigma*v, m**3/sec  **vector**
 
  integer, intent(out) :: istat   ! completion code; 0 = normal
 
  !  istat = 2:  irtype argument invalid
  !  istat = 3:  izneut or izchrg invalid
  !
  !--------------------------------------------
  !  local
 
  integer :: lreact   ! reaction handle
 
  !--------------------------------------------
  !  initialize module, if necessary
 
  if(hatom_flag.eq.0) call hatom_init
 
  !--------------------------------------------
 
  istat = 0
  lreact = IZERO
 
  if(irtype.eq.CX) then
 
     !  ---------> (neutralizing) charge exchange
 
     if(izneut.eq.H) then
        if(izchrg.eq.H) then
           lreact = Lcx_H0_H
        else if(izchrg.eq.HE) then
           lreact = IZERO          ! cannot neutralize HE
        else if(izchrg.eq.LI) then
           lreact = IZERO          ! cannot neutralize LI
        else
           istat = 3
           lreact = IERROR
        endif
 
     else if(izneut.eq.HE) then
        if(izchrg.eq.H) then
           lreact = Lcx_HE0_H
        else if(izchrg.eq.HE) then
           lreact = Lcx_HE0_HE
        else if(izchrg.eq.LI) then
           lreact = IZERO          ! cannot neutralize LI
        else
           istat = 3
           lreact = IERROR
        endif
 
     else if(izneut.eq.LI) then
        if(izchrg.eq.H) then
           lreact = Lcx_LI0_H
        else if(izchrg.eq.HE) then
           lreact = Lcx_LI0_HE
        else if(izchrg.eq.LI) then
           lreact = Lcx_LI0_LI
        else
           istat = 3
           lreact = IERROR
        endif
 
     else
 
        istat = 3
        lreact = IERROR
 
     endif
 
  else if(irtype.eq.II) then
 
     !  ---------> impact ionization
     !      or, sum of impact ionization and partial charge exchange
 
     if(izneut.eq.H) then
        if(izchrg.eq.H) then
           lreact = Lii_H0_H
        else if(izchrg.eq.HE) then
           lreact = Lii_H0_HE
        else if(izchrg.eq.LI) then
           lreact = Lii_H0_LI
        else
           istat = 3
           lreact = IERROR
        endif
 
     else if(izneut.eq.HE) then
        if(izchrg.eq.H) then
           lreact = Lii_HE0_H
        else if(izchrg.eq.HE) then
           lreact = Lii_HE0_HE
        else if(izchrg.eq.LI) then
           lreact = Lii_HE0_LI
        else
           istat = 3
           lreact = IERROR
        endif
 
     else if(izneut.eq.LI) then
        if(izchrg.eq.H) then
           lreact = Lii_LI0_H
        else if(izchrg.eq.HE) then
           lreact = Lii_LI0_HE
        else if(izchrg.eq.LI) then
           lreact = Lii_LI0_LI
        else
           istat = 3
           lreact = IERROR
        endif
 
     else
 
        istat = 3
        lreact = IERROR
 
     endif
 
  else
     istat = 2
     lreact = IERROR
  endif
 
  if(lreact.eq.IZERO) then
 
     sigv = ZERO
 
  else if(lreact.eq.IERROR) then
 
     sigv = ERROR
 
  else
 
     if(irtype.eq.CX) then
 
        call cx_coldtarget_sigmatimesv(lreact, eova, sigv, n)
 
     else if(irtype.eq.II) then
 
        call ii_coldtarget_sigmatimesv(lreact, eova, sigv, n)
 
     endif
 
  endif
 
end subroutine hatom_sigv
