34
36 USE elbufdef_mod
37
38
39
40#include "implicit_f.inc"
41#include "param_c.inc"
42#include "com01_c.inc"
43
44
45
46 INTEGER N_SLIPRING_L,N_RETRACTOR_L,P,IPARG(NPARG,*),NODLOCAL(*),N_ANCHOR_REMOTE_L,
47 . N_ANCHOR_REMOTE_SEND_L,N_SEATBELT_L,N_SEATBELT_2D_L,CEP(*),OFF
48 TYPE(ELBUF_STRUCT_), TARGET, DIMENSION(NGROUP) :: ELBUF_TAB
49 TYPE(SEATBELT_REMOTE_NODES_STRUCT) ANCHOR_REMOTE_L,ANCHOR_REMOTE_SEND_L
50
51
52
53 INTEGER NLOCAL
55
56
57
58 INTEGER I,J,K,NN,PROC,ITY,MTN,NEL,NG,LOCAL_SLIP(NSLIPRING),LOCAL_RETR(NRETRACTOR),PP
59 . N_ANCHOR_REMOTE_SEND,PP,N_REC_PROC(NSPMD),N_SEND_PROC(NSPMD),COMPT,TAG_PROC(2,NSPMD),
60 . ISEATBELT
61 TYPE(G_BUFEL_) , POINTER :: GBUF
62
63
64 local_slip = 0
65 local_retr = 0
66 n_rec_proc = 0
67 n_send_proc = 0
68
69
70
71 DO i = 1, n_seatbelt
74 n_seatbelt_l = n_seatbelt_l + 1
75 IF (
seatbelt_tab(i)%NFRAM > 1) n_seatbelt_2d_l = n_seatbelt_2d_l + 1
76 ENDIF
77 ENDIF
78 ENDDO
79
80 DO i = 1, nslipring
82
84
85 n_slipring_l = n_slipring_l + 1
86 local_slip(i) = n_slipring_l
87 ENDIF
88
91 DO pp=1,nspmd
92 IF ((pp /= p).AND.(
nlocal(
slipring(i)%FRAM(j)%ANCHOR_NODE,pp)==1))
THEN
93
94 n_anchor_remote_send_l = n_anchor_remote_send_l + 1
96 n_send_proc(pp) = n_send_proc(pp) + 1
97 ENDIF
98 ENDDO
100
101 n_anchor_remote_l = n_anchor_remote_l + 1
102 compt = 0
103 DO pp=1,nspmd
104 IF ((pp /= p).AND.(
nlocal(
slipring(i)%FRAM(j)%NODE(2),pp)==1))
THEN
105
106 n_rec_proc(pp) = n_rec_proc(pp) + 1
107 ENDIF
108 ENDDO
109 ENDIF
110 ENDDO
111
112 ENDDO
113
114 DO i = 1, nretractor
117
118 n_retractor_l = n_retractor_l + 1
119 local_retr(i) = n_retractor_l
120 DO pp=1,nspmd
122
123 n_anchor_remote_send_l = n_anchor_remote_send_l + 1
125 n_send_proc(pp) = n_send_proc(pp) + 1
126 ENDIF
127 ENDDO
129
130 n_anchor_remote_l = n_anchor_remote_l + 1
131 DO pp=1,nspmd
133
134 n_rec_proc(pp) = n_rec_proc(pp) + 1
135 ENDIF
136 ENDDO
137 ENDIF
138 ENDDO
139
140
141
142 ALLOCATE(anchor_remote_l%ADD_PROC(nspmd+1))
143 ALLOCATE(anchor_remote_l%NODE(n_anchor_remote_l))
144 compt = 0
145
146 ALLOCATE(anchor_remote_send_l%ADD_PROC(nspmd+1))
147 ALLOCATE(anchor_remote_send_l%NODE(n_anchor_remote_send_l))
148
149 IF (n_anchor_remote_l > 0) THEN
150 anchor_remote_l%ADD_PROC(1) = 1
151 DO pp=1,nspmd
152 anchor_remote_l%ADD_PROC(pp+1) = anchor_remote_l%ADD_PROC(pp) + n_rec_proc(pp)
153 ENDDO
154 ENDIF
155
156 IF (n_anchor_remote_send_l > 0) THEN
157 anchor_remote_send_l%ADD_PROC(1) = 1
158 DO pp=1,nspmd
159 anchor_remote_send_l%ADD_PROC(pp+1) = anchor_remote_send_l%ADD_PROC(pp) + n_send_proc(pp)
160 ENDDO
161 n_send_proc = 0
162 ENDIF
163
164 nn = 0
165
166 DO i = 1, nslipring
169 IF (
slipring(i)%FRAM(j)%N_REMOTE_PROC > 0)
THEN
170
171 nn = nn + 1
172 DO pp=1,nspmd
173 IF ((pp /= p).AND.(
nlocal(
slipring(i)%FRAM(j)%ANCHOR_NODE,pp)==1))
THEN
174
175 anchor_remote_send_l%NODE(anchor_remote_send_l%ADD_PROC(pp)+n_send_proc(pp)) = nn
176 n_send_proc(pp) = n_send_proc(pp) + 1
177 ENDIF
178 ENDDO
179 ENDIF
181
182 compt = compt + 1
183 anchor_remote_l%NODE(compt) = nodlocal(
slipring(i)%FRAM(j)%ANCHOR_NODE)
184 ENDIF
185 ENDDO
186 ENDDO
187
188 DO i = 1, nretractor
191
192 nn = nn + 1
193 DO pp=1,nspmd
195
196 anchor_remote_send_l%NODE(anchor_remote_send_l%ADD_PROC(pp)+n_send_proc(pp)) = nn
197 n_send_proc(pp) = n_send_proc(pp) + 1
198 ENDIF
199 ENDDO
200 ENDIF
202
203 compt = compt + 1
204 anchor_remote_l%NODE(compt) = nodlocal(
retractor(i)%ANCHOR_NODE)
205 ENDIF
206 ENDDO
207
208
209 IF ((nspmd > 1).AND.(p == 1)) THEN
210
212 tag_proc = 0
213
214 DO pp=1,nspmd
215 DO i=1,nslipring
216 IF ((pp /= p).AND.(
nlocal(
slipring(i)%FRAM(1)%NODE(2),pp)==1)) tag_proc(1,pp) = 1
217 ENDDO
218 DO i=1,nretractor
219 IF ((pp /= p).AND.(
nlocal(
retractor(i)%NODE(2),pp)==1)) tag_proc(2,pp) = 1
220 ENDDO
222 ENDDO
223
225
226 compt = 0
228 DO pp=1,nspmd
229 IF (tag_proc(1,pp) + tag_proc(2,pp) > 0) THEN
230 compt = compt + 1
231
235 DO i=1,nslipring
236 IF ((pp /= p).AND.(
nlocal(
slipring(i)%FRAM(1)%NODE(2),pp)==1))
THEN
239 ENDIF
240 ENDDO
241 DO i=1,nretractor
245 ENDIF
246 ENDDO
247 ENDIF
248 ENDDO
249
250 ENDIF
251
252
253
254
255 IF (n_slipring_l + n_retractor_l > 0) THEN
256
257 DO ng=1,ngroup
258
259 proc = iparg(32,ng)
260 ity = iparg(5,ng)
261 mtn = iparg(1,ng)
262 nel = iparg(2,ng)
263 iseatbelt = iparg(91,ng)
264
265 IF ((p == proc + 1).AND.(ity==6).AND.(mtn==114)) THEN
266 gbuf => elbuf_tab(ng)%GBUF
267 DO i=1,nel
268 IF (gbuf%ADD_NODE(i) > 0) gbuf%ADD_NODE(i) = nodlocal(gbuf%ADD_NODE(i))
269 IF (gbuf%ADD_NODE(nel+i) > 0) gbuf%ADD_NODE(nel+i) = nodlocal(gbuf%ADD_NODE(nel+i))
270 IF (gbuf%SLIPRING_ID(i) > 0) gbuf%SLIPRING_ID(i) = local_slip(gbuf%SLIPRING_ID(i))
271 IF (gbuf%RETRACTOR_ID(i) > 0) gbuf%RETRACTOR_ID(i) = local_retr(gbuf%RETRACTOR_ID(i))
272 ENDDO
273
274 ELSEIF ((p == proc + 1).AND.(ity==3).AND.(iseatbelt==1)) THEN
275 gbuf => elbuf_tab(ng)%GBUF
276 DO i=1,nel
277 DO j=1,gbuf%G_ADD_NODE
278 k = nel*(j-1)
279 IF (gbuf%ADD_NODE(k+i) > 0) gbuf%ADD_NODE(k+i) = nodlocal(gbuf%ADD_NODE(k+i))
280 ENDDO
281 ENDDO
282
283 ENDIF
284
285 ENDDO
286
287 ENDIF
288
289
290 RETURN
integer nseatbelt_th_proc
type(retractor_struct), dimension(:), allocatable retractor
type(seatbelt_struct), dimension(:), allocatable seatbelt_tab
type(seatbelt_th_exch_struct), dimension(:), allocatable seatbelt_th_exch
type(slipring_struct), dimension(:), allocatable slipring