Debian Codegraph @

packages/seacas/applications/ex1ex2v2/ex1_dbieb1.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 DBIEB1 (NDB, OPTION, IELB, NUMELB, NUMLNK, NUMATR,
9 & LINK, ATRIB, NATRDM, NLNKDM, *)
10 C=======================================================================
11
12 C --*** DBIEB1 *** (EXOLIB) Read database element block misc.
13 C -- Written by Amy Gilkey - revised 10/14/87
14 C -- Modified by Greg Sjaardema - 8/8/90
15 C -- ---Removed MAX from Dimension statements, Added NATRDM, NLNKDM
16 C --
17 C --DBIEB1 reads the element block connectivity and attribute information
18 C --from the database. An error message is displayed if the end of file
19 C --is read.
20 C --
21 C --Parameters:
22 C -- NDB - IN - the database file
23 C -- OPTION - IN - ' ' to not store, '*' to store all, else store options:
24 C -- 'C' to store connectivity
25 C -- 'A' to store attributes
26 C -- IELB - IN - the element block number
27 C -- NUMELB - IN - the number of elements in the block
28 C -- NUMLNK - IN - the number of nodes per element;
29 C -- negate to not store connectivity
30 C -- NUMATR - IN - the number of attributes;
31 C -- negate to not store attributes
32 C -- LINK - OUT - the element connectivity for this block
33 C -- ATRIB - OUT - the attributes for this block
34 C -- NATRDM - IN - dimension of atrib array
35 C -- NLNKDM - IN - dimension of link array
36 C -- * - return statement if end of file or read error
37 C --
38 C --Database must be positioned at start of element block misc. information
39 C --upon entry; upon exit at end of element block misc. information.
40
41 INTEGER NDB
42 CHARACTER*(*) OPTION
43 INTEGER NUMELB, NUMLNK, NUMATR
44 INTEGER LINK(NLNKDM, *)
45 REAL ATRIB(NATRDM,*)
46
47 CHARACTER*80 ERRMSG
48
49 IF ((OPTION .EQ. '*') .OR. (INDEX (OPTION, 'C') .GT. 0)) THEN
50 READ (NDB, END=100, ERR=100, IOSTAT=IERR)
51 & ((LINK(I,NE), I=1,NUMLNK), NE=1,NUMELB)
52 ELSE
53 READ (NDB, END=100, ERR=100, IOSTAT=IERR)
54 END IF
55
56 IF ((OPTION .EQ. '*') .OR. (INDEX (OPTION, 'A') .GT. 0)) THEN
57 READ (NDB, END=110, ERR=110, IOSTAT=IERR)
58 & ((ATRIB(I,NE), I=1,NUMATR), NE=1,NUMELB)
59 ELSE
60 READ (NDB, END=110, ERR=110, IOSTAT=IERR)
61 END IF
62
63 RETURN
64
65 100 CONTINUE
66 WRITE (ERRMSG, '(A, I8)', IOSTAT=IDUM)
67 & 'CONNECTIVITY for ELEMENT BLOCK', IELB
68 GOTO 120
69 110 CONTINUE
70 WRITE (ERRMSG, '(A, I8)', IOSTAT=IDUM)
71 & 'ATTRIBUTES for ELEMENT BLOCK', IELB
72 GOTO 120
73 120 CONTINUE
74 CALL DBERR (IERR, ERRMSG)
75 RETURN 1
76 END