	SUBROUTINE TXPR(NL,VT,VB,DZ,PMIN,PMAX,DP,IR,MULTIN,
     &  NTP,ILA,PPP,XXX,TT)
C ** RAY TRACING MAIN LOGIC **
	DIMENSION VT(*),VB(*),DZ(*),XXX(*),TT(*)
	DIMENSION IR(*),MULTIN(*),ILA(*),PPP(*)
C
	NTP=0
	NL1=NL
	P=PMIN
45	X=0.
	T=0.
C
	DO 5 I=1,NL1
	M=MULTIN(I)
	I1=I+1
	ABP=ABS(P)
	CALL TXGRD(ABP,VT(I),VB(I),DZ(I),DT,DX,IN)
	IF(IN.EQ.0) GO TO 50
	IF(P.LT.0.0) DX=-DX
	X=X+DX*M
	T=T+DT*M
C ***********************************************
	IF(IN.EQ.1.OR.IR(I).EQ.1) THEN
	  NTP=NTP+1
	  XXX(NTP)=X
	  TT(NTP)=T
	  PPP(NTP)=P
	  ILA(NTP) = I !**POST CRITICAL REFLECTION
C
	  IF(IN.EQ.1) THEN
        	GO TO 62
	  ELSE
		A2=1./VT(I1)
		IF(ABP.LT.A2) ILA(NTP) = -I !**PRE CRITICAL REFLECTION
	  ENDIF
C
	ENDIF
5	CONTINUE
	GO TO 62
50	NL1=I-1
62	P=P+DP
   	IF(P.GT.PMAX) GO TO 65
	GO TO 45
C **** COMPUTATION  FINISHED ****
65	CONTINUE
	RETURN
	END
