Commit f26a262db02dd7dcc101270a2a4c0ecb573d5cfa
1 parent
27d3b84d60
Exists in
master
and in
3 other branches
git-svn-id: https://lxsd.femto-st.fr/svn/fvn@37 b657c933-2333-4658-acf2-d3c7c2708721
Showing 6 changed files with 149 additions and 1 deletions Inline Diff
fvn_test/Makefile
1 | 1 | |||
include $(BTREE)/Make.inc | 2 | 2 | include $(BTREE)/Make.inc | |
3 | 3 | |||
programs = test_fac test_matinv test_specfunc \ | 4 | 4 | programs = test_fac test_matinv test_specfunc \ | |
test_det test_matcon test_matev test_sparse test_inter1d \ | 5 | 5 | test_det test_matcon test_matev test_sparse test_inter1d \ | |
test_inter2d test_inter3d test_akima test_lsp test_muller \ | 6 | 6 | test_inter2d test_inter3d test_akima test_lsp test_muller \ | |
test_integ | 7 | 7 | test_integ test_bsyn test_bsjn test_bskn test_bsin | |
8 | 8 | |||
prog:$(programs) | 9 | 9 | prog:$(programs) | |
10 | 10 | |||
clean: | 11 | 11 | clean: | |
rm -f {*.o,*.oo,*.ipo,*.a,*.mod} | 12 | 12 | rm -f {*.o,*.oo,*.ipo,*.a,*.mod} | |
rm -f $(programs) | 13 | 13 | rm -f $(programs) | |
14 | 14 | |||
%: %.o | 15 | 15 | %: %.o |
fvn_test/test_bsin.f90
File was created | 1 | program test_bsin | ||
2 | use fvn_fnlib | |||
3 | implicit none | |||
4 | integer :: n,npoints,i | |||
5 | real(4) :: xmin,xmax,xstep,x,y | |||
6 | real(4),dimension(200,6) :: bes | |||
7 | ! interface | |||
8 | ! real(4) function besjn(n,x,factor,big) | |||
9 | ! integer :: n | |||
10 | ! real(4) :: x | |||
11 | ! integer,optional :: factor | |||
12 | ! real(4),optional :: big | |||
13 | ! end function besjn | |||
14 | !end interface | |||
15 | !bsyn | |||
16 | !y=besjn(2,0.5) | |||
17 | !stop | |||
18 | open(2,file='bsin.dat') | |||
19 | ||||
20 | xmin=-5. | |||
21 | xmax=5. | |||
22 | npoints=200 | |||
23 | xstep=(xmax-xmin)/dble(npoints) | |||
24 | do i=1,npoints | |||
25 | x=xmin+i*xstep | |||
26 | do n=0,5 | |||
27 | bes(i,n)=bsin(n,x) | |||
28 | end do | |||
29 | write(2,'(7e22.14)') x,bes(i,0:5) | |||
30 | end do | |||
31 | close(2) |
fvn_test/test_bsjn.f90
File was created | 1 | program test_bsjn | ||
2 | use fvn_fnlib | |||
3 | implicit none | |||
4 | integer :: n,npoints,i | |||
5 | real(4) :: xmin,xmax,xstep,x,y | |||
6 | real(4),dimension(200,6) :: bes | |||
7 | ! interface | |||
8 | ! real(4) function besjn(n,x,factor,big) | |||
9 | ! integer :: n | |||
10 | ! real(4) :: x | |||
11 | ! integer,optional :: factor | |||
12 | ! real(4),optional :: big | |||
13 | ! end function besjn | |||
14 | !end interface | |||
15 | !bsyn | |||
16 | !y=besjn(2,0.5) | |||
17 | !stop | |||
18 | open(2,file='bsjn.dat') | |||
19 | ||||
20 | xmin=-20. | |||
21 | xmax=20. | |||
22 | npoints=200 | |||
23 | xstep=(xmax-xmin)/dble(npoints) | |||
24 | do i=1,npoints | |||
25 | x=xmin+i*xstep | |||
26 | do n=0,5 | |||
27 | bes(i,n)=bsjn(n,x) | |||
28 | end do | |||
29 | write(2,'(7e22.14)') x,bes(i,0:5) | |||
30 | end do | |||
31 | close(2) |
fvn_test/test_bskn.f90
File was created | 1 | program test_bskn | ||
2 | use fvn_fnlib | |||
3 | implicit none | |||
4 | integer :: n,npoints,i | |||
5 | real(4) :: xmin,xmax,xstep,x,y | |||
6 | real(4),dimension(200,6) :: bes | |||
7 | ! interface | |||
8 | ! real(4) function besjn(n,x,factor,big) | |||
9 | ! integer :: n | |||
10 | ! real(4) :: x | |||
11 | ! integer,optional :: factor | |||
12 | ! real(4),optional :: big | |||
13 | ! end function besjn | |||
14 | !end interface | |||
15 | !bsyn | |||
16 | !y=besjn(2,0.5) | |||
17 | !stop | |||
18 | open(2,file='bskn.dat') | |||
19 | ||||
20 | xmin=0. | |||
21 | xmax=10. | |||
22 | npoints=200 | |||
23 | xstep=(xmax-xmin)/dble(npoints) | |||
24 | do i=1,npoints | |||
25 | x=xmin+i*xstep | |||
26 | do n=0,5 | |||
27 | bes(i,n)=bskn(n,x) | |||
28 | end do | |||
29 | write(2,'(7e22.14)') x,bes(i,0:5) | |||
30 | end do | |||
31 | close(2) | |||
32 |
fvn_test/test_bsyn.f90
File was created | 1 | program test_bsyn | ||
2 | use fvn_fnlib | |||
3 | implicit none | |||
4 | integer :: n,npoints,i | |||
5 | real(4) :: xmin,xmax,xstep,x,y | |||
6 | real(4),dimension(200,6) :: bes | |||
7 | ! interface | |||
8 | ! real(4) function besjn(n,x,factor,big) | |||
9 | ! integer :: n | |||
10 | ! real(4) :: x | |||
11 | ! integer,optional :: factor | |||
12 | ! real(4),optional :: big | |||
13 | ! end function besjn | |||
14 | !end interface | |||
15 | !bsyn | |||
16 | !y=besjn(2,0.5) | |||
17 | !stop | |||
18 | open(2,file='bsyn.dat') | |||
19 | ||||
20 | xmin=0. | |||
21 | xmax=20. | |||
22 | npoints=200 | |||
23 | xstep=(xmax-xmin)/dble(npoints) | |||
24 | do i=1,npoints | |||
25 | x=xmin+i*xstep | |||
26 | do n=0,5 | |||
27 | bes(i,n)=bsyn(n,x) | |||
28 | end do | |||
29 | write(2,'(7e22.14)') x,bes(i,0:5) | |||
30 | end do | |||
31 | close(2) | |||
32 |
fvn_test/test_specfunc.f90
program test_specfunc | 1 | 1 | program test_specfunc | |
use fvn_fnlib | 2 | 2 | use fvn_fnlib | |
implicit none | 3 | 3 | implicit none | |
integer,parameter :: npoints=200 | 4 | 4 | integer,parameter :: npoints=200 | |
integer :: i | 5 | 5 | integer :: i | |
real(8), dimension(npoints) :: j0 | 6 | 6 | real(8), dimension(npoints) :: j0 | |
real(8) :: xmin,xmax,xstep,x,y | 7 | 7 | real(8) :: xmin,xmax,xstep,x,y | |
8 | 8 | |||
! bsj0 | 9 | 9 | ! bsj0 | |
xmin=-20. | 10 | 10 | xmin=-20. | |
xmax=20. | 11 | 11 | xmax=20. | |
xstep=(xmax-xmin)/dble(npoints) | 12 | 12 | xstep=(xmax-xmin)/dble(npoints) | |
open(2,file='bsj0.dat') | 13 | 13 | open(2,file='bsj0.dat') | |
do i=1,npoints | 14 | 14 | do i=1,npoints | |
x=xmin+i*xstep | 15 | 15 | x=xmin+i*xstep | |
y=bsj0(x) | 16 | 16 | y=bsj0(x) | |
write(2,'(2e22.14)') x,y | 17 | 17 | write(2,'(2e22.14)') x,y | |
end do | 18 | 18 | end do | |
close(2) | 19 | 19 | close(2) | |
20 | 20 | |||
! bsj1 | 21 | 21 | ! bsj1 | |
xmin=-20. | 22 | 22 | xmin=-20. | |
xmax=20. | 23 | 23 | xmax=20. | |
xstep=(xmax-xmin)/dble(npoints) | 24 | 24 | xstep=(xmax-xmin)/dble(npoints) | |
open(2,file='bsj1.dat') | 25 | 25 | open(2,file='bsj1.dat') | |
do i=1,npoints | 26 | 26 | do i=1,npoints | |
x=xmin+i*xstep | 27 | 27 | x=xmin+i*xstep | |
y=bsj1(x) | 28 | 28 | y=bsj1(x) | |
write(2,'(2e22.14)') x,y | 29 | 29 | write(2,'(2e22.14)') x,y | |
end do | 30 | 30 | end do | |
close(2) | 31 | 31 | close(2) | |
32 | 32 | |||
!bsi0 | 33 | 33 | !bsi0 | |
xmin=-4. | 34 | 34 | xmin=-4. | |
xmax=4. | 35 | 35 | xmax=4. | |
xstep=(xmax-xmin)/dble(npoints) | 36 | 36 | xstep=(xmax-xmin)/dble(npoints) | |
open(2,file='bsi0.dat') | 37 | 37 | open(2,file='bsi0.dat') | |
do i=1,npoints | 38 | 38 | do i=1,npoints | |
x=xmin+i*xstep | 39 | 39 | x=xmin+i*xstep | |
y=bsi0(x) | 40 | 40 | y=bsi0(x) | |
write(2,'(2e22.14)') x,y | 41 | 41 | write(2,'(2e22.14)') x,y | |
end do | 42 | 42 | end do | |
close(2) | 43 | 43 | close(2) | |
44 | 44 | |||
!bsi1 | 45 | 45 | !bsi1 | |
xmin=-4. | 46 | 46 | xmin=-4. | |
xmax=4. | 47 | 47 | xmax=4. | |
xstep=(xmax-xmin)/dble(npoints) | 48 | 48 | xstep=(xmax-xmin)/dble(npoints) | |
open(2,file='bsi1.dat') | 49 | 49 | open(2,file='bsi1.dat') | |
do i=1,npoints | 50 | 50 | do i=1,npoints | |
x=xmin+i*xstep | 51 | 51 | x=xmin+i*xstep | |
y=bsi1(x) | 52 | 52 | y=bsi1(x) | |
write(2,'(2e22.14)') x,y | 53 | 53 | write(2,'(2e22.14)') x,y | |
end do | 54 | 54 | end do | |
close(2) | 55 | 55 | close(2) | |
56 | 56 | |||
!bsy0 | 57 | 57 | !bsy0 | |
xmin=0. | 58 | 58 | xmin=0. | |
xmax=20. | 59 | 59 | xmax=20. | |
xstep=(xmax-xmin)/dble(npoints) | 60 | 60 | xstep=(xmax-xmin)/dble(npoints) | |
open(2,file='bsy0.dat') | 61 | 61 | open(2,file='bsy0.dat') | |
do i=1,npoints | 62 | 62 | do i=1,npoints | |
x=xmin+i*xstep | 63 | 63 | x=xmin+i*xstep | |
y=bsy0(x) | 64 | 64 | y=bsy0(x) | |
write(2,'(2e22.14)') x,y | 65 | 65 | write(2,'(2e22.14)') x,y | |
end do | 66 | 66 | end do | |
close(2) | 67 | 67 | close(2) | |
68 | 68 | |||
!bsy1 | 69 | 69 | !bsy1 | |
xmin=0. | 70 | 70 | xmin=0. | |
xmax=20. | 71 | 71 | xmax=20. | |
xstep=(xmax-xmin)/dble(npoints) | 72 | 72 | xstep=(xmax-xmin)/dble(npoints) | |
open(2,file='bsy1.dat') | 73 | 73 | open(2,file='bsy1.dat') | |
do i=1,npoints | 74 | 74 | do i=1,npoints | |
x=xmin+i*xstep | 75 | 75 | x=xmin+i*xstep | |
y=bsy1(x) | 76 | 76 | y=bsy1(x) | |
write(2,'(2e22.14)') x,y | 77 | 77 | write(2,'(2e22.14)') x,y | |
end do | 78 | 78 | end do | |
close(2) | 79 | 79 | close(2) | |
80 | 80 | |||
!bsk0 | 81 | 81 | !bsk0 | |
xmin=0. | 82 | 82 | xmin=0. | |
xmax=4. | 83 | 83 | xmax=4. | |
xstep=(xmax-xmin)/dble(npoints) | 84 | 84 | xstep=(xmax-xmin)/dble(npoints) | |
open(2,file='bsk0.dat') | 85 | 85 | open(2,file='bsk0.dat') | |
do i=1,npoints | 86 | 86 | do i=1,npoints | |
x=xmin+i*xstep | 87 | 87 | x=xmin+i*xstep | |
y=bsk0(x) | 88 | 88 | y=bsk0(x) | |
write(2,'(2e22.14)') x,y | 89 | 89 | write(2,'(2e22.14)') x,y | |
end do | 90 | 90 | end do | |
close(2) | 91 | 91 | close(2) | |
92 | 92 | |||
!bsk1 | 93 | 93 | !bsk1 | |
xmin=0. | 94 | 94 | xmin=0. | |
xmax=4. | 95 | 95 | xmax=4. | |
xstep=(xmax-xmin)/dble(npoints) | 96 | 96 | xstep=(xmax-xmin)/dble(npoints) | |
open(2,file='bsk1.dat') | 97 | 97 | open(2,file='bsk1.dat') | |
do i=1,npoints | 98 | 98 | do i=1,npoints | |
x=xmin+i*xstep | 99 | 99 | x=xmin+i*xstep | |
y=bsk1(x) | 100 | 100 | y=bsk1(x) | |
write(2,'(2e22.14)') x,y | 101 | 101 | write(2,'(2e22.14)') x,y | |
end do | 102 | 102 | end do | |
close(2) | 103 | 103 | close(2) | |
104 | 104 | |||
!erf | 105 | 105 | !erf | |
xmin=-4. | 106 | 106 | xmin=-4. | |
xmax=4. | 107 | 107 | xmax=4. | |
xstep=(xmax-xmin)/dble(npoints) | 108 | 108 | xstep=(xmax-xmin)/dble(npoints) | |
open(2,file='erf.dat') | 109 | 109 | open(2,file='erf.dat') | |
do i=1,npoints | 110 | 110 | do i=1,npoints | |
x=xmin+i*xstep | 111 | 111 | x=xmin+i*xstep | |
y=erf(x) | 112 | 112 | y=erf(x) | |
write(2,'(2e22.14)') x,y | 113 | 113 | write(2,'(2e22.14)') x,y | |
end do | 114 | 114 | end do | |
close(2) | 115 | 115 | close(2) | |
116 | 116 | |||
! gamma | 117 | 117 | ! gamma | |
xmin=-3. | 118 | 118 | xmin=-3. | |
xmax=7. | 119 | 119 | xmax=7. | |
xstep=(xmax-xmin)/2000. | 120 | 120 | xstep=(xmax-xmin)/2000. | |
open(2,file='gamma.dat') | 121 | 121 | open(2,file='gamma.dat') | |
do i=1,2000 | 122 | 122 | do i=1,2000 | |
x=xmin+i*xstep | 123 | 123 | x=xmin+i*xstep | |
if ((abs(x-nint(x)) >= 1d-6) .or. x>0. )then | 124 | 124 | if ((abs(x-nint(x)) >= 1d-6) .or. x>0. )then | |
y=gamma(x) | 125 | 125 | y=gamma(x) | |
write(2,'(2e22.14)') x,y | 126 | 126 | write(2,'(2e22.14)') x,y | |
end if | 127 | 127 | end if | |
end do | 128 | 128 | end do | |
close(2) | 129 | 129 | close(2) | |
130 | 130 | |||
! 1/gamma | 131 | 131 | ! 1/gamma | |
xmin=-3. | 132 | 132 | xmin=-3. | |
xmax=7. | 133 | 133 | xmax=7. | |
xstep=(xmax-xmin)/dble(npoints) | 134 | 134 | xstep=(xmax-xmin)/dble(npoints) | |
open(2,file='gamr.dat') | 135 | 135 | open(2,file='gamr.dat') | |
do i=1,npoints | 136 | 136 | do i=1,npoints | |
x=xmin+i*xstep | 137 | 137 | x=xmin+i*xstep | |
y=gamr(x) | 138 | 138 | y=gamr(x) | |
write(2,'(2e22.14)') x,y | 139 | 139 | write(2,'(2e22.14)') x,y | |
end do | 140 | 140 | end do | |
close(2) | 141 | 141 | close(2) | |
142 | 142 | |||
! ei | 143 | 143 | ! ei | |
xmin=0. | 144 | 144 | xmin=0. | |
xmax=1. | 145 | 145 | xmax=1. | |
xstep=(xmax-xmin)/dble(npoints) | 146 | 146 | xstep=(xmax-xmin)/dble(npoints) | |
open(2,file='ei.dat') | 147 | 147 | open(2,file='ei.dat') | |
do i=1,npoints | 148 | 148 | do i=1,npoints | |
x=xmin+i*xstep | 149 | 149 | x=xmin+i*xstep | |
y=ei(x) | 150 | 150 | y=ei(x) | |
write(2,'(2e22.14)') x,y | 151 | 151 | write(2,'(2e22.14)') x,y | |
end do | 152 | 152 | end do | |
close(2) | 153 | 153 | close(2) | |
154 | 154 | |||
! e1 | 155 | 155 | ! e1 | |
xmin=0. | 156 | 156 | xmin=0. | |
xmax=1. | 157 | 157 | xmax=1. | |
xstep=(xmax-xmin)/dble(npoints) | 158 | 158 | xstep=(xmax-xmin)/dble(npoints) | |
open(2,file='e1.dat') | 159 | 159 | open(2,file='e1.dat') | |
do i=1,npoints | 160 | 160 | do i=1,npoints | |
x=xmin+i*xstep | 161 | 161 | x=xmin+i*xstep | |
y=e1(x) | 162 | 162 | y=e1(x) | |
write(2,'(2e22.14)') x,y | 163 | 163 | write(2,'(2e22.14)') x,y | |
end do | 164 | 164 | end do | |
close(2) | 165 | 165 | close(2) |