       subroutine triply1(l,d,u,y,n)
C
C  apply LDU factors to solve tridiagonal system.  Answer overwrite y.
C
      implicit none
      integer n
      real l(n),d(n),u(n),y(n)
C
#define E(im) y(im)
#define F(im) y(im)
C
      integer im
C
      if(n.le.0) return
C
      if(n.gt.1) then
	  call rbi(l(1),1,y(1),1,n,0)
      endif
C
      do im=1,n
	       y(im)=y(im)*d(im)
      enddo
C
      if(n.gt.1) then
	  call rbi(u(n),-1,y(n),-1,n,0)
      endif
C
      return
      end
