!-----------------------------------------------------------------------
!  nberel  evaluate relative energy *in plasma frame* of fast neutral
!
!  actually evaluating rel. energy per nucleon, as needed to eval.
!  atomic processes e.g. cx, ionization rate coefficients
!
subroutine nberel(zeovab,j,zrloc,zvtor,zvr,zvy)
  !
  use nbi_com
  !
  !  output argument zeovab = energy / nucleon of neutral in plasma frame
  !
  !  input arguments
  !    j = index to plasma zone (current location)
  !    zrloc = major radius (current location)
  !    zvtor = velocity in toroidal direction
  !    zvr = velocity in r direction
  !    zvy = velocity in y direction
  !
  !
  !
  !  common:  omegag - plasma angular velocity profile
  !
  !--------------------------------------------
  !
  !
  !  plasma velocity in toroidal direction
  !
  !============
  implicit none
  integer :: j
  !============
  real(fp) :: zrloc,zvtor,zvr,zvy,zeovab,zvplas,zv2
  !============
  zvplas=0.5_fp*(omegag(j)+omegag(j+1))*zrloc
  !
  !  rel. velocity **2 in plasma frame
  !
  zv2=zvy**2+zvr**2+(zvtor-zvplas)**2
  !
  !  answer
  !
  zeovab=v2toev*zv2/abeam
  !
  return
end subroutine nberel
