| 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 TPREAD (A, NPTIMS, IPTIMS, TIMES, WHOTIM, |
| 9 |
& PLTTIM, PLTVAL) |
| 10 |
C======================================================================= |
| 11 |
|
| 12 |
C --*** TPREAD *** (TPLOT) Read plot variables from database |
| 13 |
C -- Written by Amy Gilkey - revised 02/02/88 |
| 14 |
C -- |
| 15 |
C --TPREAD reads the database and stores the variables to be plotted. |
| 16 |
C -- |
| 17 |
C --This routine manipulates dynamic memory, so check after return. |
| 18 |
C -- |
| 19 |
C --Parameters: |
| 20 |
C -- A - IN - the dynamic memory base array |
| 21 |
C -- NPTIMS - IN - the number of selected steps |
| 22 |
C -- IPTIMS - IN - the selected time steps |
| 23 |
C -- TIMES - IN - the time step times |
| 24 |
C -- WHOTIM - IN - true iff whole (versus history) time step |
| 25 |
C -- PLTTIM - OUT - the plot times (if TIMPLT) |
| 26 |
C -- PLTVAL - OUT - the plot variable values |
| 27 |
C -- |
| 28 |
C --Common Variables: |
| 29 |
C -- Uses NDIM, NUMNP, NUMEL, NELBLK, |
| 30 |
C -- NVARHI, NVARGL, NVARNP, NVAREL of /DBNUMS/ |
| 31 |
C -- Uses ITVID, TIMPLT of /TPVARS/ |
| 32 |
|
| 33 |
include 'params.blk' |
| 34 |
include 'dbase.blk' |
| 35 |
include 'dbnums.blk' |
| 36 |
include 'tpvars.blk' |
| 37 |
|
| 38 |
DIMENSION A(*) |
| 39 |
INTEGER IPTIMS(NPTIMS) |
| 40 |
REAL PLTTIM(NPTIMS) |
| 41 |
REAL TIMES(*) |
| 42 |
LOGICAL WHOTIM(*) |
| 43 |
REAL PLTVAL(NPTIMS,NTPVAR) |
| 44 |
|
| 45 |
CHARACTER TYP |
| 46 |
|
| 47 |
C --Reserve memory for data record |
| 48 |
|
| 49 |
CALL MDRSRV ('VALS', KVALS, NSTEPS) |
| 50 |
CALL MDSTAT (NERR, MEM) |
| 51 |
IF (NERR .GT. 0) GOTO 130 |
| 52 |
|
| 53 |
C --Transfer element variables onto random file (for efficiency) |
| 54 |
|
| 55 |
do 140 n = 1, ntpvar |
| 56 |
call dbvtyp_bl (itvid(n), typ, inum) |
| 57 |
IF (TYP .EQ. 'H') THEN |
| 58 |
call prterr ('PROGRAM', |
| 59 |
* 'History variables should not exist') |
| 60 |
ELSE IF (TYP .EQ. 'G') THEN |
| 61 |
call exggvt(ndb, inum, 1, nsteps, a(kvals), ierr) |
| 62 |
ELSE IF (TYP .EQ. 'N') THEN |
| 63 |
call exgnvt(ndb, inum, itvne(n), 1, nsteps, a(kvals), ierr) |
| 64 |
ELSE IF (TYP .EQ. 'E') THEN |
| 65 |
call exgevt(ndb, inum, itvne(n), 1, nsteps, a(kvals), ierr) |
| 66 |
END IF |
| 67 |
|
| 68 |
DO 120 NPT = 1, NPTIMS |
| 69 |
ISTEP = IPTIMS(NPT) |
| 70 |
C --Read and store variable data to be plotted |
| 71 |
pltval(npt, n) = a(kvals-1+istep) |
| 72 |
120 CONTINUE |
| 73 |
140 CONTINUE |
| 74 |
|
| 75 |
C --Store time if it is used as a plot variable |
| 76 |
if (timplt) then |
| 77 |
do 150 npt = 1, nptims |
| 78 |
ISTEP = IPTIMS(NPT) |
| 79 |
PLTTIM(NPT) = TIMES(ISTEP) |
| 80 |
150 continue |
| 81 |
end if |
| 82 |
|
| 83 |
CALL MDDEL ('VALS') |
| 84 |
|
| 85 |
130 CONTINUE |
| 86 |
RETURN |
| 87 |
END |