0.6.2-dev0
FORCES
FORtran lib for Comp. Env. Sys.
Loading...
Searching...
No Matches
mo_integrate::int_regular Interface Reference

Integrate regularily spaced data. More...

Public Member Functions

real(sp) function int_regular_sp (dat, dx)
 
real(dp) function int_regular_dp (dat, dx)
 

Detailed Description

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

vec = (/ 1., 2, 3., 4., 5., 6., 7., 8., 9. /)
m = int_regular(vec)
-> see also example in test directory
Parameters
[in]real(sp/dp) :: dat(:)\( y_i \) 1D-array with y-values.
[in]real(sp/dp) :: dxx-spacing (default=1.)
Returns
real(sp/dp) :: integral — \( \int y \) integral of y values
Author
Matthias Cuntz
Date
Mar 2013

Definition at line 39 of file mo_integrate.f90.

Member Function/Subroutine Documentation

◆ int_regular_dp()

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.

◆ int_regular_sp()

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.


The documentation for this interface was generated from the following file: