mean Function

public pure function mean(array)

Compute the mean of a 1D array

Arguments

Type IntentOptional AttributesName
real(kind=xp), intent(in), dimension(:):: array

1D array

Return Value real(kind=xp)


Called by

proc~~mean~~CalledByGraph proc~mean mean proc~update update proc~update->proc~mean

Contents

Source Code


Source Code

  pure function mean(array)
    !! Compute the mean of a 1D array
    implicit none

    real(xp), intent(in), dimension(:) :: array !! 1D array
    real(xp) :: mean

    mean = sum(array)/(max(1,size(array)))
    
    return
  end function mean