      subroutine SINTRP(XOUT,YOUT,YPOUT,Y,PHI)
      common /STDATA/ X,RVAR(77),PSI(12),NEQN,KOLD,IVAR(4),LVAR(3)
      double precision XOUT,YOUT,YPOUT,Y,PHI,G,W,RHO,X,RVAR,
     &PSI,HI,TEMP1,TERM,PSIJM1,GAMMA,ETA,TEMP2,TEMP3
      integer NEQN,KI,KOLD,KIP1,I,J,JM1,LIMIT1,L,IVAR
      logical LVAR
      dimension Y(NEQN),YOUT(NEQN),YPOUT(NEQN),PHI(NEQN,16),
     &          G(13),W(13),RHO(13)
      data G(1)/1.0/,RHO(1)/1.0/
      HI = XOUT-X
      KI = KOLD+1
      KIP1 = KI+1
      do 100 I = 1, KI
         TEMP1 = I
         W(I) = 1.0/TEMP1
100   continue
      TERM = 0.0
      do 120 J = 2, KI
         JM1 = J-1
         PSIJM1 = PSI(JM1)
         GAMMA = (HI+TERM)/PSIJM1
         ETA = HI/PSIJM1
         LIMIT1 = KIP1-J
         do 110 I = 1, LIMIT1
            W(I) = GAMMA*W(I)-ETA*W(I+1)
110      continue
         G(J) = W(1)
         RHO(J) = GAMMA*RHO(JM1)
         TERM = PSIJM1
120   continue
      do 130 L = 1, NEQN
         YPOUT(L) = 0.0
         YOUT(L) = 0.0
130   continue
      do 150 J = 1, KI
         I = KIP1-J
         TEMP2 = G(I)
         TEMP3 = RHO(I)
         do 140 L = 1, NEQN
            YOUT(L) = YOUT(L)+TEMP2*PHI(L,I)
            YPOUT(L) = YPOUT(L)+TEMP3*PHI(L,I)
140      continue
150   continue
      do 160 L = 1, NEQN
         YOUT(L) = Y(L)+HI*YOUT(L)
160   continue
      return
      end
