Debian Codegraph @

packages/seacas/applications/txtexo/rdnps.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 RDNPS (NTXT, NUMNPS, LNPSNL, LNPSDF,
9 & IDNPS, NNNPS, NDNPS, IXNNPS, IXDNPS, LSTNPS, FACNPS, *)
10 C=======================================================================
11
12 C --*** RDNPS *** (TXTEXO) Read database node sets
13 C -- Written by Amy Gilkey - revised 02/27/86
14 C --
15 C --RDNPS reads the node set information from the text file.
16 C --An error message is displayed if the end of file is read.
17 C --
18 C --Parameters:
19 C -- NTXT - IN - the text file
20 C -- NUMNPS - IN - the number of node sets
21 C -- LNPSNL - IN - the length of the node sets node list
22 C -- IDNPS - OUT - the node set ID for each set
23 C -- NNNPS - OUT - the number of nodes for each set
24 C -- IXNNPS - OUT - the index of the first node for each set
25 C -- LSTNPS - OUT - the nodes for all sets
26 C -- FACNPS - OUT - the distribution factors for all sets
27 C -- * - return statement if end of file or read error
28 C --
29 C --Database must be positioned at start of node set information
30 C --upon entry; upon exit at end of node set information.
31
32 INTEGER IDNPS(*)
33 INTEGER NNNPS(*)
34 INTEGER NDNPS(*)
35 INTEGER IXNNPS(*)
36 INTEGER IXDNPS(*)
37 INTEGER LSTNPS(*)
38 REAL FACNPS(*)
39
40 CHARACTER*32 STRA, STRB
41
42 NN = 0
43 ND = 0
44 READ (NTXT, *, END=120, ERR=120)
45 READ (NTXT, *, END=120, ERR=120)
46 READ (NTXT, *, END=120, ERR=120)
47 DO INPS = 1, NUMNPS
48 READ (NTXT, *, END=120, ERR=120)
49 READ (NTXT, *, END=120, ERR=120) IDNPS(INPS), NNNPS(INPS),
50 & NDNPS(INPS)
51
52 IXNNPS(INPS) = NN + 1
53 NN = NN + NNNPS(INPS)
54
55 IXDNPS(INPS) = ND + 1
56 ND = ND + NDNPS(INPS)
57
58 if (NDNPS(INPS) .NE. 0) THEN
59 C ... Node set has distribution factors
60 IND = IXDNPS(INPS)
61 DO NL = IXNNPS(INPS), NN
62 READ (NTXT, *, END=130, ERR=130) LSTNPS(NL), FACNPS(IND)
63 IND = IND + 1
64 end do
65 else
66 C ... Node set doesn't have distribution factors
67 DO NL = IXNNPS(INPS), NN
68 READ (NTXT, *, END=130, ERR=130) LSTNPS(NL)
69 end do
70 endif
71 end do
72
73 IF (NN .NE. LNPSNL) THEN
74 CALL INTSTR (1, 0, NN, STRA, LSTRA)
75 CALL INTSTR (1, 0, LNPSNL, STRB, LSTRB)
76 CALL PRTERR ('WARNING',
77 & 'NODE SET NUMBER OF NODES = ' // STRA(:LSTRA)
78 & // ' does not match TOTAL = ' // STRB(:LSTRB))
79 END IF
80
81 RETURN
82
83 120 CONTINUE
84 CALL INTSTR (1, 0, INPS, STRA, LSTRA)
85 CALL PRTERR ('FATAL',
86 & 'Reading HEADER DATA for NODE SET ' // STRA(:LSTRA))
87 GOTO 140
88 130 CONTINUE
89 CALL INTSTR (1, 0, NL-IXNNPS(INPS)+1, STRA, LSTRA)
90 CALL INTSTR (1, 0, INPS, STRB, LSTRB)
91 CALL PRTERR ('FATAL',
92 & 'Reading NODES and FACTORS for node ' // STRA(:LSTRA)
93 & // ' for NODE SET ' // STRB(:LSTRB))
94 GOTO 140
95 140 CONTINUE
96 RETURN 1
97 END