| 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 CRVLIM (AXIS, TIMPLT, MAXPTS, NPTS, NSPVAR, NEPVAR, |
| 9 |
& PLTVAL) |
| 10 |
C======================================================================= |
| 11 |
|
| 12 |
C --*** CRVLIM *** (TPLOT) Calculate min/max value for plot data |
| 13 |
C -- Written by Amy Gilkey - revised 11/06/87 |
| 14 |
C -- |
| 15 |
C --CRVLIM calculates the minimum and maximum of the plot data. |
| 16 |
C -- |
| 17 |
C --Parameters: |
| 18 |
C -- AXIS - IN - the axis to scale ('X' or 'Y') |
| 19 |
C -- TIMPLT - IN - true if time plot Y data versus X-Y data |
| 20 |
C -- MAXPTS - IN - the maximum number of points on a curve (PLTVAL length) |
| 21 |
C -- NPTS - IN - the number of points on each curve |
| 22 |
C -- NSPVAR, NEPVAR - IN - the starting and ending plot variable |
| 23 |
C -- indices for min/max calculation (PLTVAL index, /TPVARS/ index) |
| 24 |
C -- PLTVAL - IN - the data array |
| 25 |
C -- |
| 26 |
C --Common Variables: |
| 27 |
C -- Sets XMIN, XMAX, YMIN, YMAX of /XYLIM/ |
| 28 |
|
| 29 |
include 'xylim.blk' |
| 30 |
|
| 31 |
CHARACTER AXIS |
| 32 |
LOGICAL TIMPLT |
| 33 |
INTEGER NPTS(*) |
| 34 |
REAL PLTVAL(MAXPTS,*) |
| 35 |
|
| 36 |
IF ((.NOT .TIMPLT) .AND. (AXIS .EQ. 'X')) THEN |
| 37 |
XMIN = 1.0E+30 |
| 38 |
XMAX = -1.0E+30 |
| 39 |
|
| 40 |
N = NSPVAR |
| 41 |
100 CONTINUE |
| 42 |
IF (N .LE. NEPVAR) THEN |
| 43 |
DO 110 I = 1, NPTS(N) |
| 44 |
XMIN = MIN (XMIN, PLTVAL(I,N)) |
| 45 |
XMAX = MAX (XMAX, PLTVAL(I,N)) |
| 46 |
110 CONTINUE |
| 47 |
N = N + 2 |
| 48 |
GOTO 100 |
| 49 |
END IF |
| 50 |
END IF |
| 51 |
|
| 52 |
IF (AXIS .EQ. 'Y') THEN |
| 53 |
YMIN = 1.0E+30 |
| 54 |
YMAX = -1.0E+30 |
| 55 |
|
| 56 |
N = NSPVAR |
| 57 |
120 CONTINUE |
| 58 |
IF (N .LE. NEPVAR) THEN |
| 59 |
IF (.NOT. TIMPLT) N = N + 1 |
| 60 |
DO 130 I = 1, NPTS(N) |
| 61 |
YMIN = MIN (YMIN, PLTVAL(I,N)) |
| 62 |
YMAX = MAX (YMAX, PLTVAL(I,N)) |
| 63 |
130 CONTINUE |
| 64 |
N = N + 1 |
| 65 |
GOTO 120 |
| 66 |
END IF |
| 67 |
END IF |
| 68 |
|
| 69 |
C ... Check for NaN (Not a Number). |
| 70 |
C NaN is defined to be not equal to any other number including itself |
| 71 |
if (ymin .ne. ymin .or. ymax .ne. ymax .or. |
| 72 |
* xmin .ne. xmin .or. xmax .ne. xmax) then |
| 73 |
call prterr('WARNING', |
| 74 |
* 'The variable contains "NaN" (Not a Number) values.'// |
| 75 |
* ' Check data.') |
| 76 |
if (xmin .ne. xmin) xmin = -1.0e30 |
| 77 |
if (xmax .ne. xmax) xmax = 1.0e30 |
| 78 |
if (ymin .ne. ymin) ymin = -1.0e30 |
| 79 |
if (ymax .ne. ymax) ymax = 1.0e30 |
| 80 |
end if |
| 81 |
|
| 82 |
RETURN |
| 83 |
END |