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