anchor.diff:      ! DRIFT PART
       if(stracki == 0) then
         if(iexact) then
  -        zpj=sqrt(one-rcxp(j)**2-rcyp(j)**2)
  +        zpj    = sqrt(one-rcxp(j)**2-rcyp(j)**2)
           rcx(j) = rcx(j) - (half*c_length)*(rcxp(j)/zpj)
           rcy(j) = rcy(j) - (half*c_length)*(rcyp(j)/zpj)
         else
  
positive.code:       end if
  
        if(part_abs_pos(j) == 0 .and. part_abs_turn(j) == 0) then
          nspx = sqrt(abs(gammax*xj**2 + two*talphax(ie)*xj*xpj +tbetax(ie)*xpj**2)/c_emitx0_collgap)
          nspy = sqrt(abs(gammay*yj**2 + two*talphay(ie)*yj*ypj +tbetay(ie)*ypj**2)/c_emity0_collgap)
          sum_ax(ie)   = sum_ax(ie) + nspx
          sqsum_ax(ie) = sqsum_ax(ie) + nspx**2
          sum_ay(ie)   = sum_ay(ie) + nspy
  
negative.code:   integer, private, save :: num_selhit     = 0
    integer, private, save :: n_impact       = 0
  
    ! Variables for finding the collimator with the smallest gap and defining, stroring the gap rms error
    real(kind=fPrec), allocatable, save :: xbob(:)    ! (nblz)
    real(kind=fPrec), allocatable, save :: ybob(:)    ! (nblz)
    real(kind=fPrec), allocatable, save :: xpbob(:)   ! (nblz)
    real(kind=fPrec), allocatable, save :: ypbob(:)   ! (nblz)
  
    real(kind=fPrec), allocatable, save :: xineff(:)  ! (npart)
    real(kind=fPrec), allocatable, save :: yineff(:)  ! (npart)
    real(kind=fPrec), allocatable, save :: xpineff(:) ! (npart)
    real(kind=fPrec), allocatable, save :: ypineff(:) ! (npart)
  
    integer, private, save :: num_surhit     = 0
    integer, private, save :: num_selabs     = 0
    integer, private, save :: iturn_last_hit = 0
    integer, private, save :: iturn_absorbed = 0
  
    real(kind=fPrec), private, save :: scale_bx0 = zero
    real(kind=fPrec), private, save :: scale_by0 = zero
    real(kind=fPrec), private, save :: bx_dist   = zero
    real(kind=fPrec), private, save :: by_dist   = zero
    real(kind=fPrec), private, save :: nspx      = zero
    real(kind=fPrec), private, save :: nspy      = zero
  
  #ifdef HDF5
    ! Variables to save hdf5 dataset indices
  