! written by nbigen.py
! *** do not edit *** (use nbigen.py instead)
 
subroutine nbi_alloc_track_zone(jsize)
 
  use nbi_com
  use logmod
  implicit NONE
 
  integer, intent(in) :: jsize
 
  logical :: ia
 
  !==============================================
  ! internal arrays
 
  if(jsize.le.0) then
     call warnLog(' nbi_alloc_track_zone: jsize.le.0')
     call nbi_dalloc_track_zone
     return
  endif
  ia=.TRUE.
  if(allocated(TRACK_XL)) then
     if(size(TRACK_XL).eq.jsize) then
        ia=.FALSE.
     else
        call nbi_dalloc_track_zone
     endif
  endif
 
  ! arrays are set to zero regardless of (ia) setting.
 
  if(ia) allocate(TRACK_XL(jsize)); TRACK_XL = zero
  if(ia) allocate(TRACK_PDEP(jsize)); TRACK_PDEP = zero
  if(ia) allocate(TRACK_DR_FLR(jsize)); TRACK_DR_FLR = zero
  if(ia) allocate(TRACK_DZ_FLR(jsize)); TRACK_DZ_FLR = zero
  if(ia) allocate(TRACK_DE_FLR(jsize)); TRACK_DE_FLR = zero
  if(ia) allocate(TRACK_VPV_DEP(jsize)); TRACK_VPV_DEP = zero
  if(ia) allocate(TRACK_DVPV_FLR(jsize)); TRACK_DVPV_FLR = zero
  if(ia) allocate(TRACK_XJADEP(jsize)); TRACK_XJADEP = zero
 
  write(nonlin,*)'% nbi_alloc_track_zone: alloc done, jsize=',jsize
end subroutine nbi_alloc_track_zone
