anchor.diff:      indiv(j)  = -one
   
       ! CRY ---------------------
  -    if(iturn == 1) then
  -      bool_proc_old(j) = -1
  -    else
  -      if(bool_proc(j) /= -1) then
  -        bool_proc_old(j) = bool_proc(j)
  -      end if
  -    end if
       iProc = proc_out
  -    bool_proc(j) = -1
  -    cry_proc(j)  = -1
  +    cry_proc(j) = proc_out
       ! CRY ---------------------
   
       ! CRY ---------------------
  
positive.code: 
  end module coll_crystal
  
  !===============================================================
  ! MDA: added icoll and MAX_NPART parameters
  !
        SUBROUTINE collimate_cry(icoll, iturn, ie, C_LENGTH, &
       &                   C_ROTATION, &
       &                   C_APERTURE, C_OFFSET, C_TILT, &
       &                   X_IN, XP_IN, Y_IN,   &
       &                   YP_IN, P_IN, S_IN, NP, ENOM, LHIT, LHIT_TURN, &
       &                   PART_ABS, PART_ABS_TURN, IMPACT, INDIV, LINT, &
       &                   BX,BY,AX, &
       &                   AY,EMITX0,EMITY0, &
       &                   name,flagsec,dowrite_impact,MAX_NPART, Cry_tilt, Cry_length)!
  
  !
  !++  Based on routines by JBJ-R.assmann... Re-written for the crystal
  ! case by V.previtali in september 2008
  !
  !++  - Deleted all HBOOK stuff.
  !++  - Deleted optics routine and all parser routines.
  !++  - Replaced RANMAR call by RANLUX call
  !++  - Included RANLUX code from CERNLIB into source
  !++  - Changed dimensions from CGen(100,nmat) to CGen(200,nmat)
  !++  - Replaced FUNPRE with FUNLXP
  !++  - Replaced FUNRAN with FUNLUX
  !++  - Included all CERNLIB code into source: RANLUX, FUNLXP, FUNLUX,
  !++	                                      FUNPCT, FUNLZ, RADAPT,
  !++                                           RGS56P
  !++	 with additional entries:             RLUXIN, RLUXUT, RLUXAT,
  !++                                           RLUXGO
  !++
  !++  - Changed program so that Nev is total number of particles
  !++    (scattered and not-scattered)
  !++  - Added debug comments
  !++  - Put real dp/dx
  !
  !
  !   !!!!!!!!   KNOWN ISSUES:  !!!!!!!
  !      1- the pencil beam is not working in the 6track version (I did not change
  !      the colltrack version yet)
  !
        use coll_db
        use mod_ranlux
        use mod_funlux
  
negative.code:       real(kind=fPrec) Cry_tilt0                        !tilt of the crystal for having channeling (determined by divergence of the beam) [rad]
        real(kind=fPrec) Cry_length                       !original length (from the db) [m]
  
  
  
    ! CRY ---------------------
  