-
git-svn-id: https://lxsd.femto-st.fr/svn/fvn@59 b657c933-2333-4658-acf2-d3c7c2708721
test_integ.f90
893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
program integ
use fvn_integ
implicit none
real(kind=dp_kind), external :: f1,f2,g,h
real(kind=dp_kind) :: a,b,epsabs,epsrel,abserr,res
integer :: key,ier
a=0.
b=1.
epsabs=1d-8
epsrel=1d-8
key=2
call fvn_integ_1_gk(f1,a,b,epsabs,epsrel,key,res,abserr,ier)
write(*,*) "Integration of x*x between 0 and 1 : "
write(*,*) res
call fvn_integ_2_gk(f2,a,b,g,h,epsabs,epsrel,key,res,abserr,ier)
write(*,*) "Integration of x*y between 0 and 1 on both x and y : "
write(*,*) res
end program
function f1(x)
use fvn_common
implicit none
real(kind=dp_kind) :: x,f1
f1=x*x
end function
function f2(x,y)
use fvn_common
implicit none
real(kind=dp_kind) :: x,y,f2
f2=x*y
end function
function g(x)
use fvn_common
implicit none
real(kind=dp_kind) :: x,g
g=0.
end function
function h(x)
use fvn_common
implicit none
real(kind=dp_kind) :: x,h
h=1.
end function