!******************** start file depdef.for *************
!---------------------------------------------------------------------
! some definitions from depnrm have been moved here to
! facilitate parallelization
!-------------------------------------------
!
subroutine depdef
  !
  use nbi_com
  !
  implicit none

  integer :: j,jp1
  !
  !------------------------------------------------------------------
  !
  !
  bpjxbs_dep(lsbeam)=bpjxbs(lsbeam)
  bpjxbs(lsbeam)=0.0_fp     ! sum reused, nb0jxb in orbit loop
  !
  !     jxb:  flr->g.c.
  bphjxbs_dep(lsbeam)=bphjxbs(lsbeam)
  bphjxbs(lsbeam)=0.0_fp    ! sum reused, nb0jxb in orbit loop

  do j=lcentr,ledge
     jp1=j+1
     !
     tqjxbs_dep(j,lsbeam)=tqjxbs(j,lsbeam)
     tqjxbs(j,lsbeam)=0.0_fp ! sum reused, nb0jxb in orbit loop
     !
     pbephis_dep(j,lsbeam)=pbephis(j,lsbeam)
     pbephis(j,lsbeam)=0.0_fp ! sum reused, nb0jxb in orbit loop
     !
     !     radial current contributions
     !
     tirtots_dep(jp1,lsbeam)=tirtots(jp1,lsbeam)
     tirtots(jp1,lsbeam)=0.0_fp ! sum reused, nb0jxb in orbit loop

     fpixbts_dep(jp1,lsbeam)=fpixbts(jp1,lsbeam)
     fpixbts(jp1,lsbeam)=0.0_fp ! sum reused, nb0jxb in orbit loop
  end do
end subroutine depdef
!
subroutine depdef_bl
  !
  use nbi_com
  !
  implicit none

  integer :: j,ib
  !
  !------------------------------------------------------------------
  ! jxb torque from deposition  for each beam line if any
  !
  if(nbeam.gt.0) then

     do ib = 1, nbeam
        if(lsbeama(ib).eq.lsbeam) then
           do  j=lcentr,ledge
              tqjxb_nb_dep(j,ib)=tqjxb_nb(j,ib)
              tqjxb_nb(j,ib)=0.0_fp ! sum reused, nb0jxb in orbit loop
           end do
        end if
     end do

  end if
end subroutine depdef_bl
!c******************** end file depdef.for ***************
