8 common /nekmpi/ mid,mp,nekcomm,nekgroup,nekreal
13 call fgslib_crystal_setup(i_cr_hndl,nekcomm,np)
23 common /intp_h/ ih_intp(2,1)
25 ih_intp2 = ih_intp(2,i_fp_hndl)
31 call fgslib_findpts(ih_intp2
32 $ , lpm_iprop(1 ,1),lpm_lip
33 $ , lpm_iprop(3 ,1),lpm_lip
34 $ , lpm_iprop(2 ,1),lpm_lip
35 $ , lpm_rprop2(1 ,1),lpm_lrp2
36 $ , lpm_rprop2(4 ,1),lpm_lrp2
37 $ , lpm_y(ix,1),lpm_lrs
38 $ , lpm_y(iy,1),lpm_lrs
39 $ , lpm_y(iz,1),lpm_lrs ,lpm_npart)
42 lpm_iprop(4,i) = lpm_iprop(3,i)
50 ii = floor((lpm_y(ix,i)-lpm_binb(1))/lpm_rdxgp)
51 jj = floor((lpm_y(iy,i)-lpm_binb(3))/lpm_rdygp)
52 kk = floor((lpm_y(iz,i)-lpm_binb(5))/lpm_rdzgp)
53 if (.not. if3d) kk = 0
54 if (ii .eq. lpm_ndxgp) ii = lpm_ndxgp - 1
55 if (jj .eq. lpm_ndygp) jj = lpm_ndygp - 1
56 if (kk .eq. lpm_ndzgp) kk = lpm_ndzgp - 1
57 ndum = ii + lpm_ndxgp*jj + lpm_ndxgp*lpm_ndygp*kk
58 nrank = modulo(ndum, np)
63 lpm_iprop(11,i) = ndum
65 lpm_iprop(4,i) = nrank
70 if (n.gt.lpm_lpart) ierr = 1
74 call exitti(
'LPM_LPART too small, require >$',nmax)
90 common /nekmpi/ nid_,np_,nekcomm,nekgroup,nekreal
93 integer*8 wsize, tdisp
96 integer win, shared_counter
97 save win, shared_counter
107 if (icalld.eq.0)
then
110 call mpi_win_create(shared_counter,
120 call mpi_win_fence(mpi_mode_noprecede,win,ierr)
122 call mpi_accumulate(one,1,mpi_integer,a((i-1)*is+1),
123 $ tdisp,1,mpi_integer,mpi_sum,win,ierr)
125 call mpi_win_fence(mpi_mode_nosucceed,win,ierr)
142 integer lpm_ipmap1(1,LPM_LPART)
143 > ,lpm_ipmap2(1,LPM_LPART)
144 > ,lpm_ipmap3(1,LPM_LPART)
145 > ,lpm_ipmap4(1,LPM_LPART)
147 parameter(lrf = lpm_lrs*4 + lpm_lrp + lpm_lrp2)
148 real rwork(lrf,LPM_LPART)
152 call copy(rwork(ic,i),lpm_y(1,i),lpm_lrs)
154 call copy(rwork(ic,i),lpm_y1((i-1)*lpm_lrs+1),lpm_lrs)
156 call copy(rwork(ic,i),lpm_ydot(1,i),lpm_lrs)
158 call copy(rwork(ic,i),lpm_ydotc(1,i),lpm_lrs)
160 call copy(rwork(ic,i),lpm_rprop(1,i),lpm_lrp)
162 call copy(rwork(ic,i),lpm_rprop2(1,i),lpm_lrp2)
166 call fgslib_crystal_tuple_transfer(i_cr_hndl,lpm_npart ,lpm_lpart
167 $ ,lpm_iprop ,lpm_lip,partl,0,rwork,lrf ,j0)
171 call copy(lpm_y(1,i),rwork(ic,i),lpm_lrs)
173 call copy(lpm_y1((i-1)*lpm_lrs+1),rwork(ic,i),lpm_lrs)
175 call copy(lpm_ydot(1,i),rwork(ic,i),lpm_lrs)
177 call copy(lpm_ydotc(1,i),rwork(ic,i),lpm_lrs)
179 call copy(lpm_rprop(1,i),rwork(ic,i),lpm_lrp)
181 call copy(lpm_rprop2(1,i),rwork(ic,i),lpm_lrp2)
192 integer el_face_num(18),el_edge_num(36),el_corner_num(24),
193 > nfacegp, nedgegp, ncornergp
194 integer ifac(3), icount(3)
198 real lpm_xerange(2,3,lpm_lbmax)
199 common /lpm_elementrange/ lpm_xerange
202 el_face_num = (/ -1,0,0, 1,0,0, 0,-1,0, 0,1,0, 0,0,-1, 0,0,1 /)
203 el_edge_num = (/ -1,-1,0 , 1,-1,0, 1,1,0 , -1,1,0 ,
204 > 0,-1,-1, 1,0,-1, 0,1,-1, -1,0,-1,
205 > 0,-1,1 , 1,0,1 , 0,1,1 , -1,0,1 /)
207 > -1,-1,-1, 1,-1,-1, 1,1,-1, -1,1,-1,
208 > -1,-1,1, 1,-1,1, 1,1,1, -1,1,1 /)
224 iperiodicx = int(lpm_rparam(8))
225 iperiodicy = int(lpm_rparam(9))
226 iperiodicz = int(lpm_rparam(10))
236 rduml = lpm_y(ix,i) - lpm_d2chk(2)
237 rdumr = lpm_y(ix,i) + lpm_d2chk(2)
238 if (rduml .lt. xmin) xmin = rduml
239 if (rdumr .gt. xmax) xmax = rdumr
241 rduml = lpm_y(iy,i) - lpm_d2chk(2)
242 rdumr = lpm_y(iy,i) + lpm_d2chk(2)
243 if (rduml .lt. ymin) ymin = rduml
244 if (rdumr .gt. ymax) ymax = rdumr
246 rduml = lpm_y(iz,i) - lpm_d2chk(2)
247 rdumr = lpm_y(iz,i) + lpm_d2chk(2)
248 if (rduml .lt. zmin) zmin = rduml
249 if (rdumr .gt. zmax) zmax = rdumr
252 lpm_binb(1) =
glmin(xmin,1)
253 lpm_binb(2) =
glmax(xmax,1)
254 lpm_binb(3) =
glmin(ymin,1)
255 lpm_binb(4) =
glmax(ymax,1)
258 if(if3d) lpm_binb(5) =
glmin(zmin,1)
259 if(if3d) lpm_binb(6) =
glmax(zmax,1)
261 lpm_binb(1) = max(lpm_binb(1),lpm_xdrange(1,1))
262 lpm_binb(2) = min(lpm_binb(2),lpm_xdrange(2,1))
263 lpm_binb(3) = max(lpm_binb(3),lpm_xdrange(1,2))
264 lpm_binb(4) = min(lpm_binb(4),lpm_xdrange(2,2))
265 if(if3d)lpm_binb(5) = max(lpm_binb(5),lpm_xdrange(1,3))
266 if(if3d)lpm_binb(6) = min(lpm_binb(6),lpm_xdrange(2,3))
268 if (iperiodicx .eq. 1)
then
269 lpm_binb(1) = lpm_xdrange(1,1)
270 lpm_binb(2) = lpm_xdrange(2,1)
272 if (iperiodicy .eq. 1)
then
273 lpm_binb(3) = lpm_xdrange(1,2)
274 lpm_binb(4) = lpm_xdrange(2,2)
276 if (iperiodicz .eq. 1 .and. if3d)
then
277 lpm_binb(5) = lpm_xdrange(1,3)
278 lpm_binb(6) = lpm_xdrange(2,3)
287 d2new(1) = lpm_d2chk(2)
288 d2new(2) = lpm_d2chk(2)
289 d2new(3) = lpm_d2chk(2)
291 lpm_ndxgp = floor( (lpm_binb(2) - lpm_binb(1))/d2new(1))
292 lpm_ndygp = floor( (lpm_binb(4) - lpm_binb(3))/d2new(2))
294 if (if3d) lpm_ndzgp = floor( (lpm_binb(6) - lpm_binb(5))/d2new(3))
297 if (lpm_ndxgp*lpm_ndygp*lpm_ndzgp .gt. np .or.
298 > int(lpm_rparam(4)) .eq. 1)
then
300 d2chk_save = lpm_d2chk(2)
306 d2new(j+1) = (lpm_binb(2+2*j) - lpm_binb(1+2*j))/ifac(j+1)
307 nbb = ifac(1)*ifac(2)*ifac(3)
308 if (int(lpm_rparam(4)) .eq. 0)
then
309 if(d2new(j+1) .lt. d2chk_save .or. nbb .gt. np) iflg = 1
310 elseif (int(lpm_rparam(4)) .eq. 1)
then
311 if( nbb .gt. np ) iflg = 1
313 if (iflg .eq. 1)
then
314 icount(j+1) = icount(j+1) + 1
315 ifac(j+1) = ifac(j+1) - icount(j+1)
316 d2new(j+1) = (lpm_binb(2+2*j) -lpm_binb(1+2*j))/ifac(j+1)
319 if (icount(1) .gt. 0)
then
320 if (icount(2) .gt. 0)
then
321 if (icount(3) .gt. 0)
then
333 lpm_ndxgp = floor( (lpm_binb(2) - lpm_binb(1))/d2new(1))
334 lpm_ndygp = floor( (lpm_binb(4) - lpm_binb(3))/d2new(2))
336 if (if3d) lpm_ndzgp = floor( (lpm_binb(6) - lpm_binb(5))/d2new(3))
339 lpm_rdxgp = (lpm_binb(2) - lpm_binb(1))/real(lpm_ndxgp)
340 lpm_rdygp = (lpm_binb(4) - lpm_binb(3))/real(lpm_ndygp)
342 if (if3d) lpm_rdzgp = (lpm_binb(6) - lpm_binb(5))/real(lpm_ndzgp)
351 if (iperiodicx .ne. 1)
then
352 rxlbin = rxlbin - ninc/2*lpm_rdxgp
353 rxrbin = rxrbin + ninc/2*lpm_rdxgp
354 rxlbin = max(rxlbin,lpm_xdrange(1,1))
355 rxrbin = min(rxrbin,lpm_xdrange(2,1))
357 if (iperiodicy .ne. 1)
then
358 rylbin = rylbin - ninc/2*lpm_rdygp
359 ryrbin = ryrbin + ninc/2*lpm_rdygp
360 rylbin = max(rylbin,lpm_xdrange(1,2))
361 ryrbin = min(ryrbin,lpm_xdrange(2,2))
363 if (iperiodicz .ne. 1)
then
365 rzlbin = rzlbin - ninc/2*lpm_rdzgp
366 rzrbin = rzrbin + ninc/2*lpm_rdzgp
367 rzlbin = max(rzlbin,lpm_xdrange(1,3))
368 rzrbin = min(rzrbin,lpm_xdrange(2,3))
372 nbin_now = lpm_ndxgp*lpm_ndygp*lpm_ndzgp
374 if (int(lpm_rparam(4)) .eq. 1)
return
382 rxval = xm1(i,j,k,ie)
383 ryval = ym1(i,j,k,ie)
385 if(if3d) rzval = zm1(i,j,k,ie)
387 if (rxval .gt. lpm_binb(2))
goto 1233
388 if (rxval .lt. lpm_binb(1))
goto 1233
389 if (ryval .gt. lpm_binb(4))
goto 1233
390 if (ryval .lt. lpm_binb(3))
goto 1233
391 if (if3d .and. rzval .gt. lpm_binb(6))
goto 1233
392 if (if3d .and. rzval .lt. lpm_binb(5))
goto 1233
394 ii = floor((rxval-lpm_binb(1))/lpm_rdxgp)
395 jj = floor((ryval-lpm_binb(3))/lpm_rdygp)
396 kk = floor((rzval-lpm_binb(5))/lpm_rdzgp)
397 if (.not. if3d) kk = 0
398 if (ii .eq. lpm_ndxgp) ii = lpm_ndxgp - 1
399 if (jj .eq. lpm_ndygp) jj = lpm_ndygp - 1
400 if (kk .eq. lpm_ndzgp) kk = lpm_ndzgp - 1
401 ndum = ii + lpm_ndxgp*jj + lpm_ndxgp*lpm_ndygp*kk
402 nrank = modulo(ndum,np)
404 lpm_neltb = lpm_neltb + 1
405 if(lpm_neltb .gt. lpm_lbmax)
then
406 write(6,*)
'increase lbmax',nid,lpm_neltb,lpm_lbmax
410 lpm_er_map(1,lpm_neltb) = ie
411 lpm_er_map(2,lpm_neltb) = nid
412 lpm_er_map(3,lpm_neltb) = ndum
413 lpm_er_map(4,lpm_neltb) = nrank
414 lpm_er_map(5,lpm_neltb) = nrank
415 lpm_er_map(6,lpm_neltb) = nrank
417 if (lpm_neltb .gt. 1)
then
419 if (lpm_er_map(1,il) .eq. ie)
then
420 if (lpm_er_map(4,il) .eq. nrank)
then
421 lpm_neltb = lpm_neltb - 1
435 iee = lpm_er_map(1,ie)
436 call copy(lpm_xm1b(1,1,1,1,ie), xm1(1,1,1,iee),nxyz)
437 call copy(lpm_xm1b(1,1,1,2,ie), ym1(1,1,1,iee),nxyz)
438 call copy(lpm_xm1b(1,1,1,3,ie), zm1(1,1,1,iee),nxyz)
441 lpm_neltbb = lpm_neltb
444 call icopy(lpm_er_maps(1,ie),lpm_er_map(1,ie),lpm_lrmax)
453 call fgslib_crystal_tuple_transfer(i_cr_hndl,lpm_neltb,lpm_lbmax
454 > , lpm_er_map,nii,partl,nl,lpm_xm1b,nrr,njj)
455 call fgslib_crystal_tuple_sort (i_cr_hndl,lpm_neltb
456 $ , lpm_er_map,nii,partl,nl,lpm_xm1b,nrr,nkey,1)
463 rxval = lpm_xm1b(i,j,k,1,ie)
464 ryval = lpm_xm1b(i,j,k,2,ie)
466 if(if3d) rzval = lpm_xm1b(i,j,k,3,ie)
468 ii = floor((rxval-lpm_binb(1))/lpm_rdxgp)
469 jj = floor((ryval-lpm_binb(3))/lpm_rdygp)
470 kk = floor((rzval-lpm_binb(5))/lpm_rdzgp)
471 if (.not. if3d) kk = 0
472 if (ii .eq. lpm_ndxgp) ii = lpm_ndxgp - 1
473 if (jj .eq. lpm_ndygp) jj = lpm_ndygp - 1
474 if (kk .eq. lpm_ndzgp) kk = lpm_ndzgp - 1
475 ndum = ii + lpm_ndxgp*jj + lpm_ndxgp*lpm_ndygp*kk
477 lpm_modgp(i,j,k,ie,1) = ii
478 lpm_modgp(i,j,k,ie,2) = jj
479 lpm_modgp(i,j,k,ie,3) = kk
480 lpm_modgp(i,j,k,ie,4) = ndum
488 lpm_xerange(1,1,ie) =
vlmin(lpm_xm1b(1,1,1,1,ie),nxyz)
489 lpm_xerange(2,1,ie) =
vlmax(lpm_xm1b(1,1,1,1,ie),nxyz)
490 lpm_xerange(1,2,ie) =
vlmin(lpm_xm1b(1,1,1,2,ie),nxyz)
491 lpm_xerange(2,2,ie) =
vlmax(lpm_xm1b(1,1,1,2,ie),nxyz)
492 lpm_xerange(1,3,ie) =
vlmin(lpm_xm1b(1,1,1,3,ie),nxyz)
493 lpm_xerange(2,3,ie) =
vlmax(lpm_xm1b(1,1,1,3,ie),nxyz)
495 ilow = floor((lpm_xerange(1,1,ie) - lpm_binb(1))/lpm_rdxgp)
496 ihigh = floor((lpm_xerange(2,1,ie) - lpm_binb(1))/lpm_rdxgp)
497 jlow = floor((lpm_xerange(1,2,ie) - lpm_binb(3))/lpm_rdygp)
498 jhigh = floor((lpm_xerange(2,2,ie) - lpm_binb(3))/lpm_rdygp)
499 klow = floor((lpm_xerange(1,3,ie) - lpm_binb(5))/lpm_rdzgp)
500 khigh = floor((lpm_xerange(2,3,ie) - lpm_binb(5))/lpm_rdzgp)
506 lpm_el_map(1,ie) = ilow + lpm_ndxgp*jlow
507 > + lpm_ndxgp*lpm_ndygp*klow
508 lpm_el_map(2,ie) = ihigh + lpm_ndxgp*jhigh
509 > + lpm_ndxgp*lpm_ndygp*khigh
510 lpm_el_map(3,ie) = ilow
511 lpm_el_map(4,ie) = ihigh
512 lpm_el_map(5,ie) = jlow
513 lpm_el_map(6,ie) = jhigh
514 lpm_el_map(7,ie) = klow
515 lpm_el_map(8,ie) = khigh
526 character*132 deathmessage
527 real xdlen,ydlen,zdlen,rxdrng(3),rxnew(3)
528 integer iadd(3),gpsave(27)
529 real map(LPM_LRP_PRO)
531 integer el_face_num(18),el_edge_num(36),el_corner_num(24),
532 > nfacegp, nedgegp, ncornergp
535 el_face_num = (/ -1,0,0, 1,0,0, 0,-1,0, 0,1,0, 0,0,-1, 0,0,1 /)
536 el_edge_num = (/ -1,-1,0 , 1,-1,0, 1,1,0 , -1,1,0 ,
537 > 0,-1,-1, 1,0,-1, 0,1,-1, -1,0,-1,
538 > 0,-1,1 , 1,0,1 , 0,1,1 , -1,0,1 /)
539 el_corner_num = (/ -1,-1,-1, 1,-1,-1, 1,1,-1, -1,1,-1,
540 > -1,-1,1, 1,-1,1, 1,1,1, -1,1,1 /)
552 iperiodicx = int(lpm_rparam(8))
553 iperiodicy = int(lpm_rparam(9))
554 iperiodicz = int(lpm_rparam(10))
562 jdp = int(lpm_rparam(5))
564 xdlen = lpm_binb(2) - lpm_binb(1)
565 ydlen = lpm_binb(4) - lpm_binb(3)
567 if (if3d) zdlen = lpm_binb(6) - lpm_binb(5)
568 if (iperiodicx .ne. 1) xdlen = -1
569 if (iperiodicy .ne. 1) ydlen = -1
570 if (iperiodicz .ne. 1) zdlen = -1
582 call lpm_project_map(map,lpm_y(1,ip),lpm_ydot(1,ip)
583 > ,lpm_ydotc(1,ip),lpm_rprop(1,ip))
584 lpm_cp_map(1,ip) = lpm_y(jx,ip)
585 lpm_cp_map(2,ip) = lpm_y(jy,ip)
586 lpm_cp_map(3,ip) = lpm_y(jz,ip)
587 lpm_cp_map(4,ip) = lpm_rprop(jdp,ip)
589 lpm_cp_map(4+j,ip) = map(j)
592 rxval = lpm_cp_map(1,ip)
593 ryval = lpm_cp_map(2,ip)
595 if(if3d) rzval = lpm_cp_map(3,ip)
597 iip = lpm_iprop(8,ip)
598 jjp = lpm_iprop(9,ip)
599 kkp = lpm_iprop(10,ip)
601 rxl = lpm_binb(1) + lpm_rdxgp*iip
602 rxr = rxl + lpm_rdxgp
603 ryl = lpm_binb(3) + lpm_rdygp*jjp
604 ryr = ryl + lpm_rdygp
608 rzl = lpm_binb(5) + lpm_rdzgp*kkp
609 rzr = rzl + lpm_rdzgp
617 ii1 = iip + el_face_num(ist+1)
618 jj1 = jjp + el_face_num(ist+2)
619 kk1 = kkp + el_face_num(ist+3)
627 if (ii1-iip .ne. 0)
then
628 distchk = distchk + (rfac*lpm_d2chk(2))**2
629 if (ii1-iip .lt. 0) dist = dist +(rxval - rxl)**2
630 if (ii1-iip .gt. 0) dist = dist +(rxval - rxr)**2
632 if (jj1-jjp .ne. 0)
then
633 distchk = distchk + (rfac*lpm_d2chk(2))**2
634 if (jj1-jjp .lt. 0) dist = dist +(ryval - ryl)**2
635 if (jj1-jjp .gt. 0) dist = dist +(ryval - ryr)**2
638 if (kk1-kkp .ne. 0)
then
639 distchk = distchk + (rfac*lpm_d2chk(2))**2
640 if (kk1-kkp .lt. 0) dist = dist +(rzval - rzl)**2
641 if (kk1-kkp .gt. 0) dist = dist +(rzval - rzr)**2
644 distchk = sqrt(distchk)
646 if (dist .gt. distchk) cycle
652 if (iig .lt. 0 .or. iig .gt. lpm_ndxgp-1)
then
654 iig =modulo(iig,lpm_ndxgp)
655 if (iperiodicx .ne. 1) cycle
657 if (jjg .lt. 0 .or. jjg .gt. lpm_ndygp-1)
then
659 jjg =modulo(jjg,lpm_ndygp)
660 if (iperiodicy .ne. 1) cycle
662 if (kkg .lt. 0 .or. kkg .gt. lpm_ndzgp-1)
then
664 kkg =modulo(kkg,lpm_ndzgp)
665 if (iperiodicz .ne. 1) cycle
668 iflgsum = iflgx + iflgy + iflgz
669 ndumn = iig + lpm_ndxgp*jjg + lpm_ndxgp*lpm_ndygp*kkg
670 nrank = modulo(ndumn,np)
672 if (nrank .eq. nid .and. iflgsum .eq. 0) cycle
675 if (gpsave(i) .eq. nrank .and. iflgsum .eq.0)
goto 111
678 gpsave(isave) = nrank
680 ibctype = iflgx+iflgy+iflgz
692 lpm_npart_gp = lpm_npart_gp + 1
693 lpm_iprop_gp(1,lpm_npart_gp) = nrank
694 lpm_iprop_gp(2,lpm_npart_gp) = iig
695 lpm_iprop_gp(3,lpm_npart_gp) = jjg
696 lpm_iprop_gp(4,lpm_npart_gp) = kkg
697 lpm_iprop_gp(5,lpm_npart_gp) = ndumn
699 lpm_rprop_gp(1,lpm_npart_gp) = rxnew(1)
700 lpm_rprop_gp(2,lpm_npart_gp) = rxnew(2)
701 lpm_rprop_gp(3,lpm_npart_gp) = rxnew(3)
703 lpm_rprop_gp(k,lpm_npart_gp) = lpm_cp_map(k,ip)
711 ii1 = iip + el_edge_num(ist+1)
712 jj1 = jjp + el_edge_num(ist+2)
713 kk1 = kkp + el_edge_num(ist+3)
721 if (ii1-iip .ne. 0)
then
722 distchk = distchk + (rfac*lpm_d2chk(2))**2
723 if (ii1-iip .lt. 0) dist = dist +(rxval - rxl)**2
724 if (ii1-iip .gt. 0) dist = dist +(rxval - rxr)**2
726 if (jj1-jjp .ne. 0)
then
727 distchk = distchk + (rfac*lpm_d2chk(2))**2
728 if (jj1-jjp .lt. 0) dist = dist +(ryval - ryl)**2
729 if (jj1-jjp .gt. 0) dist = dist +(ryval - ryr)**2
732 if (kk1-kkp .ne. 0)
then
733 distchk = distchk + (rfac*lpm_d2chk(2))**2
734 if (kk1-kkp .lt. 0) dist = dist +(rzval - rzl)**2
735 if (kk1-kkp .gt. 0) dist = dist +(rzval - rzr)**2
738 distchk = sqrt(distchk)
740 if (dist .gt. distchk) cycle
746 if (iig .lt. 0 .or. iig .gt. lpm_ndxgp-1)
then
748 iig =modulo(iig,lpm_ndxgp)
749 if (iperiodicx .ne. 1) cycle
751 if (jjg .lt. 0 .or. jjg .gt. lpm_ndygp-1)
then
753 jjg =modulo(jjg,lpm_ndygp)
754 if (iperiodicy .ne. 1) cycle
756 if (kkg .lt. 0 .or. kkg .gt. lpm_ndzgp-1)
then
758 kkg =modulo(kkg,lpm_ndzgp)
759 if (iperiodicz .ne. 1) cycle
762 iflgsum = iflgx + iflgy + iflgz
763 ndumn = iig + lpm_ndxgp*jjg + lpm_ndxgp*lpm_ndygp*kkg
764 nrank = modulo(ndumn,np)
766 if (nrank .eq. nid .and. iflgsum .eq. 0) cycle
769 if (gpsave(i) .eq. nrank .and. iflgsum .eq.0)
goto 222
772 gpsave(isave) = nrank
774 ibctype = iflgx+iflgy+iflgz
786 lpm_npart_gp = lpm_npart_gp + 1
787 lpm_iprop_gp(1,lpm_npart_gp) = nrank
788 lpm_iprop_gp(2,lpm_npart_gp) = iig
789 lpm_iprop_gp(3,lpm_npart_gp) = jjg
790 lpm_iprop_gp(4,lpm_npart_gp) = kkg
791 lpm_iprop_gp(5,lpm_npart_gp) = ndumn
793 lpm_rprop_gp(1,lpm_npart_gp) = rxnew(1)
794 lpm_rprop_gp(2,lpm_npart_gp) = rxnew(2)
795 lpm_rprop_gp(3,lpm_npart_gp) = rxnew(3)
797 lpm_rprop_gp(k,lpm_npart_gp) = lpm_cp_map(k,ip)
805 ii1 = iip + el_corner_num(ist+1)
806 jj1 = jjp + el_corner_num(ist+2)
807 kk1 = kkp + el_corner_num(ist+3)
815 if (ii1-iip .ne. 0)
then
816 distchk = distchk + (rfac*lpm_d2chk(2))**2
817 if (ii1-iip .lt. 0) dist = dist +(rxval - rxl)**2
818 if (ii1-iip .gt. 0) dist = dist +(rxval - rxr)**2
820 if (jj1-jjp .ne. 0)
then
821 distchk = distchk + (rfac*lpm_d2chk(2))**2
822 if (jj1-jjp .lt. 0) dist = dist +(ryval - ryl)**2
823 if (jj1-jjp .gt. 0) dist = dist +(ryval - ryr)**2
826 if (kk1-kkp .ne. 0)
then
827 distchk = distchk + (rfac*lpm_d2chk(2))**2
828 if (kk1-kkp .lt. 0) dist = dist +(rzval - rzl)**2
829 if (kk1-kkp .gt. 0) dist = dist +(rzval - rzr)**2
832 distchk = sqrt(distchk)
834 if (dist .gt. distchk) cycle
840 if (iig .lt. 0 .or. iig .gt. lpm_ndxgp-1)
then
842 iig =modulo(iig,lpm_ndxgp)
843 if (iperiodicx .ne. 1) cycle
845 if (jjg .lt. 0 .or. jjg .gt. lpm_ndygp-1)
then
847 jjg =modulo(jjg,lpm_ndygp)
848 if (iperiodicy .ne. 1) cycle
850 if (kkg .lt. 0 .or. kkg .gt. lpm_ndzgp-1)
then
852 kkg =modulo(kkg,lpm_ndzgp)
853 if (iperiodicz .ne. 1) cycle
856 iflgsum = iflgx + iflgy + iflgz
857 ndumn = iig + lpm_ndxgp*jjg + lpm_ndxgp*lpm_ndygp*kkg
858 nrank = modulo(ndumn,np)
860 if (nrank .eq. nid .and. iflgsum .eq. 0) cycle
863 if (gpsave(i) .eq. nrank .and. iflgsum .eq.0)
goto 333
866 gpsave(isave) = nrank
868 ibctype = iflgx+iflgy+iflgz
880 lpm_npart_gp = lpm_npart_gp + 1
881 lpm_iprop_gp(1,lpm_npart_gp) = nrank
882 lpm_iprop_gp(2,lpm_npart_gp) = iig
883 lpm_iprop_gp(3,lpm_npart_gp) = jjg
884 lpm_iprop_gp(4,lpm_npart_gp) = kkg
885 lpm_iprop_gp(5,lpm_npart_gp) = ndumn
887 lpm_rprop_gp(1,lpm_npart_gp) = rxnew(1)
888 lpm_rprop_gp(2,lpm_npart_gp) = rxnew(2)
889 lpm_rprop_gp(3,lpm_npart_gp) = rxnew(3)
891 lpm_rprop_gp(k,lpm_npart_gp) = lpm_cp_map(k,ip)
906 real rxnew(3), rxdrng(3)
907 integer iadd(3), irett(3), ntype, ntypel(7)
925 if (xdlen .gt. 0 )
then
926 if (ii .ge. lpm_ndxgp)
then
932 if (xdlen .gt. 0 )
then
941 if (ydlen .gt. 0 )
then
942 if (jj .ge. lpm_ndygp)
then
948 if (ydlen .gt. 0 )
then
958 if (zdlen .gt. 0 )
then
959 if (kk .ge. lpm_ndzgp)
then
965 if (zdlen .gt. 0 )
then
989 call fgslib_crystal_tuple_transfer(i_cr_hndl
990 > ,lpm_npart_gp,lpm_lpart_gp
991 > ,lpm_iprop_gp,lpm_lip_gp
993 > ,lpm_rprop_gp,lpm_lrp_gp
subroutine exitti(stringi, idata)
subroutine interp_setup(ih, tolin, nmsh, nelm)
subroutine lpm_comm_bin_setup
integer function nid_glcount(a, is, n)
subroutine lpm_comm_ghost_create
subroutine lpm_comm_ghost_send
subroutine lpm_comm_setup
subroutine lpm_comm_crystal
subroutine lpm_comm_check_periodic_gp(rxnew, rxdrng, iadd)
subroutine lpm_comm_findpts
subroutine icopy(a, b, n)
real function vlmax(vec, n)
real function vlmin(vec, n)