       subroutine triply(l,i,d,j,u,k,y,ly,m,n)
C
C  apply LDU factors to solve tridiagonal system.  Answer overwrite y.
C
      implicit none
      integer m,n,i,j,k,ly
      real l(i,n),d(j,n),u(k,n),y(ly,n)
C
#define Y(im) y(ii,im)
#define E(im) y(ii,im)
#define F(im) y(ii,im)
#define L(im) l(ii,im)
#define D(im) d(ii,im)
#define U(im) u(ii,im)
C
      integer ii,im
C
      if(n.le.0) return
C
C###20 [fc] Loop on line 20 of triply.f (DO II) fully vectorized%%%
      do ii=1,m
	  E(1)=Y(1)
      enddo
C
      do im=2,n,1
C###25 [fc] Loop on line 25 of triply.f (DO II) fully vectorized%%%
	  do ii=1,m
	       E(im)=Y(im)-L(im)*E(im-1)
	  enddo
      enddo
C
C###30 [fc] Loop on line 30 of triply.f (DO II) fully vectorized%%%
      do ii=1,m
	  F(n)=E(n)*D(n)
      enddo
C
      do im=n-1,1,-1
C###35 [fc] Loop on line 35 of triply.f (DO II) fully vectorized%%%
	  do ii=1,m
	      F(im)=E(im)*D(im)-U(im)*F(im+1)
	  enddo
      enddo
C
      return
      end
