Blame view
fvn_test/test_akima.f90
1.17 KB
27d3b84d6 git-svn-id: https... |
1 |
program akima |
2919a9e2d git-svn-id: https... |
2 |
use fvn_interpol |
27d3b84d6 git-svn-id: https... |
3 4 |
implicit none integer :: nbpoints,nppoints,i |
f6bacaf83 ChW 11/09: ANSI c... |
5 6 7 |
real(kind=dp_kind),dimension(:),allocatable :: x_d,y_d,breakpoints_d real(kind=dp_kind),dimension(:,:),allocatable :: coeff_fvn_d real(kind=dp_kind) :: xstep_d,xp_d,ty_d,fvn_y_d |
27d3b84d6 git-svn-id: https... |
8 9 10 11 12 13 14 |
open(2,file='fvn_akima_double.dat') open(3,file='fvn_akima_breakpoints_double.dat') nbpoints=30 allocate(x_d(nbpoints)) allocate(y_d(nbpoints)) allocate(breakpoints_d(nbpoints)) allocate(coeff_fvn_d(4,nbpoints)) |
f6bacaf83 ChW 11/09: ANSI c... |
15 |
xstep_d=20./real(nbpoints,dp_kind) |
27d3b84d6 git-svn-id: https... |
16 |
do i=1,nbpoints |
f6bacaf83 ChW 11/09: ANSI c... |
17 |
x_d(i)=-10.+real(i,dp_kind)*xstep_d |
27d3b84d6 git-svn-id: https... |
18 19 20 21 22 23 |
y_d(i)=dsin(x_d(i)) write(3,44) x_d(i),y_d(i) end do close(3) call fvn_akima(nbpoints,x_d,y_d,breakpoints_d,coeff_fvn_d) nppoints=1000 |
f6bacaf83 ChW 11/09: ANSI c... |
24 |
xstep_d=22./real(nppoints,dp_kind) |
27d3b84d6 git-svn-id: https... |
25 |
do i=1,nppoints |
f6bacaf83 ChW 11/09: ANSI c... |
26 |
xp_d=-11.+real(i,dp_kind)*xstep_d |
27d3b84d6 git-svn-id: https... |
27 28 29 30 31 32 |
ty_d=dsin(xp_d) fvn_y_d=fvn_spline_eval(xp_d,nbpoints-1,breakpoints_d,coeff_fvn_d) write(2,44) xp_d,ty_d,fvn_y_d end do close(2) deallocate(coeff_fvn_d,breakpoints_d,y_d,x_d) |
59ae88e06 git-svn-id: https... |
33 34 |
write(6,*) "All done, plot results with gnuplot using command :" write(6,*) "pl 'fvn_akima_double.dat' u 1:2 w l,'fvn_akima_breakpoints_double.dat' w p" |
27d3b84d6 git-svn-id: https... |
35 36 37 |
44 FORMAT(4(1X,1PE22.14)) end program |