Debian Codegraph @

packages/seacas/applications/blot/dbitim.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 DBITIM (NDB, OPTION, EXODUS,
9 & NVARNP, NELBLK, NVAREL, ISEVOK,
10 & NSTEPS, NSTEPW, A, KTIMES, KWHOLE, *)
11 C=======================================================================
12 C --*** DBITIM *** (EXOLIB) Read database time step times
13 C -- Written by Amy Gilkey - revised 11/11/87
14 C --
15 C --DBITIM reads all time steps of the database, storing the time for
16 C --each step in dynamic memory. It also sets the number of time steps.
17 C --If there is a dynamic memory problem, the routine returns immediately
18 C --without issuing an error message. If there is a read error, a
19 C --warning is printed and the step with the error is ignored.
20 C --
21 C --Parameters:
22 C -- NDB - IN - the database number
23 C -- OPTION - IN - ' ' to not store, '*' to store all, else store options:
24 C -- 'W' to store whole times only
25 C -- 'H' to store history times only
26 C -- EXODUS - IN - true iff this is an EXODUS file
27 C -- NVARNP - IN - the number of nodal variables
28 C -- NELBLK - IN - the number of element blocks
29 C -- NVAREL - IN - the number of element variables
30 C -- ISEVOK - IN - the element block variable truth table;
31 C -- variable i of block j exists iff ISEVOK(j,i)
32 C -- NSTEPS - OUT - the number of database time steps
33 C -- NSTEPW - OUT - the number of whole (versus history) database time steps
34 C -- A - IN/OUT - the dynamic memory base array
35 C -- KTIMES - OUT - the dynamic memory index of TIMES (if OPTION)
36 C -- KWHOLE - OUT - the dynamic memory index of WHOTIM (if OPTION);
37 C -- WHOTIM(i) is true iff TIMES(i) is a whole (versus history) time step
38 C -- * - return statement if error encountered, message is printed
39 C --
40 C --Database must be positioned in front of first time step upon entry;
41 C --upon exit positioned at end of file.
42
43 include 'exodusII.inc'
44 INTEGER NDB
45 CHARACTER*(*) OPTION
46 LOGICAL EXODUS
47 INTEGER NVARNP, NELBLK, NVAREL
48 C --NOTE: ISEVOK is doubly-dimensioned array (NELBLK,NVAREL)
49 LOGICAL ISEVOK(*)
50 INTEGER NSTEPS, NSTEPW
51 REAL A(*)
52 INTEGER KTIMES
53 INTEGER KWHOLE
54 CHARACTER*8 CDUM
55
56 LOGICAL STOWHO, STOHIS
57
58 STOWHO = ((OPTION .EQ. '*') .OR. (INDEX (OPTION, 'W') .GT. 0))
59 STOHIS = ((OPTION .EQ. '*') .OR. (INDEX (OPTION, 'H') .GT. 0))
60
61 IF (.NOT. EXODUS) GOTO 140
62
63 call exinq(ndb, EXTIMS, nsteps, rdum, cdum, ierr)
64 nstepw = nsteps
65 C --Reserve memory for step times
66 if (nsteps .le. 0) then
67 EXODUS = .FALSE.
68 goto 140
69 end if
70 CALL MDRSRV ('TIMES', KTIMES, nsteps)
71 IF (STOWHO .AND. STOHIS) THEN
72 CALL MDRSRV ('WHOTIM', KWHOLE, nsteps)
73 END IF
74 CALL MDSTAT (NERR, MEM)
75 IF (NERR .GT. 0) GOTO 150
76
77 WRITE (*, 10000) 'Please wait while the step times are read in'
78
79 C --Set NRECST = the number of database records in a whole time step
80
81 IF (.TRUE.) THEN
82
83 C --Read step time
84
85 call exgatm(ndb, a(ktimes), ierr)
86 C --Store step time after time step read correctly
87 CALL INILOG (nsteps, .TRUE., A(KWHOLE))
88 END IF
89
90 140 CONTINUE
91
92 150 CONTINUE
93 RETURN
94
95 10000 FORMAT (/, 1X, A)
96 END