Debian Codegraph @

packages/seacas/applications/grepos/gp_dboste.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 DBOSTE (NDB, ISTEP,
9 & NVARGL, NVARNP, NUMNP, NVAREL, NELEXT,
10 * NELBLK, NUMELB, ISEVOK, IDELB,
11 * NVARNS, NUMNPS, NNNPS, ISNSOK, IDNPS,
12 * NVARSS, NUMESS, NEESS, ISSSOK, IDESS,
13 * TIME, VARGL, VARNP, VAREL, VARNS, VARSS, VARXT)
14 C=======================================================================
15
16 C --*** DBOSTE *** (EXOLIB) Write database variables for one time step
17 C -- Written by Amy Gilkey - revised 10/14/87
18 C -- Modified by Greg Sjaardema - 10/2/90
19 C -- Removed MAX from dimension statements, added routine
20 C -- DBOST1 to do all work.
21 C --
22 C --DBOSTE writes the database history, global, nodal, and element variables
23 C --for one time step.
24 C --
25 C --Parameters:
26 C -- NDB - IN - the database number
27 C -- ISTEP - IN - the time step number
28 C -- NVARGL - IN - the number of global variables
29 C -- NVARNP - IN - the number of nodal variables
30 C -- NUMNP - IN - the number of nodes
31 C -- NVAREL - IN - the number of element variables
32 C -- NELBLK - IN - the number of element blocks
33 C -- NUMELB - IN - the number of elements per block
34 C -- ISEVOK - IN - the element block variable truth table;
35 C -- variable i of block j exists iff ISEVOK(j,i)
36 C -- TIME - IN - the time step time
37 C -- VARGL - IN - the global variables for the time step
38 C -- VARNP - IN - the nodal variables for the time step
39 C -- VAREL - IN - the element variables for the time step
40 C --
41 C --Database must be positioned in front of time step upon entry;
42 C --upon exit positioned after time step.
43
44 include 'exodusII.inc'
45 INTEGER NDB
46 INTEGER ISTEP
47 INTEGER NVARGL
48 INTEGER NVARNP, NUMNP
49 INTEGER NVAREL, NELBLK, NUMELB(*), IDELB(*)
50 LOGICAL ISEVOK(NELBLK,*)
51 INTEGER NVARNS, NUMNPS, NNNPS(*), IDNPS(*)
52 LOGICAL ISNSOK(NUMNPS,*)
53 INTEGER NVARSS, NUMESS, NEESS(*), IDESS(*)
54 LOGICAL ISSSOK(NUMESS,*)
55 REAL TIME
56 REAL VARGL(*)
57 REAL VARNP(*)
58 REAL VAREL(*)
59 REAL VARNS(*)
60 REAL VARSS(*)
61 REAL VARXT(*)
62
63 C --Write step time
64 CALL EXPTIM (NDB, ISTEP, TIME, IERR)
65
66 C --Write global variables
67
68 IF (NVARGL .GT. 0) THEN
69 call expgv (ndb, istep, nvargl, vargl, ierr)
70 END IF
71
72 C --Write nodal variables
73
74 INP0 = 1
75 DO 100 IVAR = 1, NVARNP
76 CALL EXPNV (NDB, ISTEP, IVAR, NUMNP, VARNP(INP0), IERR)
77 INP0 = INP0 + NUMNP
78 100 CONTINUE
79
80 C --Write element variables
81 iel0 = 1
82 do 110 i = 1, nvarel
83 do 120 ielb = 1, nelblk
84 if (isevok(ielb,i)) then
85 if (numelb(ielb) .gt. 0) then
86 call expev (ndb, istep, i, idelb(ielb), numelb(ielb),
87 & varel(iel0), ierr)
88 end if
89 end if
90 C ... See dbist2.f for details. There is a value stored for each
91 C element variable for each block even if the truth table
92 C if false. We only output when the truth table is true.
93 C We need to skip over the values that shouldn't be written.
94 iel0 = iel0 + numelb(ielb)
95 120 continue
96 110 continue
97
98 iel0 = 1
99 do i = 1, nelext
100 do ielb = 1, nelblk
101 if (numelb(ielb) .gt. 0) then
102 call expev (ndb, istep, nvarel+i, idelb(ielb),
103 $ numelb(ielb), varxt(iel0), ierr)
104 end if
105 iel0 = iel0 + numelb(ielb)
106 end do
107 end do
108
109 C --Write nodeset variables
110 iel0 = 1
111 do i = 1, nvarns
112 do ielb = 1, numnps
113 if (isnsok(ielb,i)) then
114 if (nnnps(ielb) .gt. 0) then
115 call expnsv (ndb, istep, i, idnps(ielb), nnnps(ielb),
116 & varns(iel0), ierr)
117 end if
118 end if
119 iel0 = iel0 + nnnps(ielb)
120 end do
121 end do
122
123 C --Write sideset variables
124 iel0 = 1
125 do i = 1, nvarss
126 do ielb = 1, numess
127 if (isssok(ielb,i)) then
128 if (neess(ielb) .gt. 0) then
129 call expssv (ndb, istep, i, idess(ielb), neess(ielb),
130 & varss(iel0), ierr)
131 end if
132 end if
133 iel0 = iel0 + neess(ielb)
134 end do
135 end do
136
137 RETURN
138 END