5 #include "sll_working_precision.h"
25 sll_real64,
dimension(:),
intent(inout) :: f
26 sll_real64,
dimension(:),
intent(in) :: x
27 sll_int32,
intent(in) :: n
28 sll_real64,
intent(out) :: xm
35 dx = 1._f64/real(n, f64)
40 xm = xm + f(i)*(x(i + 1) - x(i))
43 f(1) = (f(1) - xm)*(x(2) - x(1))
47 f(i) = (f(i) - xm)*(x(i + 1) - x(i))
63 sll_real64,
dimension(:),
intent(inout) :: f
64 sll_real64,
dimension(:),
intent(in) :: x
65 sll_int32,
intent(in) :: n
66 sll_real64,
intent(in) :: xm
72 dx = 1._f64/real(n, f64)
76 f(i) = f(i + 1) - f(i) + xm*(x(i + 1) - x(i))
78 f(n) = tmp - f(n) + xm*(x(1) + 1._f64 - x(n))
82 f(i) = f(i)/(x(i + 1) - x(i))
Functions to compute primitive of 1d function.
subroutine, public sll_s_primitive_to_function(f, x, n, xm)
Compute function value from primitive.
subroutine, public sll_s_function_to_primitive(f, x, n, xm)
Compute primitive of f.