anchor.diff:  
   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)
  -!
  +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)!
  +
         use coll_db
         use mod_ranlux
         use mod_funlux
  
positive.code: 
    integer, parameter :: max_ncoll = 99
  
    logical,              save :: bool_create
    integer, allocatable, save :: bool_proc(:)
    integer, allocatable, save :: bool_proc_old(:)
  
    integer,           save :: iProc
    logical,           save :: changed_tilt1(max_ncoll)
    logical,           save :: changed_tilt2(max_ncoll)
  
  
negative.code:          real(kind=fPrec)            yp_in0(MAX_NPART)
           real(kind=fPrec)            p_in0(MAX_NPART)    !be careful: [Gev]
           real(kind=fPrec)            s_in0(MAX_NPART)
           integer                     flagsec(MAX_NPART)
           logical                     dowrite_impact
  
  