diff --git a/fvn_test/Makefile b/fvn_test/Makefile index ada4420..19f1a31 100644 --- a/fvn_test/Makefile +++ b/fvn_test/Makefile @@ -5,7 +5,7 @@ programs = test_fac$(exext) test_matinv$(exext) test_specfunc$(exext) \ test_det$(exext) test_matcon$(exext) test_matev$(exext) test_sparse$(exext) test_inter1d$(exext) \ test_inter2d$(exext) test_inter3d$(exext) test_akima$(exext) test_lsp$(exext) test_muller$(exext) \ test_integ$(exext) test_bsyn$(exext) test_bsjn$(exext) test_bskn$(exext) test_bsin$(exext) test_operators$(exext) test_ze1$(exext) \ -test_dbesri$(exext) test_dbesrj$(exext) +test_besri$(exext) test_besrj$(exext) test_bestime$(exext) prog:$(programs) diff --git a/fvn_test/test_dbesri.f90 b/fvn_test/test_besri.f90 similarity index 100% rename from fvn_test/test_dbesri.f90 rename to fvn_test/test_besri.f90 diff --git a/fvn_test/test_dbesrj.f90 b/fvn_test/test_besrj.f90 similarity index 100% rename from fvn_test/test_dbesrj.f90 rename to fvn_test/test_besrj.f90 diff --git a/fvn_test/test_bestime.f90 b/fvn_test/test_bestime.f90 new file mode 100644 index 0000000..34c98c8 --- /dev/null +++ b/fvn_test/test_bestime.f90 @@ -0,0 +1,61 @@ +program bestime +use fvn_fnlib +implicit none + +real(kind=dp_kind) :: x,xmin,xmax,xstep,t1,t2,bes,b(51) +integer(kind=ip_kind) :: npoints,iter,n,i,it,nn + + +iter=10000 +n=10 +npoints=200 +xmin=-50. +xmax=50. +xstep=(xmax-xmin)/dble(npoints) + +write(*,*) "Computation time comparison between bsjn and besrj" +write(*,*) "bsjn is faster when computing J_n for only one value of n" +write(*,*) "besrj is faster when computing J_n for n=0 to n" + +call cpu_time(t1) +do it=1,iter + do i=1,npoints + x=xmin+i*xstep + do nn=0,n + bes=bsjn(nn,x) + end do + end do +end do +call cpu_time(t2) +write (*,'("Calculating "(I10)" values of J_n for n=0 to "(I3)" with bsjn :")') iter*npoints,n +write(*,*) t2-t1 + +call cpu_time(t1) +do it=1,iter + do i=1,npoints + x=xmin+i*xstep + bes=bsjn(n,x) + end do +end do +call cpu_time(t2) +write (*,'("Calculating "(I10)" values of J_n for n="(I3)" with bsjn :")') iter*npoints,n +write(*,*) t2-t1 + + +! Calcultate J_n(x) on 200 points for n=0 to 50 with besrj +! do it iter times to have a sufficient time value +call cpu_time(t1) +do it=1,iter + do i=1,npoints + x=xmin+i*xstep + call besrj(x,n+1,b) + end do +end do +call cpu_time(t2) +write (*,'("Calculating "(I10)" values of J_n for n=0 to "(I3)" with besrj :")') iter*npoints,n +write(*,*) t2-t1 + + + + +end program bestime \ No newline at end of file