anchor.diff:  
         t = 0 ! default value to cover ichoix=1
   
  -      if (ichoix.eq.1) then
  -
  -        PROC = 'absorbed'            !deep inelastic, impinging p disappeared
  +      if (ichoix.eq.1) then !deep inelastic, impinging p disappeared
  +
           iProc = proc_absorbed
   
         endif
   
         if (ichoix.eq.2) then          ! p-n elastic
  -        PROC = 'pne'
           iProc = proc_pne
           t = -log(dble(rndm4()))/bn(IS)
         endif
   
         if ( ichoix .eq. 3 ) then   !p-p elastic
  -        PROC='ppe'
           iProc = proc_ppe
           t = -log(dble(rndm4()))/bpp
         endif
   
         if ( ichoix .eq. 4 ) then   !single diffractive
  -        PROC='diff'
           iProc = proc_diff
           xm2 = exp( dble(rndm4()) * xln15s )
           PC = PC  *(1.d0 - xm2/ecmsq)
  
positive.code:             !              write(*,*) "p after exit", p
                            s=Rcurv*sin(cry_bend-tilt_int)
                            zlm=Rcurv*sin(cry_bend-tilt_int)
                            if (PROC(1:3).ne.'out')then
                               X_rot=X_int
                               S_rot=S_int
                               XP_rot=XP_int
                               S_shift=S_rot*cos(-Cry_tilt)+X_rot*sin(-Cry_tilt)
  
negative.code:             tdech=Ldech/Rcurv
              Sdech=Ldech*cos(xp+0.5*tdech)
              IF(Ldech .LT. (Length-Lrefl)) then
                iProc = proc_DC
                Dxp= Ldech/Rcurv + 0.5*ran_gauss(1.0d0)*xpcrit
                x  = x+ Ldech*(sin(0.5*Dxp+xp))   ! trajectory at channeling exit
  