10 #include "sll_working_precision.h"
20 #ifndef DOXYGEN_SHOULD_SKIP_THIS
23 function function_1d(x)
27 sll_real64 :: function_1d
28 sll_real64,
intent(in) :: x
29 end function function_1d
53 procedure(function_1d) :: f
54 sll_int32,
intent(in) :: n
55 sll_real64,
dimension(n) :: x
61 ans = ans + 0.5_f64*(f(x(k)) + f(x(k + 1)))*(x(k + 1) - x(k))
73 sll_int32,
intent(in) :: n
74 sll_real64,
dimension(n) :: x
75 sll_real64,
dimension(n) :: w
78 w(1) = 0.5_f64*(x(2) - x(1))
80 w(k) = 0.5_f64*(x(k + 1) - x(k - 1))
82 w(n) = 0.5_f64*(x(n) - x(n - 1))
Integrate numerically with Gauss-Lobatto formula.
Trapezoid formula for numerical integration.
real(kind=f64) function, dimension(n) trapz_weights(n, x)
Returns a 1d array of size (n) containing trapz integration weights in the interval [x(1),...
real(kind=f64) function trapz_integral_1d(f, x, n)
Integrate with trapz formula.
Module to select the kind parameter.