36
37
38
39
40
41
42#include "implicit_f.inc"
43
44
45
46#include "com01_c.inc"
47#include "com04_c.inc"
48
49
50
51 INTEGER NLOCAL
53
54
55
56 INTEGER IELC_L(*),IELTG_L(*),IEDGECRK_L(*),NUMEDGES,
57 . IEDGESH4(4,*),IEDGESH3(3,*),CEP(*),P,IBORDEDGE(*),
58 . IBORDEDGE_L(*),NUMEDGES_L,NODEDGE(2,*),NODEDGE_L(2,*),
59 . NODLOCAL(*),IEDGESH4_L(4,*),IEDGESH3_L(3,*),IEL_CRK(*),
60 . IEDGE_L(*),IEDGE(*),ECRKXFEC,EDGELOCAL(*),
61 . NBDDEDGE_L,IEDGE_TMP(3,*),EDGEGLOBAL(*)
62
63
64
65 INTEGER I,K,OFFC,OFFTG,IED_L,IED_GL,NEXT,IEL_L,IC1,IC2,JCRK,
66 . IEL_L1,PROC,EDGEPROC
67 INTEGER,DIMENSION(:),ALLOCATABLE :: ITAG_EDGE
68
69 offc = numels + numelq
70 offtg = offc + numelc + numelt + numelp + numelr
71
72 ALLOCATE(itag_edge(numedges))
73 itag_edge = 0
74
75 next = 0
76 iel_l = 0
77 ied_l = 0
78 iel_l1 = 0
79
80
81
82
83
84
85 DO i=1,numelc
86 IF (cep(i+offc) == p) THEN
87 iel_l1 = iel_l1 + 1
88 IF (iel_crk(i) > 0) THEN
89 iel_l = iel_l + 1
90
91 jcrk = iel_crk(i)
92 DO k=1,4
93 ied_gl = iedgesh4(k,jcrk)
94 IF (ied_gl > 0) THEN
95 IF (itag_edge(ied_gl) == 0) THEN
96 ied_l = ied_l + 1
97
98 ibordedge_l(ied_l) = ibordedge(ied_gl)
99 edgeglobal(ied_l) = ied_gl
100 edgelocal(ied_gl) = ied_l
101 itag_edge(ied_gl) = 1
102
103 ic1 = nodedge(1,ied_gl)
104 ic2 = nodedge(2,ied_gl)
105 ic1 = nodlocal(ic1)
106 ic2 = nodlocal(ic2)
107 nodedge_l(1,ied_l) = ic1
108 nodedge_l(2,ied_l) = ic2
109
110 iedge_l(ied_l) = iedge(ied_gl)
111 ENDIF
112
113 iedgesh4_l(k,iel_l) = edgelocal(ied_gl)
114
115 iedgecrk_l(k + next) = edgelocal(ied_gl)
116 ENDIF
117 ENDDO
118 next = next + 4
119 ENDIF
120 ENDIF
121 ENDDO
122
123
124
125 iel_l = 0
126 iel_l1 = 0
127 DO i=1,numeltg
128 IF(cep(i+offtg) == p)THEN
129 iel_l1 = iel_l1 + 1
130 IF(iel_crk(i+numelc) > 0)THEN
131 iel_l = iel_l + 1
132
133 jcrk = iel_crk(i+numelc) - ecrkxfec
134 DO k=1,3
135 ied_gl = iedgesh3(k,jcrk)
136 IF(ied_gl /= 0)THEN
137 IF(itag_edge(ied_gl) == 0)THEN
138 ied_l = ied_l + 1
139
140 ibordedge_l(ied_l) = ibordedge(ied_gl)
141 edgeglobal(ied_l) = ied_gl
142 edgelocal(ied_gl) = ied_l
143 itag_edge(ied_gl) = 1
144
145 ic1 = nodedge(1,ied_gl)
146 ic2 = nodedge(2,ied_gl)
147 ic1 = nodlocal(ic1)
148 ic2 = nodlocal(ic2)
149 nodedge_l(1,ied_l) = ic1
150 nodedge_l(2,ied_l) = ic2
151
152 iedge_l(ied_l) = iedge(ied_gl)
153 ENDIF
154
155 iedgesh3_l(k,iel_l) = edgelocal(ied_gl)
156
157 iedgecrk_l(k + next) = edgelocal(ied_gl)
158 ENDIF
159 ENDDO
160 next = next + 3
161 ENDIF
162 ENDIF
163 ENDDO
164
165
166
167
168
169
170 proc = p+1
171 DO ied_gl=1,numedges
172
173 IF (iedge_tmp(3,ied_gl) < 0) THEN
174 ic1 = nodedge(1,ied_gl)
175 ic2 = nodedge(2,ied_gl)
176
177 IF((
nlocal(ic1,proc)==1).AND.
178 . (
nlocal(ic2,proc)==1))
THEN
179 DO i = 1,nspmd
180 edgeproc = 0
181 IF(i/=proc)THEN
184 nbddedge_l = nbddedge_l + 1
185
186 IF(iedge_tmp(2,ied_gl) == 0)THEN
187 edgeproc = edgeproc + 1
188 iedge_tmp(1,ied_gl) = edgeproc
189 iedge_tmp(2,ied_gl) = 1
190
191 ENDIF
192
193 ENDIF
194 ENDIF
195 ENDDO
196 END IF
197 ENDIF
198 ENDDO
199
200 DEALLOCATE(itag_edge)
201
202 RETURN