Impure wrapper function for f_sts_std_core.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | x(:) |
x vector (assumed size array) |
||
| real(kind=wp), | intent(in), | optional | :: | ddf |
delta degrees of freedom |
standard deviation
impure function f_sts_std(x, ddf) result(std) ! ==== Description !! Impure wrapper function for `f_sts_std_core`. ! ==== Declarations real(wp), intent(in) :: x(:) !! x vector (assumed size array) real(wp), intent(in), optional :: ddf !! delta degrees of freedom real(wp) :: ddf_w !! final value for ddf real(wp) :: std !! standard deviation ! ==== Instructions ! ---- handle input ! assume ddf = 0 (population, not sample statistics) ddf_w = 0.0_wp if (present(ddf)) ddf_w = ddf ! check if value is valid if (ddf_w .ne. 1.0_wp .and. ddf_w .ne. 0.0_wp) then ! write error message and assign NaN value if invalid call s_err_print(fsml_error(2)) std = f_utl_assign_nan() return endif ! 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)) std = f_utl_assign_nan() return endif ! ---- compute standard deviation ! call pure function std = sqrt( f_sts_var_core(x, ddf_w) ) end function f_sts_std