f_sts_mean Function

public impure function f_sts_mean(x) result(mean)

Impure wrapper function for f_sts_mean_core.

Arguments

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

x vector (assumed size array)

Return Value real(kind=wp)

arithmetic mean


Calls

proc~~f_sts_mean~~CallsGraph proc~f_sts_mean f_sts_mean proc~f_sts_mean_core f_sts_mean_core proc~f_sts_mean->proc~f_sts_mean_core proc~s_err_print s_err_print proc~f_sts_mean->proc~s_err_print proc~f_utl_r2c f_utl_r2c proc~s_err_print->proc~f_utl_r2c

Called by

proc~~f_sts_mean~~CalledByGraph proc~f_sts_mean f_sts_mean interface~fsml_mean fsml_mean interface~fsml_mean->proc~f_sts_mean

Source Code

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