FORCES
FORtran lib for Comp. Env. Sys.
|
Median. More...
Public Member Functions | |
real(sp) function | median_sp (arrin, mask) |
real(dp) function | median_dp (arrin, mask) |
Median.
Returns the median of the values in an array. If size is even, then the mean of the size/2 and size/2+1 element is the median.
If an optinal mask is given, values only on those locations that correspond to true values in the mask are used.
Example
See also example in test directory.
[in] | real(sp/dp) :: vec(:) | 1D-array with input numbers |
[in] | logical, optional :: mask(:) | 1D-array of logical values with size(vec). If present, only those locations in vec corresponding to the true values in mask are used. |
real(sp/dp) :: out | Median of values in input array |
Definition at line 64 of file mo_percentile.f90.
real(dp) function mo_percentile::median::median_dp | ( | real(dp), dimension(:), intent(in) | arrin, |
logical, dimension(:), intent(in), optional | mask | ||
) |
Definition at line 223 of file mo_percentile.f90.
real(sp) function mo_percentile::median::median_sp | ( | real(sp), dimension(:), intent(in) | arrin, |
logical, dimension(:), intent(in), optional | mask | ||
) |
Definition at line 265 of file mo_percentile.f90.