Debian Codegraph @

packages/seacas/libraries/suplib/dbvini.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 DBVINI (NVARHI, NVARGL, NVARNP, NVAREL)
9 C=======================================================================
10
11 C --*** DBVINI *** (EXOLIB) Initialize for DBVTYP and DBVIX
12 C -- Written by Amy Gilkey - revised 10/14/87
13 C --
14 C --DBVINI initializes the indices for DBVTYP and DBVID. It must be
15 C --called before either of the other two routines are called.
16 C --
17 C --Note that the indices are shared because the other two routines
18 C --are ENTRY routines of DBVINI.
19 C --
20 C --Parameters:
21 C -- NVARHI - IN - the number of history variables
22 C -- NVARGL - IN - the number of global variables
23 C -- NVARNP - IN - the number of nodal variables
24 C -- NVAREL - IN - the number of element variables
25
26 INTEGER NVARHI, NVARGL, NVARNP, NVAREL
27
28 C --Definition for the ENTRY routine parameters
29 CHARACTER ITYP, TYP
30 INTEGER IID, ID
31 INTEGER IIX, IX
32
33 INTEGER IXHV, IXGV, IXNV, IXEV, IXHVE, IXGVE, IXNVE, IXEVE
34 SAVE IXHV, IXGV, IXNV, IXEV, IXHVE, IXGVE, IXNVE, IXEVE
35
36 DATA IXHV, IXGV, IXNV, IXEV / -1, -1, -1, -1 /
37
38 IXHV = 1
39 IXHVE = IXHV + NVARHI - 1
40 IXGV = IXHVE + 1
41 IXGVE = IXGV + NVARGL - 1
42 IXNV = IXGVE + 1
43 IXNVE = IXNV + NVARNP - 1
44 IXEV = IXNVE + 1
45 IXEVE = IXEV + NVAREL - 1
46
47 RETURN
48
49 C=======================================================================
50 ENTRY DBVTYP (IIX, TYP, ID)
51 C=======================================================================
52
53 C --*** DBVTYP *** (EXOLIB) Return the variable type and number
54 C -- Written by Amy Gilkey - revised 03/18/88
55 C --
56 C --DBVTYP is passed a variable index. It returns the variable type
57 C --and variable number.
58 C --
59 C --Note that DBVINI must be called before this routine to initialize
60 C --the indices. The indices are shared because this routine is an
61 C --ENTRY routine of DBVINI.
62 C --
63 C --Parameters:
64 C -- IIX - IN - the variable index
65 C -- TYP - OUT - the variable type: 'H'istory, 'G'lobal, 'N'odal, 'E'lement
66 C -- ID - OUT - the variable number within the type
67
68 IF ((IXHV .LE. 0) .AND. (IXGV .LE. 0)
69 & .AND. (IXNV .LE. 0) .AND. (IXEV .LE. 0))
70 & RETURN
71
72 IF ((IIX .GE. IXHV) .AND. (IIX .LE. IXHVE)) THEN
73 TYP = 'H'
74 ID = IIX - IXHV + 1
75 ELSE IF ((IIX .GE. IXGV) .AND. (IIX .LE. IXGVE)) THEN
76 TYP = 'G'
77 ID = IIX - IXGV + 1
78 ELSE IF ((IIX .GE. IXNV) .AND. (IIX .LE. IXNVE)) THEN
79 TYP = 'N'
80 ID = IIX - IXNV + 1
81 ELSE IF ((IIX .GE. IXEV) .AND. (IIX .LE. IXEVE)) THEN
82 TYP = 'E'
83 ID = IIX - IXEV + 1
84 ELSE
85 TYP = ' '
86 ID = 0
87 END IF
88
89 RETURN
90
91 C=======================================================================
92 ENTRY DBVIX (ITYP, IID, IX)
93 C=======================================================================
94
95 C --*** DBVIX *** (EXOLIB) Return the variable index
96 C -- Written by Amy Gilkey - revised 10/14/87
97 C --
98 C --DBVIX is passed a variable type and number. It returns the variable
99 C --index.
100 C --
101 C --Note that DBVINI must be called before this routine to initialize
102 C --the indices. The indices are shared because this routine is an
103 C --ENTRY routine of DBVINI.
104 C --
105 C --Parameters:
106 C -- ITYP - IN - the variable type: 'H'istory, 'G'lobal, 'N'odal, 'E'lement
107 C -- IID - IN - the variable number within the type
108 C -- IX - OUT - the variable index
109
110 IF ((IXHV .LE. 0) .AND. (IXGV .LE. 0)
111 & .AND. (IXNV .LE. 0) .AND. (IXEV .LE. 0))
112 & RETURN
113
114 IF (ITYP .EQ. 'H') THEN
115 IX = IID + IXHV - 1
116 ELSE IF (ITYP .EQ. 'G') THEN
117 IX = IID + IXGV - 1
118 ELSE IF (ITYP .EQ. 'N') THEN
119 IX = IID + IXNV - 1
120 ELSE IF (ITYP .EQ. 'E') THEN
121 IX = IID + IXEV - 1
122 END IF
123
124 RETURN
125 END