Debian Codegraph @

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