| 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 |
C======================================================================= |
| 7 |
SUBROUTINE RDSTEP (NDB, NCSTEP, |
| 8 |
& NUMELB, IDELB, ISEVOK, |
| 9 |
& TIME, VARGL, VARNP, VAREL, |
| 10 |
$ neldm) |
| 11 |
C======================================================================= |
| 12 |
|
| 13 |
C --*** RDSTEP *** (EXPLORE) Read current database variables |
| 14 |
C -- |
| 15 |
C --RDSTEP reads the variable data for the next time step from the |
| 16 |
C --database. |
| 17 |
C -- |
| 18 |
C --Parameters: |
| 19 |
C -- NDB - IN - the database number |
| 20 |
C -- NCSTEP - IN/OUT - the current step number |
| 21 |
C -- NVARGL - IN - the number of global variables |
| 22 |
C -- NVARNP - IN - the number of nodal variables |
| 23 |
C -- NVAREL - IN - the number of element variables |
| 24 |
C -- NUMELB - IN - the number of elements per block |
| 25 |
C -- ISEVOK - IN - the element block variable truth table; |
| 26 |
C -- variable i of block j exists iff ISEVOK(i,j) is NOT 0 |
| 27 |
C -- TIME - OUT - the time step time |
| 28 |
C -- VARGL - OUT - the global variables for the time step |
| 29 |
C -- VARNP - OUT - the nodal variables for the time step |
| 30 |
C -- VAREL - OUT - the element variables for the time step |
| 31 |
|
| 32 |
include 'exodusII.inc' |
| 33 |
include 'exp_dbnums.blk' |
| 34 |
|
| 35 |
INTEGER NUMELB(*) |
| 36 |
INTEGER IDELB(*) |
| 37 |
INTEGER ISEVOK(nvarel,*) |
| 38 |
REAL VARGL(*) |
| 39 |
REAL VARNP(numnp, *) |
| 40 |
REAL VAREL(numel, *) |
| 41 |
|
| 42 |
CHARACTER*80 ERRMSG |
| 43 |
|
| 44 |
C ... Initialize variables to known value in case error on read |
| 45 |
TIME = -999.9 |
| 46 |
CALL INIREA (NVARGL, -999.9, VARGL) |
| 47 |
CALL INIREA (NVARNP * NUMNP, -999.9, VARNP) |
| 48 |
CALL INIREA (NVAREL * NUMEL, -999.9, VAREL) |
| 49 |
|
| 50 |
C ... Read the time for the specified step |
| 51 |
call exgtim(ndb, ncstep, time, ierr) |
| 52 |
if (ierr .ne. 0) go to 150 |
| 53 |
|
| 54 |
C ... Read the global variables (if any) |
| 55 |
if (nvargl .gt. 0) then |
| 56 |
call exggv (ndb, ncstep, nvargl, vargl, ierr) |
| 57 |
if (ierr .ne. 0) go to 170 |
| 58 |
end if |
| 59 |
|
| 60 |
C ... Read the nodal variables (if any) |
| 61 |
DO 120 I = 1, NVARNP |
| 62 |
call exgnv (ndb, ncstep, i, numnp, varnp(1,i), ierr) |
| 63 |
if (ierr .ne. 0) go to 180 |
| 64 |
120 CONTINUE |
| 65 |
|
| 66 |
C ... Read the element variables (if any) |
| 67 |
DO 140 I = 1, NVAREL |
| 68 |
IEL0 = 1 |
| 69 |
DO 130 IELB = 1, NELBLK |
| 70 |
IF (ISEVOK(I,IELB) .NE. 0 .AND. numelb(ielb) .GT. 0) THEN |
| 71 |
call exgev (ndb, ncstep, i, idelb(ielb), |
| 72 |
& numelb(ielb), varel(iel0,i), ierr) |
| 73 |
if (ierr .ne. 0) go to 190 |
| 74 |
END IF |
| 75 |
IEL0 = IEL0 + NUMELB(IELB) |
| 76 |
130 CONTINUE |
| 77 |
140 CONTINUE |
| 78 |
|
| 79 |
RETURN |
| 80 |
|
| 81 |
150 CONTINUE |
| 82 |
WRITE (ERRMSG, 10000, IOSTAT=IDUM) |
| 83 |
& 'TIME on step', NCSTEP |
| 84 |
GOTO 200 |
| 85 |
170 CONTINUE |
| 86 |
WRITE (ERRMSG, 10000, IOSTAT=IDUM) |
| 87 |
& 'GLOBAL VARIABLES on step', NCSTEP |
| 88 |
GOTO 200 |
| 89 |
180 CONTINUE |
| 90 |
WRITE (ERRMSG, 10000, IOSTAT=IDUM) |
| 91 |
& 'NODAL VARIABLE', I, ' on step', NCSTEP |
| 92 |
GOTO 200 |
| 93 |
190 CONTINUE |
| 94 |
WRITE (ERRMSG, 10000, IOSTAT=IDUM) |
| 95 |
& 'ELEMENT VARIABLE', I, ' in block', IELB, ' on step', NCSTEP |
| 96 |
GOTO 200 |
| 97 |
200 CONTINUE |
| 98 |
CALL WDBERR (IERR, ERRMSG) |
| 99 |
|
| 100 |
RETURN |
| 101 |
|
| 102 |
10000 FORMAT (5 (A, I12)) |
| 103 |
END |