0.6.2-dev0
FORCES
FORtran lib for Comp. Env. Sys.
Loading...
Searching...
No Matches
mo_moment::absdev Interface Reference

Mean absolute deviation from mean. More...

Public Member Functions

real(sp) function absdev_sp (dat, mask)
 
real(dp) function absdev_dp (dat, mask)
 

Detailed Description

Mean absolute deviation from mean.

Calculates the mean absolute deviations from the mean

\[ ABSDEV = \sum_i\frac{|x_i-\bar x|}{N} \]

If an optinal mask is given, the calculations are over those locations that correspond to true values in the mask. \( x\) can be single or double precision. The result will have the same numerical precision.
Example

vec = (/ 1., 2, 3., -999., 5., 6. /)
m   = absdev(vec, mask=(vec >= 0.))

See also example in pf_tests directory.

Parameters
[in]real(sp/dp) :: dat(:)1D-array with input numbers.
[in]logical, optional :: mask(:)1D-array of logical values with size(dat). If present, only those locations in vec corresponding to the true values in mask are used.
Return values
real(sp/dp) :: absdevMean absolute deviations from average.
Note
Input values must be floating points.
Author
Matthias Cuntz
Date
Nov 2011

Definition at line 79 of file mo_moment.f90.

Member Function/Subroutine Documentation

◆ absdev_dp()

real(dp) function mo_moment::absdev::absdev_dp ( real(dp), dimension(:), intent(in)  dat,
logical, dimension(:), intent(in), optional  mask 
)

Definition at line 618 of file mo_moment.f90.

◆ absdev_sp()

real(sp) function mo_moment::absdev::absdev_sp ( real(sp), dimension(:), intent(in)  dat,
logical, dimension(:), intent(in), optional  mask 
)

Definition at line 649 of file mo_moment.f90.


The documentation for this interface was generated from the following file: