      SUBROUTINE ROOT(XOLD,YOLD,X,Y,XINT)
C
C     ROUTINE FOR THE ITERATIVE COMPUTATION OF THE POINTS OF
C     INTERSECTION OF RAYS WITH INTERFACES
C
      DIMENSION Y(3),YOLD(3),DEP(6)
      COMMON /ZERO/ RNULL
C
      CALL DISC(Y,DEP)
      ZP2=DEP(1)
      CALL DISC(YOLD,DEP)
      ZP1=DEP(1)
      AUX1=ZP1-YOLD(3)
      AUX2=Y(3)-ZP2
      AUX=AUX1+AUX2
      XINT=(AUX1*X+AUX2*XOLD)/AUX
      IF(XINT.LT.XOLD.OR.XINT.GT.X)XINT=.5*(XOLD+X)
      IF(abs(XINT-XOLD).lt.rnull)XINT=.5*(XOLD+X)
      RETURN
      END
