Compute the mean of an input array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(:) | :: | d | Data to process |
Mean
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module.
function mean(d) result(o)
!! Compute the mean of an input array
real(wp),dimension(:),intent(in)::d
!! Data to process
real(wp)::o
!! Mean
o = sum(d)/real(size(d),wp)
end function mean