Debian Codegraph @

packages/seacas/applications/explore/exp_tostep.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 C=======================================================================
7 SUBROUTINE TOSTEP (NSTEP, NUMELB, IDELB, ISEVOK,
8 & TIME, VARGL, VARNP, VAREL)
9 C=======================================================================
10
11 C --*** TOSTEP *** (EXPLORE) Move database to given time step number
12 C --
13 C --TOSTEP reads the given time step variables (NSTEP), setting
14 C --the time step to the new current time step. A message is
15 C --displayed if the time step is too large.
16 C --
17 C --Parameters:
18 C -- NSTEP - IN/OUT - the number of the time step to be read;
19 C -- the returned number of the time step actually read
20 C -- NUMELB - IN - the number of elements per block
21 C -- ISEVOK - IN - the element block variable truth table;
22 C -- variable i of block j exists iff ISEVOK(i,j) is NOT 0
23 C -- TIME - OUT - the time step time
24 C -- VARGL - IN/OUT - the global variables for the time step
25 C -- VARNP - IN/OUT - the nodal variables for the time step
26 C -- VAREL - IN/OUT - the element variables for the time step
27 C --
28 C --Common Variables:
29 C -- Sets and uses NCSTEP of /DBASE/
30 C -- Uses NELBLK, NQAREC, NINFO, NVARHI, NVARGL, NVARNP, NVAREL, NSTEPS
31 C -- of /DBNUMS/
32
33 include 'exp_dbase.blk'
34 include 'exp_dbnums.blk'
35
36 INTEGER NUMELB(*)
37 INTEGER IDELB(*)
38 INTEGER ISEVOK(NVAREL,*)
39 REAL VARGL(*), VARNP(*), VAREL(*)
40
41 CHARACTER*5 STRA
42
43 LOGICAL FIRST
44 SAVE FIRST
45
46 INTEGER NCSTEP
47 REAL CTIME
48 save ctime
49 C --NCSTEP - the current step number
50 C --CTIME - the current time
51
52 DATA FIRST / .TRUE. /
53
54 IF (FIRST) THEN
55 NCSTEP = -999
56 FIRST = .FALSE.
57 END IF
58
59 IF (NSTEP .LE. 0) THEN
60 CALL INTSTR (1, 0, NSTEP, STRA, LSTRA)
61 CALL PRTERR ('CMDERR',
62 & 'Invalid time step number ' // STRA(:LSTRA))
63 GOTO 150
64 END IF
65
66 if (nstep .ne. ncstep) then
67 CALL RDSTEP (NDB, NSTEP,
68 & NUMELB, IDELB, ISEVOK,
69 & CTIME, VARGL, VARNP, VAREL,
70 $ max(1,nvarel))
71 ncstep = nstep
72 END IF
73 TIME = CTIME
74
75 IF (NSTEP .GT. NSTEPS) THEN
76 IF (NCSTEP .EQ. 0) THEN
77 WRITE (*, 10010) 'There are no time steps'
78 ELSE
79 WRITE (*, 10010)
80 & 'All time steps have been read from the database'
81 END IF
82 END IF
83
84 150 CONTINUE
85 NSTEP = NCSTEP
86 RETURN
87
88 10010 FORMAT (1X, 5A)
89 END