Debian Codegraph @

packages/seacas/applications/gen3d/g3_wrnps.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 WRNPS (A, IA, IDFRO, IDBCK,
9 & IDNPS, NNNP3, IXNNP3, LTNNP3, FACNP3,
10 & IXNP, NRNP, *)
11 C=======================================================================
12
13 C --*** WRNPS *** (GEN3D) Write 3D node sets
14 C -- Written by Amy Gilkey - revised 05/05/86
15 C --
16 C --WRNPS writes the node set information for the 3D database.
17 C --Calculations have been done elsewhere.
18 C --
19 C --Parameters:
20 C -- IDFRO - IN - ids for front surface node sets; (0) = length
21 C -- IDBCK - IN - ids for back surface node sets; (0) = length
22 C -- IDNPS - IN - the 2D node sets ids
23 C -- NNNP3 - IN - the number of nodes for each 3D set
24 C -- IXNNP3 - IN - the index of the first node for each 3D set
25 C -- LTNNP3 - IN - the nodes for all 3D sets
26 C -- FACNP3 - IN - the distribution factors for all 3D sets
27 C -- IXNP - IN - the new index for each node
28 C -- NRNP - IN - the number of new nodes generated for each node
29 C --
30 C --Common Variables:
31 C -- Uses NDBOUT of /DBASE/
32 C -- Uses NUMNPS, LNPSNL of /DBNUMS/
33 C -- Uses LNPSNO of /DBNUM3/
34
35 INCLUDE 'exodusII.inc'
36 INCLUDE 'g3_dbase.blk'
37 INCLUDE 'g3_dbnums.blk'
38 INCLUDE 'g3_dbnum3.blk'
39
40 REAL A(*)
41 INTEGER IA(*)
42 INTEGER IDFRO(0:*)
43 INTEGER IDBCK(0:*)
44 INTEGER IDNPS(*)
45 INTEGER NNNP3(*)
46 INTEGER IXNNP3(*)
47 INTEGER LTNNP3(*)
48 REAL FACNP3(*)
49 INTEGER IXNP(*), NRNP(*)
50
51 LOGICAL ANYNPS
52
53 NFRO = IDFRO(0)
54 NBCK = IDBCK(0)
55 ANYNPS = (NFRO .GT. 0) .OR. (NBCK .GT. 0) .OR. (NUMNPS .GT. 0)
56
57 C --Write 3D
58
59 call expnp (exoid, 20, 5, 5, ierr)
60 call expns (exoid, 20, node_list, ierr)
61 call expnsd (exoid, 20, dist_fact, ierr)
62 IF (ANYNPS) THEN
63 C ... Output nodeset id, number nodes, number dist factors
64 C Assumes that there are the same number of distribution factors
65 C as there are nodes in the nodeset.
66 DO 10 ins = 1, numnps
67 call expnp (ndbout, idnps(ins), nnnp3(ins), nnnp3(ins), ierr)
68 if (ierr .lt. 0) then
69 call exerr('gen3d2', 'Error from expnp', exlmsg)
70 go to 50
71 endif
72 call expns (ndbout, idnps(ins), LTNNP3(IXNNP3(ins)), ierr)
73 if (ierr .lt. 0) then
74 call exerr('gen3d2', 'Error from expns', exlmsg)
75 go to 50
76 endif
77 call expnsd(ndbout, idnps(ins), FACNP3(IXNNP3(ins)), ierr)
78 if (ierr .lt. 0) then
79 call exerr('gen3d2', 'Error from expnsd', exlmsg)
80 go to 50
81 endif
82 10 continue
83 C ... Output front and back nodesets (if any)
84 C Front and back nodesets contain NUMNP (2D database) nodes
85 C If there are any front or back, then create a temporary
86 C Array to hold the distribution factors. Defaulted to 1.0
87 if (nfro .gt. 0 .or. nbck .gt. 0) then
88 call mdrsrv('factorns', knfac, numnp)
89 call mdstat(mnerrs, mnused)
90 if (mnerrs .gt. 0) goto 50
91 call inirea(numnp, 1.0, a(knfac))
92
93 do 20 ins = 1, nfro
94 call expnp (ndbout, idfro(ins), numnp, numnp, ierr)
95 if (ierr .lt. 0) then
96 call exerr('gen3d2', 'Error from expnp', exlmsg)
97 go to 50
98 endif
99 call expns (ndbout, idfro(ins), IXNP, ierr)
100 if (ierr .lt. 0) then
101 call exerr('gen3d2', 'Error from expns', exlmsg)
102 go to 50
103 endif
104 call expnsd(ndbout, idfro(ins), a(knfac), ierr)
105 if (ierr .lt. 0) then
106 call exerr('gen3d2', 'Error from expnsd', exlmsg)
107 go to 50
108 endif
109 20 continue
110 if (nbck .gt. 0) then
111 call mdrsrv('nodelist', knlst, numnp)
112 call mdstat(mnerrs, mnused)
113 if (mnerrs .gt. 0) goto 50
114
115 do 30 i=1, numnp
116 ia(knlst+i-1) = ixnp(i) + nrnp(i) - 1
117 30 continue
118
119 do 40 ins = 1, nbck
120 call expnp (ndbout, idbck(ins), numnp, numnp, ierr)
121 if (ierr .lt. 0) then
122 call exerr('gen3d2', 'Error from expnp', exlmsg)
123 go to 50
124 endif
125 call expns (ndbout, idbck(ins), ia(knlst), ierr)
126 if (ierr .lt. 0) then
127 call exerr('gen3d2', 'Error from expns', exlmsg)
128 go to 50
129 endif
130 call expnsd(ndbout, idbck(ins), a(knfac), ierr)
131 if (ierr .lt. 0) then
132 call exerr('gen3d2', 'Error from expnsd', exlmsg)
133 go to 50
134 endif
135 40 continue
136 end if
137 end if
138 end if
139
140 if (nfro .gt. 0 .or. nbck .gt. 0) then
141 call mddel('factorns')
142 if (nbck .gt. 0) then
143 call mddel('nodelist')
144 end if
145 end if
146 call mdstat(mnerrs, mnused)
147 if (mnerrs .gt. 0) goto 50
148 RETURN
149
150 50 continue
151 RETURN 1
152 END