PROGRAM drive USE local USE int_procs IMPLICIT NONE INTEGER(i4) :: i REAL(r8) :: x, eps = 1.e-10 REAL(r8), DIMENSION(5) :: w_leg, x_leg x_leg = (/-.9061798459, -.5384693101, 0., .5384693101, .9061798459 /) w_leg = (/ .2369268850, .4786286705, .5688888889, .4786286705, .2369268850 /) a = -1. b = 1. CALL trap_int(eps) WRITE(*,*) 'Trapezoidal result is', inte CALL romb_int(eps) WRITE(*,*) 'Romberg result is', inte inte = 0. ! DO i=1, 5 ! insert Gaussian-Legendre expression here ! END DO WRITE(*,*) 'Gauss-Legendre quadrature result is', inte STOP END PROGRAM drive FUNCTION func(x) USE local IMPLICIT NONE REAL(r8) :: func REAL(r8), INTENT(IN) :: x func = cos(x) RETURN END FUNCTION func