Debian Codegraph @

packages/seacas/applications/explore/exp_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 C=======================================================================
7 SUBROUTINE RDNPS (NDB, NUMNPS, LNPSNL, IDNPS, NNNPS, NDNPS,
8 $ IXNNPS, IXDNPS, LTNNPS, FACNPS, NAME, ISEOF, NAMLEN)
9 C=======================================================================
10
11 C --*** RDNPS *** (EXPLORE) Read database nodal point sets
12 C --
13 C --RDNPS reads the nodal point set information from the database.
14 C --An error message is displayed if the end of file is read.
15 C --
16 C --Parameters:
17 C -- NDB - IN - the database file
18 C -- NUMNPS - IN - the number of nodal points sets
19 C -- LNPSNL - IN - the length of the nodal point sets node list
20 C -- IDNPS - OUT - the nodal point set ID for each set
21 C -- NNNPS - OUT - the number of nodes for each set
22 C -- NDNPS - OUT - the number of distribution factors for each set
23 C -- IXNNPS - OUT - the index of the first node for each set
24 C -- IXDNPS - OUT - the index of the first dist factor for each set
25 C -- LTNNPS - OUT - the nodes for all sets
26 C -- FACNPS - OUT - the distribution factors for all sets
27 C -- ISEOF - IN/OUT - set true if end of file read
28 C --
29 C --Database must be positioned at start of nodal point set information
30 C --upon entry; upon exit at end of nodal point set information.
31
32 include 'exodusII.inc'
33 INTEGER IDNPS(*)
34 integer NNNPS(*)
35 INTEGER NDNPS(*)
36 INTEGER IXNNPS(*)
37 INTEGER IXDNPS(*)
38 INTEGER LTNNPS(*)
39 REAL FACNPS(*)
40 CHARACTER*(NAMLEN) NAME(*)
41 LOGICAL ISEOF
42
43 CHARACTER*80 ERRMSG
44 CHARACTER*32 STRA
45
46 CALL INIINT (NUMNPS, 0, IDNPS)
47 CALL INIINT (NUMNPS, 0, NNNPS)
48 CALL INIINT (NUMNPS, 0, NDNPS)
49 CALL INIINT (NUMNPS, 0, IXNNPS)
50 CALL INIINT (NUMNPS, 0, IXDNPS)
51 CALL INIINT (LNPSNL, 0, LTNNPS)
52 CALL INIREA (LNPSNL, 0.0, FACNPS)
53
54 if (numnps .le. 0) return
55
56 C ... Read nodeset ids for all sets
57 call exgnsi (ndb, idnps, ierr)
58 if (ierr .ne. 0) go to 100
59
60 c ... Check that all ids are unique
61 do 80 i = 1, numnps
62 if (locint (idnps(i), i-1, idnps) .gt. 0) then
63 call intstr (1, 0, idnps(i), stra, lstra)
64 call prterr ('CMDERR',
65 & 'nodeset id ' // stra(:lstra) // ' is not unique')
66 end if
67 80 continue
68
69 C ... Read nodeset parameters
70 iens = 1
71 ieds = 1
72 do 90 i = 1, numnps
73 call exgnp (ndb, idnps(i), nnnps(i), ndnps(i), ierr)
74 if (ierr .ne. 0) go to 110
75 if (nnnps(i) .ne. ndnps(i) .and. ndnps(i) .ne. 0) then
76 WRITE (ERRMSG, 10000)
77 & 'Number of nodes does not match number of dist factors',
78 & i
79 CALL SQZSTR(ERRMSG, LSTR)
80 CALL PRTERR('WARNING', ERRMSG(:LSTR))
81 end if
82
83 ixnnps(i) = iens
84 ixdnps(i) = ieds
85
86 if (nnnps(i) .gt. 0) then
87 call exgns (ndb, idnps(i), ltnnps(iens), ierr)
88 if (ierr .ne. 0) go to 130
89 if (ndnps(i) .gt. 0) then
90 call exgnsd (ndb, idnps(i), facnps(ieds), ierr)
91 if (ierr .ne. 0) go to 140
92 end if
93 end if
94
95 iens = iens + nnnps(i)
96 ieds = ieds + ndnps(i)
97 90 continue
98
99 C ... Read names (if they exist)
100 CALL EXGNAMS(NDB, EXNSET, numnps, name, ierr)
101 RETURN
102
103 100 CONTINUE
104 WRITE (ERRMSG, 10000) 'IDS of nodal point sets'
105 GOTO 170
106 110 CONTINUE
107 WRITE (ERRMSG, 10000) 'nodal point set PARAMETERS'
108 GOTO 170
109 130 CONTINUE
110 WRITE (ERRMSG, 10000) 'Nodal point sets NODES'
111 GOTO 170
112 140 CONTINUE
113 WRITE (ERRMSG, 10000) 'Nodal point sets FACTORS'
114 GOTO 170
115 170 CONTINUE
116 CALL WDBERR (IERR, ERRMSG)
117 ISEOF = .TRUE.
118
119 10000 FORMAT (A,' in nodeset ', I12)
120 END