C Library Functions - extremum (3)
NAME
extremum(3f) - [M_math:statistics] Finds the minimum and maximum value in a REAL array.
CONTENTS
Synopsis
Description
Options
Returns
Example
See Also
SYNOPSIS
subroutine extremum(array,small,big)
real,intent(in) :: array(:)
real,intent(out) :: small
real,intent(out) :: big
DESCRIPTION
Finds the minimum and maximum value in a REAL array.
OPTIONS
|
array |
The array to find the extremes of
|
|
RETURNS
|
small |
least value found
|
|
big |
largest value found
|
|
EXAMPLE
Sample program:
program demo_extremum
use M_math, only : extremum
implicit none
real,allocatable :: arr(:)
real :: small, big
arr=[-10.0,8.8,-5.0,0.0,5.0,10.0,-0.3]
call extremum(arr,small,big)
write(*,*)ARRAY=,arr
write(*,*)SMALL=,small
write(*,*)BIG=,big
end program demo_extremum
Results:
ARRAY= -10.000 8.80 -5.00 0.00 5.00 10.0 -0.300
SMALL= -10.000
BIG= 10.00
================================================================================
SEE ALSO
minval(3f), maxval(3f)
| Nemo Release 3.1 | extremum (3) | June 29, 2025 |
Generated by manServer 1.08 from b8794337-f4ad-4a3e-887e-f869a04dc2cb using man macros.