Debian Codegraph @

packages/seacas/applications/txtexo/rdeb1.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 RDEB1 (NTXT, IELB, NUMELB, NUMLNK, NUMATR,
9 & LINK, ATRIB, natrdm, *)
10 C=======================================================================
11
12 C --*** RDEB1 *** (TXTEXO) Read database element block misc.
13 C -- Written by Amy Gilkey - revised 09/30/87
14 C --
15 C --RDEB1 reads the element block connectivity and attribute information
16 C --from the text file. An error message is displayed if the end of file
17 C --is read.
18 C --
19 C --Parameters:
20 C -- NTXT - IN - the text file
21 C -- IELB - IN - the element block number (for errors)
22 C -- NUMELB - IN - the number of elements in the block
23 C -- NUMLNK - IN - the number of nodes per element
24 C -- NUMATR - IN - the number of attributes
25 C -- LINK - OUT - the element connectivity for this block
26 C -- ATRIB - OUT - the attributes for this block
27 C -- * - return statement if end of file or read error
28 C --
29 C --Database must be positioned at start of element block misc. information
30 C --upon entry; upon exit at end of element block misc. information.
31
32 INTEGER LINK(NUMLNK,*)
33 REAL ATRIB(natrdm, *)
34
35 CHARACTER*32 STRA, STRB
36
37 NE = 0
38 READ (NTXT, *, END=120, ERR=120)
39 DO 100 NE = 1, NUMELB
40 READ (NTXT, *, END=120, ERR=120) (LINK(I,NE), I=1,NUMLNK)
41 100 CONTINUE
42
43 IF (NUMATR .GT. 0) THEN
44 NE = 0
45 READ (NTXT, *, END=130, ERR=130)
46 DO 110 NE = 1, NUMELB
47 READ (NTXT, *, END=130, ERR=130) (ATRIB(I,NE), I=1,NUMATR)
48 110 CONTINUE
49 END IF
50
51 RETURN
52
53 120 CONTINUE
54 CALL INTSTR (1, 0, NE, STRA, LSTRA)
55 CALL INTSTR (1, 0, IELB, STRB, LSTRB)
56 CALL PRTERR ('FATAL',
57 & 'Reading NODES for element ' // STRA(:LSTRA)
58 & // ' for BLOCK ' // STRB(:LSTRB))
59 GOTO 140
60 130 CONTINUE
61 CALL INTSTR (1, 0, NE, STRA, LSTRA)
62 CALL INTSTR (1, 0, IELB, STRB, LSTRB)
63 CALL PRTERR ('FATAL',
64 & 'Reading ATTRIBUTES for element ' // STRA(:LSTRA)
65 & // ' for BLOCK ' // STRB(:LSTRB))
66 GOTO 140
67 140 CONTINUE
68 RETURN 1
69 END