anchor.diff:             CALL CRYST(mat,X,XP,Z,ZP,p,cry_length,j)
   !           write(*,*) "p after exit", p
              write(*,*) "xp after crystal coll routine exit", XP
  -           s=Rcurv*sin(cry_bend)
  -           zlm=Rcurv*sin(cry_bend)
  +           s=Rcurv  *sin_mb(cry_bend)
  +           zlm=Rcurv*sin_mb(cry_bend)
              if(iProc /= proc_out) then
                NHIT = NHIT + 1
                LHIT(j) = ie
  
positive.code:                            X_temp=X
                             S_temp=S
                             XP_temp=XP
                             S=S_temp*cos(-tilt_int)+X_temp*sin(-tilt_int)
                             X=-S_temp*sin(-tilt_int)+X_temp*cos(-tilt_int)
                             XP=XP_temp + tilt_int
              !     2nd: shift back the 2 axis
                             X=X+X_int
  
negative.code:             pc = pc - dest*Rlength
            else
              Dxp = (Length-Lrefl)/Rcurv
              x   = x + sin_mb(half*Dxp+xp)*Rlength ! Trajectory at channeling exit
              y   = y + red_S * yp
              xp  = Length/Rcurv + half*ran_gauss(one)*xpcrit ! [mrad]
  
  