      program tstderivmatrix
      parameter (m2=4, n2=100)
      implicit double precision (a-h,o-z)
      dimension x(0:n2), Dm(0:n2,0:n2,m2)

      print*,'Enter the # of points nn, the order of derivative mm='
      read (5,*) nn,mm
       pi=4.0*atan(1.0)
       do j=0, nn
          x(j)=cos(pi*j/nn)
       enddo
       call  derivmatrix(nn,mm,x,dm,n2)
       print*,'First derivative='
       do i=0,nn
          write (6,100) (dm(i,j,1),j=0,nn)
       enddo
       print*,'Second derivative='
       do i=0,nn
          write (6,100) (dm(i,j,2),j=0,nn)
       enddo
 100   format(5(1pg13.6,2x))
       stop
       end


