Impure wrapper function for f_sts_trend_core
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x(:) |
x vector (assumed size array) |
||
real(kind=wp), | intent(in) | :: | y(:) |
y vector (assumed size array) |
trend/regression slope
impure function f_sts_trend(x, y) result(trend) ! ==== Description !! Impure wrapper function for `f_sts_trend_core`. ! ==== Declarations real(wp), intent(in) :: x(:) !! x vector (assumed size array) real(wp), intent(in) :: y(:) !! y vector (assumed size array) real(wp) :: trend !! trend/regression slope ! ==== 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)) trend = c_sentinel_r return endif ! check if x and y have same size if (size(x) .ne. size(y)) then ! write error message and assign sentinel value if invalid call s_err_print(fsml_error(4)) trend = c_sentinel_r return endif ! ---- compute trend ! call pure function trend = f_sts_trend_core(x, y) end function f_sts_trend