Debian Codegraph @

packages/seacas/applications/genshell/gs_dboelb.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 DBOELB (A, NDB,
9 & IDELB, NUMELB, NUMLNK, NUMATR, LINK, NAMELB, ATRIB, ATRIBNW)
10 C=======================================================================
11
12 C --*** DBOELB *** (EXOLIB) Write database element blocks
13 C -- Written by Amy Gilkey - revised 10/12/87
14 C --
15 C --DBOELB writes the element block information to the database.
16 C --Some dynamic dimensioning is done.
17 C --
18 C --Parameters:
19 C -- NDB - IN - the database file
20 C -- NELBS, NELBE - IN - the number of first and last element blocks
21 C -- to write
22 C -- IDELB - IN - the element block IDs for each block
23 C -- NUMELB - IN - the number of elements in each block
24 C -- NUMLNK - IN - the number of nodes per element in each block
25 C -- NUMATR - IN - the number of attributes in each block
26 C -- LINK - IN - the connectivity for each block
27 C -- ATRIB - IN - the attributes for each block
28 C -- ATRIBNW - IN - the new attributes if block is a 3D beam
29 include 'exodusII.inc'
30
31 REAL A(*)
32 INTEGER NDB
33 INTEGER IDELB
34 INTEGER NUMELB
35 INTEGER NUMLNK
36 INTEGER NUMATR
37 INTEGER LINK(*)
38 REAL ATRIB(*)
39 REAL ATRIBNW(7)
40 CHARACTER*(mxstln) NAMELB
41
42 IELNK = 0
43 IEATR = 0
44
45 call expelb(ndb, IDELB, NAMELB, NUMELB, NUMLNK, NUMATR, IERR)
46 call expelc(ndb, idelb, link, ierr)
47
48 if (numatr .gt. 0) then
49 if (namelb(:4) .eq. 'BEAM') then
50 C ... A 3D beam needs special treatment since it has 7 attributes
51 C and the input 2D beam will only have 1 or 3 attributes.
52 C The attributes have been specified in the 'ATRIBNW' array
53 C by the user (or the defaults are used). Need to expand the
54 C single value per block values from the ATRIBNW array into
55 C 7 values per element.
56 call mdlong('ATRIBNW', KATRIB, 7*numelb)
57 CALL MDSTAT (NERR, MEM)
58 IF (NERR .GT. 0) THEN
59 CALL MEMERR
60 STOP 'memory error'
61 END IF
62 call geneat(ndb, idelb, a(katrib), atribnw, numelb)
63 else
64 call expeat(ndb, idelb, atrib, ierr)
65 end if
66 end if
67
68 RETURN
69 END
70
71 subroutine geneat(ndb, idelb, atrib, atribnw, numelb)
72 real atrib(*)
73 real atribnw(7)
74
75 i = 0
76 do 20 ie = 1, numelb
77 do 10 ia=1, 7
78 i = i + 1
79 atrib(i) = atribnw(ia)
80 10 continue
81 20 continue
82 call expeat(ndb, idelb, atrib, ierr)
83
84 return
85 end