Debian Codegraph @

packages/seacas/applications/genshell/gs_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, NNNPS, IXNNPS, LTNNPS, FACNPS, *)
10 C=======================================================================
11
12 C --*** WRNPS *** (GENSHELL) Write 3D node sets
13 C --
14 C --WRNPS writes the node set information for the 3D database.
15 C --Calculations have been done elsewhere.
16 C --
17 C --Parameters:
18 C -- IDFRO - IN - ids for front surface node sets; (0) = length
19 C -- IDBCK - IN - ids for back surface node sets; (0) = length
20 C -- IDNPS - IN - the 2D node sets ids
21 C -- NNNPS - IN - the number of nodes for each 3D set
22 C -- IXNNPS - IN - the index of the first node for each 3D set
23 C -- LTNNPS - IN - the nodes for all 3D sets
24 C -- FACNPS - IN - the distribution factors for all 3D sets
25 C --
26 C --Common Variables:
27 C -- Uses NDBOUT of /DBASE/
28 C -- Uses NUMNPS, LNPSNL of /DBNUMS/
29 C --
30 C --Database must be positioned at start of node set information
31 C --upon entry; upon exit at end of node set information.
32
33 INCLUDE 'exodusII.inc'
34 INCLUDE 'gs_dbase.blk'
35 INCLUDE 'gs_dbnums.blk'
36
37 REAL A(*)
38 INTEGER IA(*)
39 INTEGER IDFRO(0:*)
40 INTEGER IDBCK(0:*)
41 INTEGER IDNPS(*)
42 INTEGER NNNPS(*)
43 INTEGER IXNNPS(*)
44 INTEGER LTNNPS(*)
45 REAL FACNPS(*)
46
47 LOGICAL ANYNPS
48
49 NFRO = IDFRO(0)
50 NBCK = IDBCK(0)
51 ANYNPS = (NFRO .GT. 0) .OR. (NBCK .GT. 0) .OR. (NUMNPS .GT. 0)
52
53 C --Write 3D
54
55 IF (ANYNPS) THEN
56 C ... Output nodeset id, number nodes, number dist factors
57 C Assumes that there are the same number of distribution factors
58 C as there are nodes in the nodeset.
59 DO 10 ins = 1, numnps
60 call expnp (ndbout, idnps(ins), nnnps(ins), nnnps(ins), ierr)
61 call expns (ndbout, idnps(ins), LTNNPS(IXNNPS(ins)), ierr)
62 call expnsd(ndbout, idnps(ins), FACNPS(IXNNPS(ins)), ierr)
63 10 continue
64 C ... Output front and back nodesets (if any)
65 C Front and back nodesets contain NUMNP (2D database) nodes
66 C If there are any front or back, then create a temporary
67 C Array to hold the distribution factors. Defaulted to 1.0
68 if (nfro .gt. 0 .or. nbck .gt. 0) then
69 call mdrsrv('factorns', knfac, numnp)
70 call mdrsrv('nodlst', knl, numnp)
71 call mdstat(mnerrs, mnused)
72 if (mnerrs .gt. 0) goto 50
73 call inirea(numnp, 1.0, a(knfac))
74 do 20 i=1, numnp
75 ia(knl+i-1) = i
76 20 continue
77
78 do 30 ins = 1, nfro
79 call expnp (ndbout, idfro(ins), numnp, numnp, ierr)
80 call expns (ndbout, idfro(ins), ia(knl), ierr)
81 call expnsd(ndbout, idfro(ins), a(knfac), ierr)
82 30 continue
83
84 do 40 ins = 1, nbck
85 call expnp (ndbout, idbck(ins), numnp, numnp, ierr)
86 call expns (ndbout, idbck(ins), ia(knl), ierr)
87 call expnsd(ndbout, idbck(ins), a(knfac), ierr)
88 40 continue
89 call mddel('factorns')
90 call mddel('nodlst')
91 end if
92 end if
93
94 call mdstat(mnerrs, mnused)
95 if (mnerrs .gt. 0) goto 50
96
97 RETURN
98
99 50 continue
100 return 1
101 END