FORCES
FORtran lib for Comp. Env. Sys.
|
Find closest values in a monotonic series, returns the indexes. More...
Public Member Functions | |
integer(i4) function | locate_0d_dp (x, y) |
integer(i4) function | locate_0d_sp (x, y) |
integer(i4) function, dimension(:), allocatable | locate_1d_dp (x, y) |
integer(i4) function, dimension(:), allocatable | locate_1d_sp (x, y) |
Find closest values in a monotonic series, returns the indexes.
Given an array x(1:n), and given a value y, returns a value j such that y is between x(j) and x(j+1).
x must be monotonically increasing.
j=0 or j=N is returned to indicate that x is out of range.
Example
Returns ii = (/1, 5/)
Returns ii = 1
[in] | real(dp/sp) :: x(:) | Sorted array |
[in] | real(dp/sp) :: y[(:)] | Value(s) of which the closest match in x(:) is wanted |
integer(i4) :: index[(:)] | Index(es) of x so that y is between x(index) and x(index+1) |
Definition at line 403 of file mo_utils.F90.
integer(i4) function mo_utils::locate::locate_0d_dp | ( | real(dp), dimension(:), intent(in) | x, |
real(dp), intent(in) | y | ||
) |
Definition at line 1171 of file mo_utils.F90.
integer(i4) function mo_utils::locate::locate_0d_sp | ( | real(sp), dimension(:), intent(in) | x, |
real(sp), intent(in) | y | ||
) |
Definition at line 1188 of file mo_utils.F90.
integer(i4) function, dimension(:), allocatable mo_utils::locate::locate_1d_dp | ( | real(dp), dimension(:), intent(in) | x, |
real(dp), dimension(:), intent(in) | y | ||
) |
Definition at line 1205 of file mo_utils.F90.
integer(i4) function, dimension(:), allocatable mo_utils::locate::locate_1d_sp | ( | real(sp), dimension(:), intent(in) | x, |
real(sp), dimension(:), intent(in) | y | ||
) |
Definition at line 1229 of file mo_utils.F90.