Debian Codegraph @

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