      PROGRAM tpolint
C     driver for routine polint
      INTEGER NP
      REAL PI
      PARAMETER(NP=50,PI=3.1415926)
      INTEGER i,n,nfunc,fp,n1,m1
      REAL dy,f,x,y,xa(NP),ya(NP),XM(NP,NP)
      REAL yp1, ypn, y2(NP)

      open (unit=8,file="Runge.dat")
      fp=8

      write(*,*) 'citam podatke'

      read(fp,*) n1,m1
      call readmatrix(XM,n1,m1,fp)
      close(fp)

c pretvori u vektore
      do i=1,n1
         xa(i)=XM(i,1)
         ya(i)=XM(i,2)
      End do
      yp1=1.0/xa(1)
      ypn=1.0/xa(n1)
      open (unit=8,file="InterpspF.dat")
      fp=8
c      n1=9
      call spline(xa,ya,n1,yp1,ypn,y2)
      do i=1,n1
         x=(0.1+(i-1)*10.0/n1)
          call splint(xa,ya,y2,n1,x,y)
          write(fp,'(1x,2f12.6)') x,y
       End do
       write(*,*) '***********************************'
       write(*,*) 'Press RETURN'
       read(*,*)
       END
