Function to calculate the minimum of an array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | dimension(:) | :: | a |
Real array |
Real value with the minimum
function minimum(a) result(mn) !=================================================================================================== !! Function to calculate the minimum of an array real(kind=wp),dimension(:) :: a !! Real array real(kind=wp) :: mn !! Real value with the minimum integer :: i,number_elements mn=a(1) number_elements=size(a) do i=2,number_elements if(a(i) .lt. mn) then mn=a(i) endif enddo ! end function minimum