Blame view
fvn_test/test_integ.f90
893 Bytes
27d3b84d6
|
1 |
program integ |
2919a9e2d
|
2 |
use fvn_integ |
27d3b84d6
|
3 |
implicit none |
f6bacaf83
|
4 5 |
real(kind=dp_kind), external :: f1,f2,g,h real(kind=dp_kind) :: a,b,epsabs,epsrel,abserr,res |
27d3b84d6
|
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
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) |
8d883e8a1
|
21 |
use fvn_common |
27d3b84d6
|
22 |
implicit none |
f6bacaf83
|
23 |
real(kind=dp_kind) :: x,f1 |
27d3b84d6
|
24 25 26 |
f1=x*x end function function f2(x,y) |
8d883e8a1
|
27 |
use fvn_common |
27d3b84d6
|
28 |
implicit none |
f6bacaf83
|
29 |
real(kind=dp_kind) :: x,y,f2 |
27d3b84d6
|
30 31 32 |
f2=x*y end function function g(x) |
8d883e8a1
|
33 |
use fvn_common |
27d3b84d6
|
34 |
implicit none |
f6bacaf83
|
35 |
real(kind=dp_kind) :: x,g |
27d3b84d6
|
36 37 38 |
g=0. end function function h(x) |
8d883e8a1
|
39 |
use fvn_common |
27d3b84d6
|
40 |
implicit none |
f6bacaf83
|
41 |
real(kind=dp_kind) :: x,h |
27d3b84d6
|
42 43 |
h=1. end function |