Debian Codegraph @

packages/seacas/applications/grepos/gp_dbiste.f

raw
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 DBISTE (NDB, OPTION, ISTEP,
9 & NVARGL,
10 * NVARNP, NUMNP,
11 * NVAREL, NELBLK, NUMELB, ISEVOK, IDELB,
12 * NVARNS, NUMNPS, NNNPS, ISNSOK, IDNPS,
13 * NVARSS, NUMESS, NEESS, ISSSOK, IDESS,
14 * TIME, VARGL, VARNP, VAREL, VARNS, VARSS, *)
15 C=======================================================================
16 C --*** DBISTE *** (EXOLIB) Read database variables for one time step
17 C -- Written by Amy Gilkey - revised 10/14/87
18 C --
19 C --DBISTE reads the database global, nodal, and element variables
20 C --for one time step.
21 C --
22 C --Parameters:
23 C -- NDB - IN - the database number
24 C -- OPTION - IN - ' ' to not store, '*' to store all, else store options:
25 C -- 'G' to store global variables
26 C -- 'E' to store element variables
27 C -- 'N' to store nodal variables
28 C -- 'M' to store nodeset variables
29 C -- 'S' to store sideset variables
30 C -- ISTEP - IN - the time step number
31 C -- NVARGL - IN - the number of global variables
32 C -- NVARNP - IN - the number of nodal variables
33 C -- NUMNP - IN - the number of nodes
34 C -- NVAREL - IN - the number of element variables
35 C -- NELBLK - IN - the number of element blocks
36 C -- NUMELB - IN - the number of elements per block
37 C -- ISEVOK - IN - the element block variable truth table;
38 C -- variable i of block j exists iff ISEVOK(j,i)
39 C -- TIME - OUT - the time step time
40 C -- VARGL - OUT - the global variables for the time step (if OPTION)
41 C -- VARNP - OUT - the nodal variables for the time step (if OPTION)
42 C -- VAREL - OUT - the element variables for the time step (if OPTION)
43 C -- * - return statement if error encountered, including end-of-file;
44 C -- message is printed
45 C --
46 C --Database must be positioned in front of time step upon entry;
47 C --upon exit positioned after time step.
48
49 include 'exodusII.inc'
50 INTEGER NDB
51 CHARACTER*(*) OPTION
52 INTEGER ISTEP
53 INTEGER NVARGL
54 INTEGER NVARNP, NUMNP
55 INTEGER NVAREL, NELBLK, NUMELB(*), IDELB(*), ISEVOK(*)
56 INTEGER NVARNS, NUMNPS, NNNPS(*), IDNPS(*), ISNSOK(*)
57 INTEGER NVARSS, NUMESS, NEESS(*), IDESS(*), ISSSOK(*)
58 REAL TIME
59 REAL VARGL(*)
60 REAL VARNP(*)
61 REAL VAREL(*)
62 REAL VARNS(*)
63 REAL VARSS(*)
64
65 CHARACTER*80 ERRMSG
66
67 C --Read step time
68 CALL EXGTIM (NDB, ISTEP, TIME, IERR)
69
70 C --Read global variables
71
72 IF ((OPTION .EQ. '*') .OR. (INDEX (OPTION, 'G') .GT. 0)) THEN
73 if (nvargl .gt. 0) then
74 call exggv (ndb, istep, nvargl, vargl, ierr)
75 if (ierr .lt. 0) goto 180
76 end if
77 END IF
78
79 C --Read nodal variables
80
81 IF ((OPTION .EQ. '*') .OR. (INDEX (OPTION, 'N') .GT. 0)) THEN
82 ioff = 1
83 do 150 ivar = 1, nvarnp
84 call exgnv (ndb, istep, ivar, numnp, varnp(ioff), ierr)
85 if (ierr .lt. 0) goto 190
86 ioff = ioff + numnp
87 150 continue
88 END IF
89
90 C --Read element variables
91 IF ((OPTION .EQ. '*') .OR. (INDEX (OPTION, 'E') .GT. 0)) THEN
92 CALL DBIST2 (NDB, 'E', ISTEP, NVAREL, MAX(NVAREL,1), NELBLK,
93 & MAX(NELBLK,1), ISEVOK, VAREL, NUMELB,
94 & IDELB, IVAR, IELB, *200)
95 END IF
96
97 C --Read nodeset variables
98 IF ((OPTION .EQ. '*') .OR. (INDEX (OPTION, 'M') .GT. 0)) THEN
99 CALL DBIST2 (NDB, 'M', ISTEP, NVARNS, MAX(NVARNS,1), NUMNPS,
100 & MAX(NUMNPS,1), ISNSOK, VARNS, NNNPS,
101 & IDNPS, IVAR, IELB, *210)
102 END IF
103
104 C --Read sideset variables
105 IF ((OPTION .EQ. '*') .OR. (INDEX (OPTION, 'S') .GT. 0)) THEN
106 CALL DBIST2 (NDB, 'S', ISTEP, NVARSS, MAX(NVARSS,1), NUMESS,
107 & MAX(NUMESS,1), ISSSOK, VARSS, NEESS,
108 & IDESS, IVAR, IELB, *220)
109 END IF
110
111 RETURN
112
113 180 CONTINUE
114 WRITE (ERRMSG, '(A, I8)', IOSTAT=IDUM)
115 & 'GLOBAL VARIABLES for TIME STEP', ISTEP
116 GOTO 240
117
118 190 CONTINUE
119 WRITE (ERRMSG, '(A, I8, A, I8)', IOSTAT=IDUM)
120 & 'NODAL VARIABLE', IVAR, ' for TIME STEP', ISTEP
121 GOTO 240
122
123 200 CONTINUE
124 WRITE (ERRMSG, '(A, I8, A, I8, A, I8)', IOSTAT=IDUM)
125 & 'ELEMENT VARIABLE', IVAR, ' of BLOCK', IELB,
126 & ' for TIME STEP', ISTEP
127 GOTO 240
128
129 210 CONTINUE
130 WRITE (ERRMSG, '(A, I8, A, I8, A, I8)', IOSTAT=IDUM)
131 & 'NODESET VARIABLE', IVAR, ' of NODESET', IELB,
132 & ' for TIME STEP', ISTEP
133 GOTO 240
134
135 220 CONTINUE
136 WRITE (ERRMSG, '(A, I8, A, I8, A, I8)', IOSTAT=IDUM)
137 & 'SIDESET VARIABLE', IVAR, ' of SIDESET', IELB,
138 & ' for TIME STEP', ISTEP
139 GOTO 240
140
141 240 CONTINUE
142 CALL DBERR (IERR, ERRMSG)
143 RETURN 1
144 END