| 1 |
C Copyright(C) 1999-2020 National Technology & Engineering Solutions |
| 2 |
C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with |
| 3 |
C NTESS, the U.S. Government retains certain rights in this software. |
| 4 |
C |
| 5 |
C See packages/seacas/LICENSE for details |
| 6 |
|
| 7 |
C======================================================================= |
| 8 |
SUBROUTINE MINMAX (NPTS, PTS, VMIN, VMAX) |
| 9 |
C======================================================================= |
| 10 |
|
| 11 |
C --*** MINMAX *** (ETCLIB) Calculate min/max value |
| 12 |
C -- Written by Amy Gilkey - revised 11/10/87 |
| 13 |
C -- |
| 14 |
C --MINMAX calculates the minimum and maximum of the data. |
| 15 |
C -- |
| 16 |
C --Parameters: |
| 17 |
C -- NPTS - IN - the number of points |
| 18 |
C -- PTS - IN - the points |
| 19 |
C -- VMIN, VMAX - OUT - the maximum and maximum value of the points |
| 20 |
|
| 21 |
INTEGER NPTS |
| 22 |
REAL PTS(*) |
| 23 |
REAL VMIN, VMAX |
| 24 |
|
| 25 |
VMIN = 1.0E+30 |
| 26 |
VMAX = -1.0E+30 |
| 27 |
DO 10 I = 1, NPTS |
| 28 |
VMIN = MIN (VMIN, PTS(I)) |
| 29 |
VMAX = MAX (VMAX, PTS(I)) |
| 30 |
10 CONTINUE |
| 31 |
|
| 32 |
C ... Check for NaN (Not a Number). |
| 33 |
C NaN is defined to be not equal to any other number including itself |
| 34 |
IF (VMIN .NE. VMIN .OR. VMAX .NE. VMAX) THEN |
| 35 |
CALL PRTERR('WARNING', |
| 36 |
* 'Data in subroutine MINMAX contains "NaN" values. Check Data') |
| 37 |
if (vmin .ne. vmin) vmin = -1.0e30 |
| 38 |
if (vmax .ne. vmax) vmax = 1.0e30 |
| 39 |
END IF |
| 40 |
|
| 41 |
RETURN |
| 42 |
END |