34 2 IXTG ,X ,NODCUT,RWBUF,NPRW,
36 use element_mod ,
only : nixs,nixc,nixtg
40#include "implicit_f.inc"
52 INTEGER NESBW,NSTRF(*),IXC(NIXC,*),IXTG(NIXTG,*),
53 . NODCUT,NPRW(*), IXS(NIXS,*),BUF,NODGLOB(*)
55 . x(3,*),rwbuf(nrwlp,*)
59 INTEGER J, JJ, LEN, I, K, L, KK, K0, K5, K9, N,
60 . N0, N1, N2, N3, N4, N10, NSEG, NSEGC, NSEGTG, ITYP,
61 . unpack(15,4), ii(8), n5, n6, n7, n8, nsegs, k3,ow,
64 . xx1, yy1, zz1, xx2, yy2, zz2, xx3, yy3, zz3,
65 . xx4, yy4, zz4, d13, xxc, yyc, zzc
66 INTEGER POWER2(8),IPACK
68 INTEGER :: MODE,SIZE_BUFFER_S,SIZE_BUFFER00_R
69 INTEGER,
DIMENSION(NSPMD) :: SHIFT_R,NB_ELEM_R
70 INTEGER,
DIMENSION(NSECT,3,NSPMD) :: SHIFT_SECT
71 INTEGER,
DIMENSION(NSECT+1,3) ::SINDEX
72 INTEGER,
DIMENSION(NSECT+1,3,NSPMD) :: RINDEX_PROC
73 INTEGER,
DIMENSION(:),
ALLOCATABLE :: BUFFER_S
74 INTEGER,
DIMENSION(:),
ALLOCATABLE ::
76 DATA power2/1,2,4,8,16,32,64,128/
78 DATA unpack/1,2,1,3,1,2,1,4,1,2,1,3,1,2,1,
79 . 0,0,2,0,3,3,2,0,4,4,2,4,3,3,2,
80 . 0,0,0,0,0,0,3,0,0,0,4,0,4,4,3,
81 . 0,0,0,0,0,0,0,0,0,0,0,0,0,0,4/
140 sindex(1:nsect+1,1:3) = 0
142 IF(ispmd==0) rindex_proc(1:nsect,1:3,1:nspmd) = 0
148 n0 = numnod + nodcut + i - 1
149 k5=k0+30+nstrf(k0+14)+nstrf(k0+6)
150 1 + 2*nstrf(k0+7) +nstrf(k0+8)*2
159 IF(nstrf(kk+1)/=0)
THEN
164 k9 = k5+2*nstrf(k0+9) +2*nstrf(k0+10)
165 1 +2*nstrf(k0+11)+2*nstrf(k0+12)
166 nsegtg = nstrf(k0+13)
173 IF(nstrf(kk+1)/=0)
THEN
179 k3=k0+30+nstrf(k0+14)+nstrf(k0+6)
203 ii(1)=nodglob(ixs(2,n))-1
204 ii(2)=nodglob(ixs(3,n))-1
205 ii(3)=nodglob(ixs(4,n))-1
206 ii(4)=nodglob(ixs(5,n))-1
207 ii(5)=nodglob(ixs(6,n))-1
208 ii(6)=nodglob(ixs(7,n))-1
209 ii(7)=nodglob(ixs(8,n))-1
210 ii(8)=nodglob(ixs(9,n))-1
213 IF( ii(2)==ii(1).AND.ii(4)==ii(3)
214 . .AND.ii(8)==ii(5).AND.ii(7)==ii(6))
THEN
216 n1=mod(ipack/power2(1),2)
217 n2=mod(ipack/power2(3),2)
218 n3=mod(ipack/power2(5),2)
219 n4=mod(ipack/power2(6),2)
220 IF(n1/=0.AND.n2/=0.AND.n3/=0)
THEN
223 IF(n1/=0.AND.n2/=0.AND.n4/=0)
THEN
226 IF(n2/=0.AND.n3/=0.AND.n4/=0)
THEN
229 IF(n3/=0.AND.n1/=0.AND.n4/=0)
THEN
234 n1=mod(ipack/power2(1),2)
235 n2=mod(ipack/power2(2),2)
236 n3=mod(ipack/power2(3),2)
237 n4=mod(ipack/power2(4),2)
238 n5=mod(ipack/power2(5),2)
239 n6=mod(ipack/power2(6),2)
240 n7=mod(ipack/power2(7),2)
241 n8=mod(ipack/power2(8),2)
242 IF(n1/=0.AND.n2/=0.AND.n3/=0.AND.n4/=0)
THEN
245 IF(n5/=0.AND.n6/=0.AND.n7/=0.AND.n8/=0)
THEN
248 IF(n1/=0.AND.n5/=0.AND.n6/=0.AND.n2/=0)
THEN
251 IF(n4/=0.AND.n8/=0.AND.n7/=0.AND.n3/=0)
THEN
254 IF(n1/=0.AND.n4/=0.AND.n8/=0.AND.n5/=0)
THEN
257 IF(n2/=0.AND.n3/=0.AND.n7/=0.AND.n6/=0)
THEN
268 sindex(nsect+1,1:3) = size_buffer_s
273 ALLOCATE( buffer_s(size_buffer_s) )
276 ALLOCATE( buffer00_r(0) )
279 CALL spmd_gather_wa(mode,size_buffer_s,size_buffer00_r,sindex,rindex_proc,
280 1 buffer_s,buffer00_r,shift_r,nb_elem_r)
282 size_buffer00_r = size_buffer_s
285 rindex_proc(1:nsect,1:3,1) = sindex(1:nsect,1:3)
289 DEALLOCATE( buffer00_r )
290 ALLOCATE( buffer00_r(size_buffer00_r) )
299 n0 = numnod + nodcut + i - 1
300 k5=k0+30+nstrf(k0+14)+nstrf(k0+6)
301 1 + 2*nstrf(k0+7) +nstrf(k0+8)*2
307 IF(nstrf(kk+1)/=0)
THEN
308 n1 = unpack(nstrf(kk+1),1)
309 n2 = unpack(nstrf(kk+1),2)
314 n3 = unpack(nstrf(kk+1),3)
319 buffer_s(jj+2) = ixc(1+n1,n)-1
320 buffer_s(jj+3) = ixc(1+n2,n)-1
321 buffer_s(jj+4) = ixc(1+n3,n)-1
324 buffer_s(jj+1) = numnodg + nodcut + i - 1
325 buffer_s(jj+2) = nodglob(ixc(1+n1,n))-1
326 buffer_s(jj+3) = nodglob(ixc(1+n2,n))-1
327 buffer_s(jj+4) = nodglob(ixc(1+n3,n))-1
333 k9=k5+2*nstrf(k0+9) +2*nstrf(k0+10)
334 1 + 2*nstrf(k0+11)+2*nstrf(k0+12)
335 nsegtg = nstrf(k0+13)
339 IF(nstrf(kk+1)/=0)
THEN
340 n1 = unpack(nstrf(1+kk),1)
341 n2 = unpack(nstrf(1+kk),2)
346 n3 = unpack(nstrf(1+kk),3)
351 buffer_s(jj+2) = ixtg(1+n1,n)-1
352 buffer_s(jj+3) = ixtg(1+n2,n)-1
353 buffer_s(jj+4) = ixtg(1+n3,n)-1
356 buffer_s(jj+1) = numnodg + nodcut + i - 1
357 buffer_s(jj+2) = nodglob(ixtg(1+n1,n))-1
358 buffer_s(jj+3) = nodglob(ixtg(1+n2,n))-1
359 buffer_s(jj+4) = nodglob(ixtg(1+n3,n))-1
365 k3=k0+30+nstrf(k0+14)+nstrf(k0+6)
376 buffer_s(jj+1) = numnodg + nodcut + i - 1
377 buffer_s(jj+2) = numnodg + nodcut + i - 1
378 buffer_s(jj+3) = numnodg + nodcut + i - 1
399 ii(1)=nodglob(ixs(2,n))-1
400 ii(2)=nodglob(ixs(3,n))-1
401 ii(3)=nodglob(ixs(4,n))-1
402 ii(4)=nodglob(ixs(5,n))-1
403 ii(5)=nodglob(ixs(6,n))-1
404 ii(6)=nodglob(ixs(7,n))-1
405 ii(7)=nodglob(ixs(8,n))-1
406 ii(8)=nodglob(ixs(9,n))-1
409 IF( ii(2)==ii(1).AND.ii(4)==ii(3)
410 . .AND.ii(8)==ii(5).AND.ii(7)==ii(6))
THEN
412 n1=mod(ipack/power2(1),2)
413 n2=mod(ipack/power2(3),2)
414 n3=mod(ipack/power2(5),2)
415 n4=mod(ipack/power2(6),2)
416 IF(n1/=0.AND.n2/=0.AND.n3/=0)
THEN
417 buffer_s(jj+1) =ii(1)
418 buffer_s(jj+2) =ii(3)
419 buffer_s(jj+3) =ii(5)
420 buffer_s(jj+4) =ii(5)
423 IF(n1/=0.AND.n2/=0.AND.n4/=0)
THEN
424 buffer_s(jj+1) =ii(1)
425 buffer_s(jj+2) =ii(3)
426 buffer_s(jj+3) =ii(6)
427 buffer_s(jj+4) =ii(6)
430 IF(n2/=0.AND.n3/=0.AND.n4/=0)
THEN
431 buffer_s(jj+1) =ii(3)
432 buffer_s(jj+2) =ii(5)
433 buffer_s(jj+3) =ii(6)
434 buffer_s(jj+4) =ii(6)
437 IF(n3/=0.AND.n1/=0.AND.n4/=0)
THEN
438 buffer_s(jj+1) =ii(5)
439 buffer_s(jj+2) =ii(1)
440 buffer_s(jj+3) =ii(6)
441 buffer_s(jj+4) =ii(6)
446 n1=mod(ipack/power2(1),2)
447 n2=mod(ipack/power2(2),2)
448 n3=mod(ipack/power2(3),2)
449 n4=mod(ipack/power2(4),2)
450 n5=mod(ipack/power2(5),2)
451 n6=mod(ipack/power2(6),2)
452 n7=mod(ipack/power2(7),2)
453 n8=mod(ipack/power2(8),2)
455 IF(n1/=0.AND.n2/=0.AND.n3/=0.AND.n4/=0)
THEN
457 buffer_s(jj+2) =ii(2)
462 IF(n5/=0.AND.n6/=0.AND.n7/=0.AND.n8/=0)
THEN
463 buffer_s(jj+1) =ii(5)
464 buffer_s(jj+2) =ii(6)
465 buffer_s(jj+3) =ii(7)
466 buffer_s(jj+4) =ii(8)
469 IF(n1/=0.AND.n5/=0.AND.n6/=0.AND.n2/=0)
THEN
470 buffer_s(jj+1) =ii(1)
471 buffer_s(jj+2) =ii(5)
472 buffer_s(jj+3) =ii(6)
473 buffer_s(jj+4) =ii(2)
476 IF(n4/=0.AND.n8/=0.AND.n7/=0.AND.n3/=0)
THEN
477 buffer_s(jj+1) =ii(4)
479 buffer_s(jj+3) =ii(7)
483 IF(n1/=0.AND.n4/=0.AND.n8/=0.AND.n5/=0)
THEN
484 buffer_s(jj+1) =ii(1)
485 buffer_s(jj+2) =ii(4)
486 buffer_s(jj+3) =ii(8)
487 buffer_s(jj+4) =ii(5)
490 IF(n2/=0.AND.n3/=0.AND.n7/=0.AND.n6/=0)
THEN
491 buffer_s(jj+1) =ii(2)
492 buffer_s(jj+2) =ii(3)
493 buffer_s(jj+3) =ii(7)
494 buffer_s(jj+4) =ii(6)
509 CALL spmd_gather_wa(mode,size_buffer_s,size_buffer00_r,sindex,rindex_proc,
510 1 buffer_s,buffer00_r,shift_r,nb_elem_r)
512 buffer00_r(1:size_buffer00_r) = buffer_s(1:size_buffer_s)
514 DEALLOCATE( buffer_s )
526! \__________/ \__________/ \__________/ \__________/ \__________/ \__________/ ...\__________/ \__________/ ...
527! nsect = 1 2 ... n || 1 2 ... n | || 1 2 ...
528! ||________________________________________||________________________________________| ...||_____________________________
533 IF (ispmd==0.AND.nsect>0)
THEN
535 shift_sect(1,1,i) = 0
536 shift_sect(1,2,i) = rindex_proc(1,1,i)
537 shift_sect(1,3,i) = rindex_proc(1,2,i)
539 shift_sect(jj,1,i) = rindex_proc(jj-1,3,i)
540 shift_sect(jj,2,i) = rindex_proc(jj,1,i)
541 shift_sect(jj,3,i) = rindex_proc(jj,2,i)
550 len = rindex_proc(jj,1,i) - shift_sect(jj,1,i)
552 indice = 1 + shift_r(i) + shift_sect(jj,1,i)
560 len = rindex_proc(jj,2,i) - rindex_proc(jj,1,i)
562 indice = 1 + shift_r(i) + shift_sect(jj,2,i)
570 len = rindex_proc(jj,3,i) - rindex_proc(jj,2,i)
572 indice = 1 + shift_r(i) + shift_sect(jj,3,i)
582 n0 = numnodg + nodcut + nsect
583 n1 = numnodg + nodcut + nsect + nrwall
598 IF(iabs(ityp)==1.OR.ityp==4)
THEN
638 IF(nprw(n4)==-1)k=k+nint(rwbuf(8,n))
642 IF(
ALLOCATED(buffer00_r))
DEALLOCATE( buffer00_r )