      subroutine cctslc(a,x,r,m,l,k,lda)
      integer m,l,k,lda
      complex a(lda,k),x(m,l,k),r(1)
c
c     cctslc solves the complex linear system
c     a * x = b
c     with the cct - matrix a .
c
c     on entry
c
c        a       complex((2*m - 1)*l,k)
c                the first row of outer blocks of the cct - matrix .
c                each outer block is represented by its first row
c                of inner blocks. each inner block is represented
c                by its first row followed by its first column
c                beginning with the second element .
c                on return a has been destroyed .
c
c        x       complex(m*l*k)
c                the right hand side vector b .
c
c        r       complex(max(2*m - 2,2*l,2*k))
c                a work vector .
c
c        m       integer
c                the order of the inner blocks of the matrix a .
c
c        l       integer
c                the number of inner blocks in a row or column
c                of an outer block of the matrix a .
c
c        k       integer
c                the number of outer blocks in a row or column
c                of the matrix a .
c
c        lda     integer
c                the leading dimension of the array a .
c
c     on return
c
c        x       the solution vector .
c
c     toeplitz package. this version dated 07/23/82 .
c
c     subroutines and functions
c
c        toeplitz package ... ctslc,salwc
c        fortran ... float
c
c     internal variables
c
      integer i1,i2,i3,m2,ml
      real rk
c
      rk = float(k)
      m2 = 2*m - 1
      ml = m*l
c
c     reduce the cct - matrix to a block-diagonal matrix
c     by the inverse discrete fourier transformation .
c
      call salwc(a,r,r(k+1),m2*l,k,lda,-1)
c
c     compute the discrete fourier transformation of
c     the right hand side vector .
c
      call salwc(x,r,r(k+1),ml,k,ml,1)
c
c     solve the block-diagonal system, blocks of which
c     are ct - matrices .
c
      do 10 i3 = 1, k
         call ctslc(a(1,i3),x(1,1,i3),r,m,l,m2)
   10 continue
c
c     compute the solution of the given system by
c     the inverse discrete fourier transformation .
c
      call salwc(x,r,r(k+1),ml,k,ml,-1)
c
      do 40 i3 = 1, k
         do 30 i2 = 1, l
            do 20 i1 = 1, m
               x(i1,i2,i3) = x(i1,i2,i3)/rk
   20       continue
   30    continue
   40 continue
      return
      end