Debian Codegraph @

packages/seacas/applications/grepos/gp_zmess.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 ZMESS (NUMESS, ISTAT, LESSEL, LESSDL, IDESS, NEESS,
9 * NEDSS, IXEESS, IXEDSS, LTEESS, LTSSS, LTSNC, FAC, NAMES)
10 C=======================================================================
11
12 C --*** ZMESS *** (GJOIN) Compress element side sets
13 C -- Written by Amy Gilkey - revised 01/20/88
14 C --
15 C --ZMESS compresses the element side sets by removing deleted elements
16 C --and their nodes. Assumes that the elements and nodes are already
17 C --renumbered and ordered.
18 C --
19 C --Parameters:
20 C -- NUMESS - IN/OUT - the number of element side sets
21 C -- LESSEL - IN/OUT - the length of the element side sets element list
22 C -- IDESS - IN/OUT - the element side set ID for each set
23 C -- NEESS - IN/OUT - the number of elements for each set
24 C -- NEDSS - IN/OUT - the number of dist-fac for each set
25 C -- IXEESS - IN/OUT - the index of the first element for each set
26 C -- IXEDSS - IN/OUT - the index of the first dist-fac for each set
27 C -- LTEESS - IN/OUT - the elements for all sets
28 C -- LTSSS - IN/OUT - the sides for all sets
29 C -- LTSNC - IN/OUT - the face count for each element/side in the list
30 C -- FACESS - IN/OUT - the distribution factors for all sets????????????
31
32 include 'gp_namlen.blk'
33
34 INTEGER ISTAT(*) ! NUMESS
35 INTEGER IDESS(*) ! NUMESS
36 INTEGER NEESS(*) ! NUMESS
37 INTEGER NEDSS(*) ! NUMESS
38 INTEGER IXEESS(*) ! NUMESS
39 INTEGER IXEDSS(*) ! NUMESS
40 INTEGER LTEESS(*) ! LESSEL
41 INTEGER LTSSS(*) ! LESSEL
42 INTEGER LTSNC(*) ! LESSEL
43 REAL FAC(*) ! LESSDL
44 CHARACTER*(maxnam) NAMES(*)
45
46 IF (NUMESS .LE. 0) RETURN
47
48 JESS = 0
49 JNE = 0
50 JDF = 0
51 idfe = 0
52 DO 120 IESS = 1, NUMESS
53 JNELST = JNE
54 JDFLST = JDF
55 nd1 = ixedss(iess) ! Index of First distribution factor for this list
56 IDFB = ND1
57 DO 110 N = 1, NEESS(IESS)
58 C ... N is the 'local' index within the current set.
59 C NE is the 'global' index within the concatenated (LTEESS, LTSSS, LTSNC) lists
60 C ND1 is the FAC index of the first df for the current list.
61 C ICNT is the number of DF for element N in the current list
62 NE = N + IXEESS(IESS) - 1
63 ICNT = LTSNC(NE)
64 C IDFB = index of first df for local element N, global element NE
65 C IDFE = index of last df for local element N, global element NE
66 IDFE = IDFB + ICNT - 1
67 IF (LTEESS(NE) .GT. 0) THEN
68 JNE = JNE + 1
69 LTEESS(JNE) = LTEESS(NE)
70 LTSSS(JNE) = LTSSS(NE)
71 LTSNC(JNE) = LTSNC(NE)
72 do 100 nd = idfb, idfe
73 JDF = JDF + 1
74 fac(JDF) = fac(ND)
75 100 continue
76 END IF
77 IDFB = IDFE + 1
78 110 CONTINUE
79 N = JNE - JNELST
80 IF (N .GT. 0) THEN
81 C ... There is at least 1 element remaining in the list...
82 JESS = JESS + 1 ! increment sideset count
83 IDESS(JESS) = IDESS(IESS) ! copy the sideset id
84 NAMES(JESS) = NAMES(IESS)
85 NEESS(JESS) = N ! Set the elements per list count
86 IXEESS(JESS) = JNELST + 1 ! set the index
87 NEDSS(JESS) = JDF - JDFLST ! set the df per list count
88 IXEDSS(JESS) = JDFLST + 1
89 ELSE
90 ISTAT(IESS) = -IDESS(IESS)
91 END IF
92 120 CONTINUE
93 if (idfe .ne. lessdl) stop 'ZMESS: Internal error'
94 NUMESS = JESS
95 LESSEL = JNE
96 LESSDL = JDF
97 RETURN
98 END