anchor.diff:          x = x + (half*s_length)*xp
           y = y + (half*s_length)*yp
         else
  -        Pvr = (xp_rel-(L_chan/c_rcurv))/(two*xpcrit)
  +        Pvr = (xp_rel-(tdefl-c_miscut))/(two*xpcrit)
           if(rndm4() > Pvr) then
  +          write(*,*) 'TRVR'
             iProc = proc_TRVR
             x     = x + xp*Srefl
             y     = y + yp*Srefl
   
  -          Dxp = (((-three*Ang_rms)*xp_rel)/(two*xpcrit) + Ang_avr) + ((three*Ang_rms)*(tdefl))/(two*xpcrit)
  +          Dxp = (((-three*Ang_rms)*xp_rel)/(two*xpcrit) + Ang_avr) + ((three*Ang_rms)*(tdefl-c_miscut))/(two*xpcrit)
             xp  = xp + Dxp
             x   = x + (half*xp)*(s_length-Srefl)
             y   = y + (half*yp)*(s_length-Srefl)
  
positive.code: 
      Lrefl = xp_rel*r ! Distance of refl. point [m]
      Srefl = sin_mb(xp_rel/two + c_miscut)*Lrefl
  
      if(Lrefl > zero .and. Lrefl < Length) then ! VR point inside
  
        ! 2 options: volume capture and volume reflection
  
  
negative.code: 
        ! Case 3-3: move in amorphous substance (big input angles)
        ! Modified for transition vram daniele
        write(*,*) 'Transition VRAM check'
        write(*,*) 'xp_rel', xp_rel
        write(*,*) 'tdefl', tdefl
        write(*,*) 'miscut', c_miscut
        write(*,*) 'tdefl-miscut', tdefl-c_miscut
        write(*,*) 'xp_rel >', L_chan/r+two*xpcrit, 'or xp_rel <', -xpcrit
        if(xp_rel > tdefl-c_miscut + two*xpcrit .or. xp_rel < -xpcrit) then
          write(*,*) 'Amorphous'
          iProc = proc_AM
          x     = x + (half*s_length)*xp
          y     = y + (half*s_length)*yp
  