!Testing the Interpolation routines... !x = point of interpolation. !y = interpolated function value at x. !d = number of tabulated values. program INTERPOLATION use MY_STUFF use INTERP_FUNCTION Implicit none integer :: i, k integer, parameter :: d=10 real(KIND=dbl) :: x, y_lagr, y_spl real(KIND=dbl), dimension(d):: x_val(d), y_val(d) real(KIND=dbl), dimension(d,2) :: A k = 5.0 x = 5.0 do i = 1, d x_val(i) = fx(i) y_val(i) = fy(i) enddo call LAGRANGE_INT(x_val, y_val, d, k, x, y_lagr) call SPLINE(x_val, y_val, d, x, y_spl) A(1:d,1) = x_val ; A(1:d,2) = y_val call MATOUT("Tabulated x- and y-values:", A, d, 2) print '("Point x to be interpolated", f8.2)', x print '("Lagrange interpolated function value at x", f10.4)', y_lagr print '("Spline interpolated function value at x ", f10.4)', y_spl end program INTERPOLATION