subroutine  nbi_deptrk_zone_realloc(inz_p,inz_c,iadr_empty,imibs)
  use nbi_com
  implicit none
  integer, intent(in) :: imibs
  integer, dimension(imibs), intent(in) :: inz_p,inz_c
  integer, dimension(imibs), intent(out) :: iadr_empty
  integer :: isb,j,jmax,jmax_n,j1,j2
  if(imibs.lt.1) return

  iadr_empty(1)=inz_p(1)+1

  isb=imibs
  do while (isb.gt.1)

     jmax=sum(inz_p(1:isb))
     jmax_n=sum(inz_c(1:isb-1))+inz_p(isb)+1

     do j=jmax,jmax-inz_p(isb)+1,-1
        jmax_n=jmax_n-1

        track_xl(jmax_n)=track_xl(j)
        track_pdep(jmax_n)=track_pdep(j)
        track_dr_flr(jmax_n)=track_dr_flr(j)
        track_dz_flr(jmax_n)=track_dz_flr(j)
        track_de_flr(jmax_n)=track_de_flr(j)
        track_vpv_dep(jmax_n)=track_vpv_dep(j)
        track_dvpv_flr(jmax_n)=track_dvpv_flr(j)
        track_xjadep(jmax_n)=track_xjadep(j)

     enddo
!zeroed empty space
     j1=jmax_n-inz_c(isb-1)+inz_p(isb-1)
     j2=jmax_n-1

     track_xl(j1:j2)=0.0_fp
     track_pdep(j1:j2)=0.0_fp
     track_dr_flr(j1:j2)=0.0_fp
     track_dz_flr(j1:j2)=0.0_fp
     track_de_flr(j1:j2)=0.0_fp
     track_vpv_dep(j1:j2)=0.0_fp
     track_dvpv_flr(j1:j2)=0.0_fp
     track_xjadep(j1:j2)=0.0_fp

     iadr_empty(isb)=j1
     isb = isb -1
  enddo

end subroutine nbi_deptrk_zone_realloc
