Impure wrapper function for f_sts_median_core.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | x(:) |
x vector (assumed size array) |
median
impure function f_sts_median(x) result(median) ! ==== Description !! Impure wrapper function for `f_sts_median_core`. ! ==== Declarations real(wp), intent(in) :: x(:) !! x vector (assumed size array) real(wp) :: median !! median ! ==== Instructions ! ---- handle input ! check if size is valid if (size(x) .le. 1) then ! write error message and assign NaN value if invalid call s_err_print(fsml_error(4)) median = f_utl_assign_nan() return endif ! ---- compute median ! call pure function median = f_sts_median_core(x) end function f_sts_median