FORCES
FORtran lib for Comp. Env. Sys.
|
Integrate regularily spaced data. More...
Public Member Functions | |
real(sp) function | int_regular_sp (dat, dx) |
real(dp) function | int_regular_dp (dat, dx) |
Integrate regularily spaced data.
Integrates regularily spaced data with a 5-point Newton-Cotes formula:
\[ \int y dx = \frac{2}{45} \sum_{i=5,n-4,4} 7 y_{i-4} + 32 y_{i-3} + 12 y_{i-2} + 32 y_{i-1} + 7 y_{i} \]
dx=1 if not given.
Example
[in] | real(sp/dp) :: dat(:) | \( y_i \) 1D-array with y-values. |
[in] | real(sp/dp) :: dx | x-spacing (default=1.) |
Definition at line 39 of file mo_integrate.f90.
real(dp) function mo_integrate::int_regular::int_regular_dp | ( | real(dp), dimension(:), intent(in) | dat, |
real(dp), intent(in), optional | dx | ||
) |
Definition at line 54 of file mo_integrate.f90.
real(sp) function mo_integrate::int_regular::int_regular_sp | ( | real(sp), dimension(:), intent(in) | dat, |
real(sp), intent(in), optional | dx | ||
) |
Definition at line 97 of file mo_integrate.f90.