Example for use of the subroutine adquad.f in Fortran90

This is an example of the main program how to use the subroutine adquad.f. The example calls the subroutine which futher integrates the function sin(x) over the interval < 0,Pi > .
[Download of the example (0.7 kB)]
The result should be as follows:
 Result of Integration= 2.00000001920253068
 Estimation of the integration error= 0.331843205027294294E-10
 Indication of the result correctness (FLAG) = 0.000000000000000000E+00


	program recipe
c
c Main program calling the ADQUAD subroutine demonstrates its use.
c 
	double precision pi,down_boundary,upper_boundary,abs_error,
     $rel_error,result,error,flag
c	
	pi=3.1415926535d0     ! Ludolf number
c	
	down_boundary=0.
	upper_boundary=pi
	abs_error=0.
	rel_error=1.d-9
c
	call ADQUAD(down_boundary,upper_boundary,abs_error,rel_error,
     $result,error,flag)
c
	print *,' Result of Integration=',result
	print *,' Estimation of the integration error=',error
	print *,' Indication of the result correctness (FLAG) =',flag
c	
	end

[ Back ] Copyright © karolkalna
The page is designed using the Cascading Style Sheets (CSS).