@@ -222,10 +222,15 @@ If not specified, the default integral is -1 to 1.
222222### Example
223223
224224``` fortran
225- integer, parameter :: N = 6
226- real(dp), dimension(N) :: x,w
227- call gauss_legendre(x,w)
228- integral = sum(x**2 * w)
225+ program integrate
226+ use iso_fortran_env, dp => real64
227+ implict none
228+
229+ integer, parameter :: N = 6
230+ real(dp), dimension(N) :: x,w
231+ call gauss_legendre(x,w)
232+ print *, "integral of x**2 from -1 to 1 is", sum(x**2 * w)
233+ end program
229234```
230235
231236## ` gauss_legendre_lobatto ` - Gauss-Legendre-Lobatto quadrature nodes and weights
@@ -263,8 +268,13 @@ If not specified, the default integral is -1 to 1.
263268### Example
264269
265270``` fortran
266- integer, parameter :: N = 6
267- real(dp), dimension(N) :: x,w
268- call gauss_legendre_lobatto(x,w)
269- integral = sum(x**2 * w)
271+ program integrate
272+ use iso_fortran_env, dp => real64
273+ implict none
274+
275+ integer, parameter :: N = 6
276+ real(dp), dimension(N) :: x,w
277+ call gauss_legendre_lobatto(x,w)
278+ print *, "integral of x**2 from -1 to 1 is", sum(x**2 * w)
279+ end program
270280```
0 commit comments