Debian Codegraph @

packages/seacas/applications/gjoin/gj_inigen.f

raw
1 C Copyright(C) 1999-2022 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 INIGEN (A, FIRST,
9 & KXN, KYN, KZN, KMAPEL,
10 & KIDELB, KNELB, KNLNK, KNATR, KLINK, KATRIB,
11 & KIDNS, KNNNS, KIXNNS, KLTNNS, KFACNS,
12 & KIDSS, KNESS, KNDSS, KIXESS, KIXDSS, KLTESS, kltsss,
13 & kltsnc, KFACSS, KNMLB, KNMBK, KNMNS, KNMSS)
14 C=======================================================================
15
16 C --*** INIGEN *** (GJOIN) Initialize the memory for GENESIS database
17 C -- Written by Amy Gilkey - revised 10/14/87
18 C --
19 C --INIGEN initializes the arrays for the GENESIS database. If this is
20 C --the first time through, the memory is reserved (with a length of 0),
21 C --otherwise it is just set to a length of 0.
22 C --
23 C --Parameters:
24 C -- A - IN/OUT - the dynamic memory base array
25 C -- FIRST - IN - true iff memory is to be reserved
26 C -- KXN, KYN, KZN - OUT - index of XN, YN, ZN; nodal coordinates
27 C -- KMAPEL - OUT - index of MAPEL; the element order map
28 C -- KIDELB - OUT - index of IDELB; the element block IDs for each block
29 C -- KNELB - OUT - index of NUMELB; the number of elements in each block
30 C -- KNLNK - OUT - index of NUMLNK; the number of nodes per element
31 C -- in each block
32 C -- KNATR - OUT - index of NUMATR; the number of attributes in each block
33 C -- KLINK - OUT - index of LINK; the connectivity for each block
34 C -- KATRIB - OUT - index of ATRIB; the attributes for each block
35 C -- KIDNS - OUT - index of IDNPS; the nodal point set ID for each set
36 C -- KNNNS - OUT - index of NNNPS; the number of nodes for each set
37 C -- KIXNNS - OUT - index of IXNNPS; the index of the first node
38 C -- for each set
39 C -- KLTNNS - OUT - index of LTNNPS; the nodes for all sets
40 C -- KFACNS - OUT - index of FACNPS; the distribution factors for all sets
41 C -- KIDSS - OUT - index of IDESS; the element side set ID for each set
42 C -- KNESS - OUT - index of NEESS; the number of elements for each set
43 C -- KNDSS - OUT - index of NDESS; the number of dist-fact for each set
44 C -- KIXESS - OUT - index of IXEESS; the index of the first element
45 C -- for each set
46 C -- KIXDSS - OUT - index of IXDESS; the index of the first dist-fact for each set
47 C -- KLTESS - OUT - index of LTEESS; the elements for all sets
48 C -- kltsss - OUT - index of LTSESS; the sides for all sets
49 C -- kltsnc - OUT - index of LTSSNC; the index of the first dist factor for each face.
50 C -- KFACSS - OUT - index of FACESS; the distribution factors for all sets
51
52 include 'exodusII.inc'
53 include 'gj_namlen.blk'
54
55 DIMENSION A(*)
56 LOGICAL FIRST
57
58 if (FIRST) THEN
59 namlen = MXNAME
60 end if
61
62 IF (FIRST) THEN
63 CALL MDRSRV ('XN', KXN, 0)
64 CALL MDRSRV ('YN', KYN, 0)
65 CALL MDRSRV ('ZN', KZN, 0)
66 ELSE
67 CALL MDLONG ('XN', KXN, 0)
68 CALL MDLONG ('YN', KYN, 0)
69 CALL MDLONG ('ZN', KZN, 0)
70 END IF
71
72 IF (FIRST) THEN
73 CALL MDRSRV ('MAPEL', KMAPEL, 0)
74 ELSE
75 CALL MDLONG ('MAPEL', KMAPEL, 0)
76 END IF
77
78 IF (FIRST) THEN
79 CALL MDRSRV ('IDELB', KIDELB, 0)
80 CALL MDRSRV ('NUMELB', KNELB, 0)
81 CALL MDRSRV ('NUMLNK', KNLNK, 0)
82 CALL MDRSRV ('NUMATR', KNATR, 0)
83 CALL MDRSRV ('LINK', KLINK, 0)
84 CALL MDRSRV ('ATRIB', KATRIB, 0)
85 ELSE
86 CALL MDLONG ('IDELB', KIDELB, 0)
87 CALL MDLONG ('NUMELB', KNELB, 0)
88 CALL MDLONG ('NUMLNK', KNLNK, 0)
89 CALL MDLONG ('NUMATR', KNATR, 0)
90 CALL MDLONG ('LINK', KLINK, 0)
91 CALL MDLONG ('ATRIB', KATRIB, 0)
92 END IF
93
94 IF (FIRST) THEN
95 CALL MDRSRV ('IDNPS', KIDNS, 0)
96 CALL MDRSRV ('NNNPS', KNNNS, 0)
97 call mdrsrv ('NDNPS', kndns, 0) ! Node set df count array
98 CALL MDRSRV ('IXNNPS', KIXNNS, 0)
99 call mdrsrv ('IXDNPS', kixdns, 0) ! Node set df index array
100 CALL MDRSRV ('LTNNPS', KLTNNS, 0)
101 CALL MDRSRV ('FACNPS', KFACNS, 0) ! Expanded df list array
102 call mdrsrv ('CFACNP', kcfacn, 0) ! Exo II df list array
103 ELSE
104 CALL MDLONG ('IDNPS', KIDNS, 0)
105 CALL MDLONG ('NNNPS', KNNNS, 0)
106 call mdlong ('NDNPS', kndns, 0) ! Node set df count array
107 CALL MDLONG ('IXNNPS', KIXNNS, 0)
108 call mdlong ('IXDNPS', kixdns, 0) ! Node set df index array
109 CALL MDLONG ('LTNNPS', KLTNNS, 0)
110 CALL MDLONG ('FACNPS', KFACNS, 0) ! Expanded df list array
111 call mdlong ('CFACNP', kcfacn, 0) ! Exo II df list array
112 END IF
113
114 IF (FIRST) THEN
115 CALL MDRSRV ('IDESS', KIDSS, 0)
116 CALL MDRSRV ('NEESS', KNESS, 0)
117 call mdrsrv ('NDESS', kndss, 0) ! number of dist factors array
118 CALL MDRSRV ('IXEESS', KIXESS, 0)
119 call mdrsrv ('IXDESS', kixdss, 0) ! index into dist factors array
120 CALL MDRSRV ('LTEESS', KLTESS, 0)
121 call mdrsrv ('LTSESS', kltsss, 0) ! side list
122 call mdrsrv ('LTSSNC', kltsnc, 0) ! dist-fact index list
123 CALL MDRSRV ('FACESS', KFACSS, 0) ! Expanded df list array
124 ELSE
125 CALL MDLONG ('IDESS', KIDSS, 0)
126 CALL MDLONG ('NEESS', KNESS, 0)
127 call mdlong ('NDESS', kndss, 0) ! number of dist factors array
128 CALL MDLONG ('IXEESS', KIXESS, 0)
129 call mdlong ('IXDESS', kixdss, 0) ! index into dist factors array
130 CALL MDLONG ('LTEESS', KLTESS, 0)
131 call mdlong ('LTSESS', kltsss, 0) ! side list
132 call mdlong ('LTSSNC', kltsnc, 0) ! dist-face index list
133 CALL MDLONG ('FACESS', KFACSS, 0) ! Expanded df list array
134 END IF
135
136 IF (FIRST) THEN
137 CALL MCRSRV ('NAMELB', KNMLB, 0)
138 CALL MCRSRV ('NAMBK', KNMBK, 0)
139 CALL MCRSRV ('NAMNS', KNMNS, 0)
140 CALL MCRSRV ('NAMSS', KNMSS, 0)
141 ELSE
142 CALL MCLONG ('NAMELB', KNMLB, 0)
143 CALL MCLONG ('NAMBK', KNMBK, 0)
144 CALL MCLONG ('NAMNS', KNMNS, 0)
145 CALL MCLONG ('NAMSS', KNMSS, 0)
146 END IF
147
148 RETURN
149 END