anchor.diff:  
         else
   
  -        s = rcurv*sin_mb(cry_length/rcurv)
  +        s = c_rcurv*sin_mb(cry_length/c_rcurv)
           x = x + s*xp
           z = z + s*zp
   
  
positive.code: 
        ! Case 3-3: move in amorphous substance (big input angles)
        ! Modified for transition vram daniele
        if(xp_rel > L_chan/Rcurv + two*xpcrit .or. xp_rel < -xpcrit) then
          iProc = proc_AM
          x     = x + (half*s_length)*xp
          y     = y + (half*s_length)*yp
  
negative.code:     return
  
    ! SECOND CASE: p hits the amorphous layer
    else if(x < c_alayer .or. y-ymin < c_alayer .or. ymax-y < c_alayer) then
      x0    = x
      y0    = y
      a_eq  = one + xp**2
      b_eq  = (two*x)*xp - (two*xp)*c_rcurv
      c_eq  = x**2 - (two*x)*c_rcurv
      Delta = b_eq**2 - (four*a_eq)*c_eq
      s     = (-b_eq+sqrt(Delta))/(two*a_eq)
      if(s >= s_length) then
  