Debian Codegraph @

packages/seacas/applications/txtexo/rdess.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 RDESS (NTXT, NUMESS, LESSEL, LESSNL, LESSDF,
9 & IDESS, NEESS, NNESS, NDESS, IXEESS, IXDESS, LTEESS, LTSESS,
10 * FACESS, *)
11 C=======================================================================
12
13 C --*** RDESS *** (TXTEXO) Read database side sets
14 C -- Written by Amy Gilkey - revised 02/27/86
15 C --
16 C --RDESS reads the side set information from the text file.
17 C --An error message is displayed if the end of file is read.
18 C --
19 C --Parameters:
20 C -- NTXT - IN - the text file
21 C -- NUMESS - IN - the number of side sets
22 C -- LESSEL - IN - the length of the side sets element list
23 C -- LESSNL - IN - the length of the side sets node list
24 C -- IDESS - OUT - the side set ID for each set
25 C -- NEESS - OUT - the number of elements for each set
26 C -- NNESS - OUT - the number of nodes for each set
27 C -- NDESS - OUT - the number of dist factors for each set
28 C -- IXEESS - OUT - the index of the first element for each set
29 C -- IXDESS - OUT - the index of the first node for each set
30 C -- LTEESS - OUT - the elements for all sets
31 C -- LTSESS - OUT - the element sides for all sets
32 C -- FACESS - OUT - the distribution factors for all sets
33 C -- * - return statement if end of file or read error
34 C --
35 C --Database must be positioned at start of side set information
36 C --upon entry; upon exit at end of side set information.
37
38 INTEGER IDESS(*)
39 INTEGER NEESS(*)
40 INTEGER NNESS(*)
41 INTEGER NDESS(*)
42 INTEGER IXEESS(*)
43 INTEGER IXDESS(*)
44 INTEGER LTEESS(*)
45 INTEGER LTSESS(*)
46 REAL FACESS(*)
47
48 CHARACTER*32 STRA, STRB
49
50 C ... Skip comment records
51 READ (NTXT, *, END=120, ERR=120)
52 READ (NTXT, *, END=120, ERR=120)
53
54 NE = 0
55 NN = 0
56 ND = 0
57 DO 110 IESS = 1, NUMESS
58 READ (NTXT, *, END=120, ERR=120) IDESS(IESS), NEESS(IESS),
59 & NNESS(IESS), NDESS(IESS)
60 C ... Skip comment record
61 READ (NTXT, *, END=120, ERR=120)
62
63 IXEESS(IESS) = NE + 1
64 NE = NE + NEESS(IESS)
65 if (neess(iess) .gt. 0) then
66 READ (NTXT, *, END=130, ERR=130)
67 & (LTEESS(NL), LTSESS(NL), NL=IXEESS(IESS), NE)
68 end if
69
70 C ... Skip comment record
71 READ (NTXT, *, END=120, ERR=120)
72 IXDESS(IESS) = ND + 1
73 ND = ND + NDESS(IESS)
74 NN = NN + NNESS(IESS)
75 DO 100 NL = IXDESS(IESS), ND
76 READ (NTXT, *, END=140, ERR=140) LTNESS, FACESS(NL)
77 100 CONTINUE
78 110 CONTINUE
79
80 IF (NE .NE. LESSEL) THEN
81 CALL INTSTR (1, 0, NE, STRA, LSTRA)
82 CALL INTSTR (1, 0, LESSEL, STRB, LSTRB)
83 CALL PRTERR ('WARNING',
84 & 'SIDE SETS NUMBER OF ELEMENTS = ' // STRA(:LSTRA)
85 & // ' does not match TOTAL = ' // STRB(:LSTRB))
86 END IF
87
88 IF (NN .NE. LESSNL) THEN
89 CALL INTSTR (1, 0, NN, STRA, LSTRA)
90 CALL INTSTR (1, 0, LESSNL, STRB, LSTRB)
91 CALL PRTERR ('WARNING',
92 & 'SIDE SETS NUMBER OF NODES = ' // STRA(:LSTRA)
93 & // ' does not match TOTAL = ' // STRB(:LSTRB))
94 END IF
95
96 IF (ND .NE. LESSDF) THEN
97 CALL INTSTR (1, 0, ND, STRA, LSTRA)
98 CALL INTSTR (1, 0, LESSDF, STRB, LSTRB)
99 CALL PRTERR ('WARNING',
100 & 'SIDE SETS DISTRIBUTION FACTOR COUNT = ' // STRA(:LSTRA)
101 & // ' does not match TOTAL = ' // STRB(:LSTRB))
102 END IF
103
104 RETURN
105
106 120 CONTINUE
107 CALL INTSTR (1, 0, IESS, STRA, LSTRA)
108 CALL PRTERR ('FATAL',
109 & 'Reading HEADER DATA for SIDE SET ' // STRA(:LSTRA))
110 GOTO 150
111 130 CONTINUE
112 CALL INTSTR (1, 0, IESS, STRA, LSTRA)
113 CALL PRTERR ('FATAL',
114 & 'Reading ELEMENTS for SIDE SET ' // STRA(:LSTRA))
115 GOTO 150
116 140 CONTINUE
117 CALL INTSTR (1, 0, NL-IXDESS(IESS)+1, STRA, LSTRA)
118 CALL INTSTR (1, 0, IESS, STRB, LSTRB)
119 CALL PRTERR ('FATAL',
120 & 'Reading NODES and FACTORS for node ' // STRA(:LSTRA)
121 & // ' for SIDE SET ' // STRB(:LSTRB))
122 GOTO 150
123 150 CONTINUE
124 RETURN 1
125 END