Debian Codegraph @

packages/seacas/applications/gen3d/g3_rdelb.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 RDELB (A, IDELB, NAMELB, NUMELB, NUMLNK, NUMATR,
9 & LINK, KATRIB, *)
10 C=======================================================================
11
12 C --*** RDELB *** (GEN3D) Read database element blocks
13 C -- Written by Amy Gilkey - revised 02/22/88
14 C --
15 C --RDELB reads the element block information from the database.
16 C --Some dynamic dimensioning is done.
17 C --An error message is displayed if the end of file is read.
18 C --
19 C --Parameters:
20 C -- A - IN - the dynamic memory base array
21 C -- IDELB - OUT - the element block ID for each block
22 C -- NUMELB - OUT - the number of elements for each block
23 C -- NUMLNK - OUT - the number of nodes per element for each block
24 C -- NUMATR - OUT - the number of attributes for each block
25 C -- LINK - OUT - the connectivity array (4 nodes per element)
26 C -- KATRIB - OUT - the dynamic memory pointer to the attribute array
27 C -- (named 'ATRIB', packed)
28 C -- * - return statement if end of file or read error
29 C --
30 C --Common Variables:
31 C -- Uses NDBIN of /DBASE/
32 C -- Uses NUMEL, NELBLK of /DBNUMS/
33
34 INCLUDE 'exodusII.inc'
35 INCLUDE 'g3_dbase.blk'
36 INCLUDE 'g3_dbnums.blk'
37
38 DIMENSION A(*)
39 CHARACTER*32 NAMELB(NELBLK)
40 INTEGER IDELB(NELBLK)
41 INTEGER NUMELB(NELBLK)
42 INTEGER NUMLNK(NELBLK)
43 INTEGER NUMATR(NELBLK)
44 INTEGER LINK(4,NUMEL)
45
46 CHARACTER*5 STRA
47
48 IEATR = 0
49 ISATR = 0
50 CALL MDRSRV ('ATRIB', KATRIB, IEATR)
51 CALL MDSTAT (NERR, MEM)
52 IF (NERR .GT. 0) GOTO 30
53
54 C ... Set all entries in the LINK array to -1.
55 C This is a kludge, but lets us discriminate between quads, tris,
56 C and shells in other parts of the program (newess)
57 CALL INIINT(4*NUMEL, -1, LINK)
58
59 call exgebi (ndbin, idelb, ierr)
60 MAXNQ = 0
61 DO 5 IELB = 1, NELBLK
62 call exgelb(ndbin, idelb(ielb), namelb(ielb), numelb(ielb),
63 & numlnk(ielb), numatr(ielb), ierr)
64 if (ierr .ne. 0) goto 30
65
66 C ... See if there are any non-quad element blocks since we have to
67 C read in the connectivity different for exodusII than the code
68 C expects
69 if (numlnk(ielb) .ne. 4) then
70 if (numelb(ielb)*numlnk(ielb) .gt. MAXNQ)
71 * MAXNQ = numelb(ielb)*numlnk(ielb)
72 end if
73 5 continue
74
75 if (maxnq .gt. 0) then
76 call mdrsrv('LINTMP', klntmp, maxnq)
77 call mdstat (nerr, mem)
78 IF (NERR .GT. 0) GOTO 20
79 end if
80
81 IEND = 0
82 DO 10 IELB = 1, NELBLK
83 ISTART = IEND + 1
84 IEND = ISTART + NUMELB(IELB) - 1
85 IF (IEND .GT. NUMEL) GOTO 40
86
87 if (numatr(ielb) .gt. 0) then
88 ISATR = IEATR + 1
89 IEATR = ISATR + NUMATR(IELB) * NUMELB(IELB) - 1
90 CALL MDLONG ('ATRIB', KATRIB, IEATR)
91 CALL MDSTAT (NERR, MEM)
92 IF (NERR .GT. 0) GOTO 20
93 end if
94 CALL RELBLK (IDELB(IELB), NUMELB(IELB), NUMLNK(IELB),
95 & NUMATR(IELB), LINK(1,ISTART), A(KATRIB+ISATR-1),
96 & a(klntmp), *50)
97 10 CONTINUE
98
99 20 CONTINUE
100 if (maxnq .gt. 0) then
101 call mddel('LINTMP')
102 call mdstat (nerr, mem)
103 IF (NERR .GT. 0) GOTO 50
104 end if
105 RETURN
106
107 30 CONTINUE
108 CALL INTSTR (1, 0, IELB, STRA, LSTRA)
109 CALL PRTERR ('FATAL',
110 & 'Reading ELEMENT BLOCK SIZING PARAMETERS for block '
111 & // STRA(:LSTRA))
112 GOTO 50
113 40 CONTINUE
114 CALL PRTERR ('FATAL', 'Number of elements in blocks > NUMEL')
115 GOTO 50
116 50 CONTINUE
117 RETURN 1
118 END