f_sts_trend Function

public impure function f_sts_trend(x, y) result(trend)

Impure wrapper function for f_sts_trend_core.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x(:)

x vector (assumed size array)

real(kind=wp), intent(in) :: y(:)

y vector (assumed size array)

Return Value real(kind=wp)

trend/regression slope


Calls

proc~~f_sts_trend~~CallsGraph proc~f_sts_trend f_sts_trend proc~f_sts_trend_core f_sts_trend_core proc~f_sts_trend->proc~f_sts_trend_core proc~s_err_print s_err_print proc~f_sts_trend->proc~s_err_print proc~f_sts_cov_core f_sts_cov_core proc~f_sts_trend_core->proc~f_sts_cov_core proc~f_sts_var_core f_sts_var_core proc~f_sts_trend_core->proc~f_sts_var_core proc~f_utl_r2c f_utl_r2c proc~s_err_print->proc~f_utl_r2c proc~f_sts_mean_core f_sts_mean_core proc~f_sts_cov_core->proc~f_sts_mean_core proc~f_sts_var_core->proc~f_sts_mean_core

Called by

proc~~f_sts_trend~~CalledByGraph proc~f_sts_trend f_sts_trend interface~fsml_trend fsml_trend interface~fsml_trend->proc~f_sts_trend

Source Code

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