program splpt1 ! Spline performance test program 1 use splines use set_precision ! sets working precision (wp) implicit none integer i, j, n, n_evals, iflag integer, parameter :: len = 100 integer, parameter :: stdout = 6 real(kind=wp) xlist(len), ylist(len), t, s_at_t type(spline) :: s n = 100000 n_evals = 100 if ( .not. spline_get(s,len) ) then print *, 'Cannot allocate spline' return end if do i = 1, len xlist(i) = (1.0d0*i)/len end do call random_number(ylist) if ( .not. spline_set(s,xlist,ylist,len) ) then print *, 'Cannot set spline x, y entries' return end if do i = 1, n call spline_natural(s,iflag) if ( iflag /= 0 ) then print *, 'Cannot compute natural spline, iflag =', iflag call spline_print(s,stdout) return end if do j = 1, n_evals call random_number(t) s_at_t = spline_eval(s,t,iflag) end do call random_number(s%ylist) end do end program splpt1