Blame view
fvn_test/test_inter1d.f90
628 Bytes
27d3b84d6 git-svn-id: https... |
1 |
program inter1d |
2919a9e2d git-svn-id: https... |
2 |
use fvn_interpol |
27d3b84d6 git-svn-id: https... |
3 |
implicit none |
f6bacaf83 ChW 11/09: ANSI c... |
4 5 6 7 |
integer(kind=ip_kind),parameter :: ndata=33 integer(kind=ip_kind) :: i,nout real(kind=dp_kind) :: f,fdata(ndata),h,pi,q,sin,x,xdata(ndata) real(kind=dp_kind) ::tv |
27d3b84d6 git-svn-id: https... |
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
intrinsic sin f(x)=sin(x) xdata(1)=0. fdata(1)=f(xdata(1)) h=1./32. do i=2,ndata xdata(i)=xdata(i-1)+h fdata(i)=f(xdata(i)) end do call init_random_seed() call random_number(x) q=fvn_quad_interpol(x,ndata,xdata,fdata) tv=f(x) write(*,'("x y z ",1(f8.5))') x write(*,'("Calculated (real) value :",f8.5)') tv write(*,'("fvn interpolation : ",f8.5)') q write(*,'("Relative fvn error :",e12.5)') abs((q-tv)/tv) end program |