[UP]


Manual Reference Pages  - 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
   real,allocatable :: arr(:)
   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)


extremum (3) March 11, 2021
Generated by manServer 1.08 from f3d765d9-1c36-424c-b53c-205b2faf9752 using man macros.