anchor.diff:  
       else
   
  +!      write(*,*) "not actually hit"
         s = c_rcurv*sin_mb(cry_length/c_rcurv)
         x = x + s*xp
         z = z + s*zp
  
positive.code:   else
  
      if(x < zero) then ! Crystal hit from below
  !      write(*,*) 'CHECK', x
        xp_tangent = sqrt((-(two*x)*c_rcurv + x**2)/c_rcurv**2)
  !      write(*,*) 'tangent', xp_tangent, xp
  
negative.code:   ! Check that particle hit the crystal
    if(x >= zero .and. x < c_xmax) then
  
  !    write(*,*) "front face hit"
      ! MISCUT first step: P coordinates
      s_P = (c_rcurv-c_xmax)*sin_mb(-c_miscut)
      x_P = c_xmax + (c_rcurv-c_xmax)*cos_mb(-c_miscut)
  