64 INTEGER :: particlecount
92 type(
ptype),
POINTER :: particle
148 NULLIFY(cluster%next_cluster)
149 NULLIFY(cluster%PARTICLE_LL)
154 print*,
' Error - cluster pointer already associated!' 158 cluster%ParticleCount = 0
166 print*,
' Error - cluster pointer is not associated!' 170 cluster%ParticleCount = 0
196 write(*,
"(//,3x,A,//)")
'No clusters to delete!' 198 write(*,
"(//,3x,A,//)")
' Error with ClusterCount and pointer - Er:1' 200 write(*,
"(//,3x,A,//)")
' Error with ClusterCount and pointer - Er:2' 219 if(
associated(cluster%next_cluster))
then 226 NULLIFY(cluster%next_cluster)
227 NULLIFY(cluster%PARTICLE_LL)
232 write(*,
"()")
' ClusterCount < 0' 253 write(*,
"(//,3x,A,//)")
' Error with ClusterCount and pointer - Er:1' 255 write(*,
"(//,3x,A,//)")
' Error with ClusterCount and pointer - Er:2' 263 if(
associated(cluster%next_cluster))
then 268 cdeleted = cdeleted + 1
269 NULLIFY(cluster%next_cluster)
270 NULLIFY(cluster%PARTICLE_LL)
280 write(*,
"()")
' cDeleted /= ClusterCount' 303 if(.NOT.
associated(cluster%PARTICLE_LL) .AND. cluster%ParticleCount
then 304 write(*,
"(//,3x,A,//)")
'No particles to delete!' 305 elseif(.NOT.
associated(cluster%PARTICLE_LL) .AND. cluster%ParticleCount
then 306 write(*,
"(//,3x,A,//)")
' Error with ParticleCount and pointer - Er:1' 307 elseif(
associated(cluster%PARTICLE_LL) .AND. cluster%ParticleCount
then 308 write(*,
"(//,3x,A,//)")
' Error with ParticleCount and pointer - Er:2' 310 do pl =1, cluster%ParticleCount
315 if(
associated(particle%next_particle))
then 316 cluster%PARTICLE_LL => particle%next_particle
318 NULLIFY(cluster%PARTICLE_LL)
320 pdeleted = pdeleted + 1
321 NULLIFY(particle%next_particle)
326 if(pdeleted == cluster%ParticleCount)
then 331 cluster%ParticleCount = 0
333 write(*,
"()")
' pDeleted /= cluster%ParticleCount' 350 INTEGER,
INTENT(IN) :: pID
356 NULLIFY(particle%next_particle)
360 IF(cluster%ParticleCount == 0)
THEN 361 cluster%ParticleCount = 1
362 cluster%PARTICLE_LL => particle
364 cluster%ParticleCount = cluster%ParticleCount + 1
365 particle%next_particle => cluster%PARTICLE_LL
366 cluster%PARTICLE_LL => particle
380 if(.NOT.
associated(cluster))
then 383 elseif(
associated(cluster%next_cluster))
then 384 cluster => cluster%next_cluster
386 print*,
' You are looking for a cluster that does not exist' 401 if(.NOT.
associated(particle))
then 402 particle => cluster%PARTICLE_LL
403 elseif(
associated(particle%next_particle))
then 404 particle => particle%next_particle
406 print*,
' You are looking for a particle that does not exist' 419 INTEGER,
INTENT(IN) :: pID
423 NULLIFY(particle%next_particle)
431 print*,
' Error - particle history pointer already & 445 print*,
' Error - particle history pointer is not & 478 if(.NOT.
associated(particle))
then 481 elseif(
associated(particle%next_particle))
then 484 particle => particle%next_particle
486 print*,
' You are looking for a particle that does not exist' 506 write(*,
"(//,3x,A,//)")
'No particles in history to delete!' 509 write(*,
"(//,3x,A,//)") &
510 ' Error with pSearchHistoryCount and pointer - Er:1' 513 write(*,
"(//,3x,A,//)") &
514 ' Error with pSearchHistoryCount and pointer - Er:2' 520 if(
associated(particle%next_particle))
then 526 NULLIFY(particle%next_particle)
531 write(*,
"(4X,A)")
'pSearchHistoryCount < 0' 560 write(*,
"(//,3x,A,//)") &
561 ' Error with pSearchHistoryCount and pointer - Er:1' 564 write(*,
"(//,3x,A,//)") &
565 ' Error with pSearchHistoryCount and pointer - Er:2' 573 if(
associated(particle%next_particle))
then 578 pdeleted = pdeleted + 1
579 NULLIFY(particle%next_particle)
589 write(*,
"()")
' pDeleted /= PSearchHistoryCount' 609 integer lc1, lc2, lc3, lc4
617 INTEGER,
parameter :: dbg_level = 0
620 double precision,
dimension(:),
allocatable :: lRad
621 double precision,
dimension(:,:),
allocatable :: lPos
622 double precision,
dimension(:,:),
allocatable :: lVel_s
625 double precision,
dimension(:),
allocatable :: lEpg
626 double precision,
dimension(:),
allocatable :: lRog
627 double precision,
dimension(:),
allocatable :: lMug
628 double precision,
dimension(:,:),
allocatable :: lVel_g
631 double precision,
dimension(:),
allocatable :: lPost
634 integer lMin(1:3), lMax(1:3)
636 double precision avgEpg, avgRe, avgSlip, lSlip
637 double precision avgVel_s(1:3), avgVel_g(1:3)
639 double precision posMin(1:3), posMax(1:3)
640 double precision clSize(1:3), clDiameter
642 double precision cSize
644 Type(
ctype),
pointer :: cThis
645 Type(
ptype),
pointer :: pThis
669 open (unit=203, file=
'clusterInfo.dat', &
670 status=
'unknown', position=
'append')
672 write(203,
"(/3X,'Time: ',F9.6,3x,'No clusters to print.')")&
675 write(203,
"(/3X,'Time: ',F9.6)")
time 683 if(
clusters(lc1)%size < 4) cycle lp_lc10
693 posmax =
zero; lmax = 0
698 if(
associated(cthis%particle))
then 699 pthis => cthis%particle
706 do while(
associated(pthis))
713 if(lmug(l) ==
zero)
then 714 write(*,
"(3x,'Invalid Mu_g. ', & 715 &'Omitting cluster data: ',I4)") lc1
721 do lc4=1, merge(2, 3, no_k)
723 if((lpos(l,lc4)-lrad(l)) < posmin(lc4))
then 724 posmin(lc4) = lpos(l,lc4)-lrad(l)
727 if((lpos(l,lc4)+lrad(l)) > posmax(lc4))
then 728 posmax(lc4) = lpos(l,lc4)+lrad(l)
732 lslip = lslip + (lvel_g(l,lc4)-lvel_s(l,lc4))**2
738 if(lslip ==
zero)
then 739 write(*,
"(3x,'Invalid lSlip. ', & 740 &'Omitting cluster data: ',I4)") lc1
745 avgvel_s = avgvel_s + lvel_s(l,:)
746 avgvel_g = avgvel_g + lvel_g(l,:)
747 avgepg = avgepg + lepg(l)
748 avgre = avgre + lrog(l)*lepg(l)*lslip*2.0d0*lrad(l)/lmug
751 lpost(l) = float(cthis%size)
754 if(
associated(pthis%next))
then 762 if(lc3 /= cthis%size)
then 763 write(*,
"(3x,'Error processing particles. ', & 764 &'Omitting cluster data: ',I4)") lc1
769 csize = dble(cthis%size)
770 avgepg = avgepg / csize
771 avgvel_g = avgvel_g / csize
772 avgvel_s = avgvel_s / csize
773 avgre = avgre / csize
777 do lc4=1, merge(2, 3, no_k)
778 avgslip = avgslip + (avgvel_g(lc4)-avgvel_s(lc4))**2
779 clsize(lc4) = posmax(lc4) - posmin(lc4)
781 avgslip = dsqrt(avgslip)
789 clsize(2)*clsize(3)*(avgvel_g(1)-avgvel_s(1))**2 &
790 + clsize(1)*clsize(3)*(avgvel_g(2)-avgvel_s(2))**2 &
791 + clsize(1)*clsize(2)*(avgvel_g(3)-avgvel_s(3))**2
793 cldiameter = dsqrt(cldiameter) / avgslip
798 write(203,
"(4X,I7,4X,I7,4(1X,G13.6))") lc1, &
799 cthis%size, avgepg, avgre, avgslip, cldiameter
803 write(203,
"(4X,'Clusters reported: ', I7, & 814 if(
allocated(lrad))
deallocate(lrad)
815 if(
allocated(lpos))
deallocate(lpos)
816 if(
allocated(lvel_s))
deallocate(lvel_s)
818 if(
allocated(lepg))
deallocate(lepg)
819 if(
allocated(lrog))
deallocate(lrog)
820 if(
allocated(lmug))
deallocate(lmug)
821 if(
allocated(lvel_g))
deallocate(lvel_g)
823 if(
allocated(lpost))
deallocate(lpost)
852 INTEGER,
intent(in) :: dbg_level
858 INTEGER lc1, lc2, lc3, lc4
860 character(LEN=255) :: filename
869 INTEGER,
dimension(:),
allocatable :: pCnt
871 INTEGER,
dimension(:) :: cCnt(0:
numpes-1)
873 INTEGER,
dimension(:),
allocatable :: gpIDs
875 LOGICAL,
dimension(:),
allocatable :: gpGhost
881 INTEGER,
dimension(:) :: cCnt_all(0:
numpes-1)
886 INTEGER,
dimension(:),
allocatable :: pCnt_all
889 INTEGER,
dimension(:) :: pCnt_dsp(0:
numpes-1)
891 INTEGER,
dimension(:),
allocatable :: gp_dsp
894 INTEGER,
dimension(:),
allocatable :: gpIDs_all
896 LOGICAL,
dimension(:),
allocatable :: gpGhost_all
898 INTEGER,
dimension(:,:),
allocatable :: mergeMap
901 Type(
ctype),
pointer :: this
906 write(*,
"(//1x,'Start data dump ',50('-'),'>'/)")
908 if(dbg_level >= 2)
then 910 write(filename,
"('dbg_check_',I2.2,'.txt')")
mype 911 open(convert=
'big_endian',unit=202, file=filename, &
912 status=
'replace', position=
'append')
913 write(202,
"(3x,'check A')")
921 ccnt = 0; ccnt_all = 0
926 if(dbg_level >= 2)
write(202,
"(5x,'check 1')")
929 allocate(pcnt(ccnt(
mype)))
931 do lc1 = 1, ccnt(
mype)
933 pcnt(lc1) = cluster%ParticleCount
935 if(dbg_level >= 2)
then 937 write(202,
"(5x,'check 2')")
946 allocate(pcnt_all(ccnt_sum)); pcnt_all(:) = 1
951 pcnt_dsp(proc) = pcnt_dsp(proc-1) + ccnt_all(proc-1)
954 if(dbg_level >= 2)
then 956 write(202,
"(5x,'check 3')")
963 if(dbg_level >= 2)
write(202,
"(5x,'check 4')")
971 if(ccnt_all(proc) > 0)
then 972 do lc1=1, ccnt_all(proc)
974 pcnt_all(lc1 + pcnt_dsp(proc))
989 if(dbg_level >= 2)
write(202,
"(5x,'check 5')")
992 allocate( gp_dsp(ccnt_sum) ); gp_dsp(:) = 0
995 gp_dsp(lc1) = gp_dsp(lc1-1) + pcnt_all(lc1-1)
999 if(dbg_level >= 2)
write(202,
"(5x,'check 6')")
1004 if(dbg_level >= 2)
then 1006 write(202,
"(5x,'check 7')")
1012 if(dbg_level >= 2)
then 1014 write(202,
"(5x,'check 7')")
1016 write(202,
"(5x,'check 9')")
1018 write(202,
"(5x,'check 10')")
1020 write(202,
"(5x,'check 11')")
1021 elseif(dbg_level >= 1)
then 1029 if( ccnt_sum > 1)
then 1030 allocate(mergemap(ccnt_sum, ccnt_sum)); mergemap = 0
1031 do lc1 = 1, ccnt_sum
1032 mergemap(lc1,lc1) = 1
1037 lp_lc1:
do lc1 = 1, ccnt_sum-1
1038 lp_lc2:
do lc2 = 1+gp_dsp(lc1), gp_dsp(lc1)+pcnt_all(lc1)
1039 lp_lc3:
do lc3 = lc1+1, ccnt_sum
1040 lp_lc4:
do lc4 = 1+gp_dsp(lc3), gp_dsp(lc3)+pcnt_all(lc3)
1041 if(gpids_all(lc2) == gpids_all(lc4))
then 1042 mergemap(lc1,lc3) = 1
1043 mergemap(lc3,lc1) = 1
1044 if(dbg_level >= 1) &
1045 write(*,
"(3x,'Merge: ',I5,' and ',I5)") lc1, lc3
1051 if(dbg_level >= 1)
then 1063 lp_lc11:
do lc1=1,ccnt_sum-1
1064 if(sum(mergemap(lc1,:)) == 0) cycle lp_lc11
1065 lp_lc21:
do lc2=lc1+1,ccnt_sum
1066 if(mergemap(lc1,lc2) /= 1) cycle lp_lc21
1068 lp_lc41:
do lc4 = 1, ccnt_sum
1069 if(lc3 == lc4) cycle lp_lc41
1070 if(mergemap(lc3,lc4) == 1)
then 1071 mergemap(lc1,lc4) = 1
1072 mergemap(lc3,lc4) = 0
1073 mergemap(lc3,lc3) = 0
1080 if(dbg_level >= 1) &
1086 if(sum(mergemap(lc1,:)) > 0)
then 1090 if(dbg_level >= 1)
then 1091 write(*,
"(3x,'Number of clusters reported by ', & 1092 &'all processes: ',I6)") ccnt_sum
1093 write(*,
"(3x,'Actual number of clusters: ',I6)") &
1109 lp_lc12:
do lc1=1, ccnt_sum
1110 if(sum(mergemap(lc1,:)) == 0) cycle lp_lc12
1112 this =>
clusters(lc3); this%size = 0
1113 lp_lc22:
do lc2=1, ccnt_sum
1114 if(mergemap(lc1,lc2) == 0) cycle lp_lc22
1115 lp_lc42:
do lc4=1+gp_dsp(lc2),gp_dsp(lc2)+pcnt_all(lc2
1116 if(gpghost_all(lc4)) cycle lp_lc42
1121 deallocate(mergemap)
1122 if(dbg_level >= 1) &
1127 elseif( ccnt_sum == 1)
then 1128 if(dbg_level >= 1) &
1129 write(*,
"(3x,'Just one cluster: No merge.',/)")
1135 do lc1=1, pcnt_all(1)
1136 if(gpghost_all(lc1))
write(*,
"(3x, & 1137 &'Error: Ghost particle detected: ',I7)") lc1
1140 if(dbg_level >= 1) &
1143 if(dbg_level >= 1)
write(*,
"(3x,'No clusters to merge.')")
1161 if(
allocated(pcnt))
deallocate(pcnt)
1162 if(
allocated(gpids))
deallocate(gpids)
1163 if(
allocated(gpghost))
deallocate(gpghost)
1165 if(
allocated(pcnt_all))
deallocate(pcnt_all)
1166 if(
allocated(gpids_all))
deallocate(gpids_all)
1167 if(
allocated(gpghost_all))
deallocate(gpghost_all)
1169 if(
allocated(gp_dsp))
deallocate(gp_dsp)
1188 INTEGER,
INTENT(IN) :: lmsgID
1191 CHARACTER(len=*),
intent(in),
optional :: lmsg
1193 INTEGER,
INTENT(IN),
optional :: dbg
1196 INTEGER proc, lc1, lc2, lc3, lc4
1198 CHARACTER(len=120) wbuff, wbuff2
1200 CHARACTER(LEN=255) :: filename
1203 Type(
ctype),
pointer :: cThis
1205 Type(
ptype),
pointer :: pThis
1219 write(*,
"(3x,'Process ',I2,' reporting ',I4,' clusters.')")
1222 write(*,
"(3x,'Total reported clusters: ',I6)") sum(ccnt_all)
1237 write(filename,
"('dbg_pCnt_',I2.2,'.txt')")
mype 1238 open(convert=
'big_endian',unit=201, file=filename, status=
'replace' 1239 write(201,
"(//3x,'Time:',F18.6)")
time 1240 write(201,
"(3x,'Number of Clusters: ',I4)") ccnt(
mype)
1242 if(ccnt(
mype) > 0)
then 1245 write(201,
"(3x,'/Cluster ',I5,' has ',I8,' members.')")
1246 write(201,
"(5x,'Membership:')")
1249 do lc1 = 1, cluster%ParticleCount
1251 write(201,
"(5x,'Global ID: ',I8)") &
1252 iglobal_id(particle%ID)
1269 filename =
'dbg_pCnt_dsp.txt' 1270 open(convert=
'big_endian',unit=201, file=filename, status=
'replace' 1271 write(201,
"(/3x,'Time:',F18.6)")
time 1272 write(201,
"(3x,'cCnt_sum: ',I4)") ccnt_sum
1274 write(201,
"(5x,'pCnt_dsp(',I4,'): ',I6)")lc1, pcnt_dsp(lc1)
1288 if(ccnt_sum > 0)
then 1289 write(*,
"(3x,'Total number of clusters: ',I6)") ccnt_sum
1291 if(ccnt_all(proc) > 0)
then 1292 write(*,
"(5x,'Process ',I2,': cluster count: ',I4)") &
1293 proc, ccnt_all(proc)
1294 do lc1 = 1, ccnt_all(proc)
1295 write(*,
"(7x,'Particles in cluster ',I4,': ',I6)")&
1296 lc1, pcnt_all(lc1 + pcnt_dsp(proc))
1299 write(*,
"(3x,'Process ',I2,' reports no clusters.')")&
1317 write(*,
"(3x,'send_cnt: ',I8)")
send_cnt 1318 write(*,
"(3x,'recv_sum: ',I8)")
recv_sum 1319 write(*,
"(3x,'Generic send/recv setup:')")
1322 write(*,
"(5x,'Process ',I2,': count: ',I6,& 1326 write(*,
"(3x,'Process ',I2,' is empty.')") proc
1330 write(*,
"(3x,'No data to send/recv.')")
1344 if(ccnt_sum > 0)
then 1345 write(*,
"(3x,'Global cluster-to-particle offset:')")
1346 do lc1 = 1, ccnt_sum
1347 write(*,
"(7x,' Cluster ',I4,': ',I6)") &
1363 open(convert=
'big_endian',unit=201, file=
'dbg_gpIDs.txt', status
'replace' 1364 do lc1=1,
size(gpids_all)
1365 write(201,
"(5x,' Global particle ID: ',I8)") gpids_all(lc1)
1380 if(.not.
present(lmsg))
then 1381 write(*,
"(/3x,'Invalid use of case debug report.')")
1386 write(filename,
"('dbg_mergeMap_',A,I2.2,'.txt')") trim(lmsg)
1387 open(convert=
'big_endian',unit=201, file=filename, status=
'replace' 1389 write(201,
"(/3x,'Time:',F18.6)")
time 1391 lc1 =
size(mergemap(:,1))
1392 lc2 = min(
size(mergemap(1,:)),25)
1395 write(wbuff,
"(7x,'1')")
1397 write(wbuff,
"(A,3x,I1)") trim(wbuff), lc3
1401 write(wbuff2,
"(5x,'|')")
1403 write(wbuff2,
"(2A)") trim(wbuff2),
'---|' 1406 write(201,*)trim(wbuff)
1407 write(201,*)trim(wbuff2)
1411 write(wbuff,
"(3X,I1,' |')") lc3
1413 write(wbuff,
"(A,1x,I1,' |')") &
1414 trim(wbuff), mergemap(lc3,lc4)
1416 write(201,*)trim(wbuff)
1417 write(201,*)trim(wbuff2)
1432 write(filename,
"('dbg_isghost_',I2.2,'.txt')")
mype 1433 open(convert=
'big_endian',unit=201, file=filename, status=
'replace' 1434 write(201,
"(/3x,'Time:',F18.6)")
time 1436 write(201,
"(5x,'IS_GHOST(',I8,'): ',L2)")lc1, gpghost(lc1)
1450 open(convert=
'big_endian',unit=201, file=
'dbg_isghost_all.txt',
'replace' 1451 write(201,
"(/3x,'Time:',F18.6)")
time 1453 write(201,
"(5x,'IS_GHOST(',I8,'): ',L2)")lc1, gpghost_all(lc1
1471 do lc1 = 1, ccnt_all(proc)
1473 do lc3 = 1, pcnt_all(lc2)
1474 if(gpghost_all(gp_dsp(lc2) + lc3))
then 1475 write(*,
"(3x,'Particle ',I8,' in cluster ',I6, & 1476 &' is a ghost on process ',I2,'.')") &
1477 gpids_all(gp_dsp(lc2) + lc3), lc2, proc
1493 if(.not.
present(
dbg))
return 1497 write(*,
"(3x,'Cluster ',I6,' reports ',I6,& 1498 &' particles.')") lc1,
clusters(lc1)%size
1505 write(filename,
"('dbg_cluster_',I3.3,'.txt')")lc1
1506 open(convert=
'big_endian',unit=201, file=filename, status
'replace' 1507 write(201,
"(3x,'Time:',F10.6)")
time 1511 write(201,
"(3x,'Cluster ',I6,' reports ',I6,& 1512 &' particles.')") lc1, cthis%size
1513 write(201,
"(3x,' Particles in this cluster include:')")
1516 if(
associated(cthis%particle)) pthis => cthis%particle
1517 do while(
associated(pthis))
1518 write(201,
"(3x,I8)") pthis%id
1519 if(
associated(pthis%next))
then 1538 WRITE(*,
"(3x,'No message exists for msgID: ',I4)")lmsgid
1563 INTEGER,
intent(in) :: dbg_level
1566 type(
ctype),
pointer :: cThis
1567 type(
ptype),
pointer :: pThis
1569 if(dbg_level >= 2)
write(202,
"(3x,'check B')")
1581 do while(
associated(cthis%particle))
1582 if(
associated(cthis%particle%next))
then 1583 pthis => cthis%particle
1584 cthis%particle => pthis%next
1589 deallocate(cthis%particle)
1590 nullify(cthis%particle)
1592 cthis%size = cthis%size - 1
1594 if(cthis%size /= 0)
then 1595 write(*,
"(3x,'Error deallocating clusters: ', I6)")&
1604 if(dbg_level >= 2)
close(202)
1606 write(*,
"(/1x,'End data dump ',52('-'),'<'//)")
1625 Type(
ctype),
pointer,
intent(inout) :: this
1628 integer,
intent(in) :: lMap
1630 integer,
intent(in) :: lID
1633 Type(
ptype),
pointer :: new
1642 this%size = this%size + 1
1645 if(this%size == 1)
then 1648 if(
associated(this%particle))
then 1649 write(*,
"(3x,'Fatal Error (000) adding particle.')")
1655 if(.not.
associated(this%particle))
then 1656 write(*,
"(3x,'Fatal Error (001) adding particle.')")
1659 new%next => this%particle
1662 this%particle => new
1685 integer,
intent(in) :: lData(:)
1687 integer,
allocatable,
intent(inout) :: lrbuff(:)
1689 integer,
allocatable,
intent(inout),
optional :: lOut(:)
1692 integer,
allocatable :: lsbuff(:)
1699 integer lc1, lc2, lc3
1705 if(
allocated(lrbuff))
then 1707 &'Error in getClusterParticleData_1i: ',& 1708 &'Deallocating receive buffer.')")
1717 if(
present(lout))
allocate(lout(
send_cnt))
1727 do lc1 = 1, cluster%ParticleCount
1730 lsbuff(lc3) = ldata(particle%ID)
1741 if(
present(lout)) lout = lsbuff
1768 integer,
intent(in) :: lData(:,:)
1770 integer,
allocatable,
intent(inout) :: lrbuff(:,:)
1772 integer,
allocatable,
intent(inout),
optional :: lOut(:,:)
1774 integer,
allocatable :: lsbuff(:)
1782 integer lc1, lc2, lc3, lc4
1789 lbnd = lbound(ldata,1)
1790 ubnd = ubound(ldata,1)
1794 if(
allocated(lrbuff))
then 1795 if(
mype == 0)
write(*,
"(3x,& 1796 &'Error in getClusterParticleData_2i: ', & 1797 &'Deallocating receive buffer.')")
1802 allocate(lrbuff(lbnd:ubnd,
recv_sum))
1806 if(
present(lout))
allocate(lout(lbnd:ubnd,
send_cnt))
1818 do lc1 = 1, cluster%ParticleCount
1821 lsbuff(lc3) = ldata(lc4,particle%ID)
1831 if(
present(lout)) lout(lc4,:) = lsbuff
1860 double precision,
intent(in) :: lData(:)
1862 double precision,
allocatable,
intent(inout) :: lrbuff(:)
1864 double precision,
allocatable,
intent(inout),
optional :: lOut(:)
1867 double precision,
allocatable :: lsbuff(:)
1875 INTEGER lc1, lc2, lc3
1881 if(
allocated(lrbuff))
then 1882 if(
mype == 0)
write(*,
"(3x,& 1883 &'Error in getClusterParticleData_1d: ', & 1884 &'Deallocating receive buffer.')")
1893 if(
present(lout))
allocate(lout(
send_cnt))
1903 do lc1 = 1, cluster%ParticleCount
1906 lsbuff(lc3) = ldata(particle%ID)
1917 if(
present(lout)) lout = lsbuff
1944 double precision,
intent(in) :: lData(:,:)
1946 double precision,
allocatable,
intent(inout) :: lrbuff(:,:)
1948 double precision,
allocatable,
intent(inout),
optional :: lOut(:,:)
1951 double precision,
allocatable :: lsbuff(:)
1959 integer lc1, lc2, lc3, lc4
1966 lbnd = lbound(ldata,1)
1967 ubnd = ubound(ldata,1)
1971 if(
allocated(lrbuff))
then 1972 if(
mype == 0)
write(*,
"(3x,& 1973 &'Error in getClusterParticleData_2d: ', & 1974 &'Deallocating receive buffer.')")
1979 allocate(lrbuff(lbnd:ubnd,
recv_sum))
1983 if(
present(lout))
allocate(lout(lbnd:ubnd,
send_cnt))
1989 lsbuff = -9.87654321
1995 do lc1 = 1, cluster%ParticleCount
1998 lsbuff(lc3) = ldata(lc4,particle%ID)
2009 if(
present(lout)) lout(lc4,:) = lsbuff
2041 logical,
allocatable,
intent(inout) :: lrbuff(:)
2043 logical,
allocatable,
intent(inout),
optional :: lOut(:)
2046 integer,
allocatable :: lsbuff_i(:)
2048 integer,
allocatable :: lrbuff_i(:)
2056 INTEGER lc1, lc2, lc3
2062 if(
allocated(lrbuff))
then 2063 if(
mype == 0)
write(*,
"(3x,& 2064 &'Error in getClusterParticleData_1l: ',& 2065 &'Deallocating receive buffer.')")
2070 allocate(lrbuff(
recv_sum)); lrbuff = .false.
2072 if(
present(lout))
allocate(lout(
send_cnt))
2075 allocate(lrbuff_i(
recv_sum)); lrbuff_i = 0
2077 allocate(lsbuff_i(
send_cnt)); lsbuff_i = 0
2087 do lc1 = 1, cluster%ParticleCount
2091 if(is_ghost(particle%ID)) lsbuff_i(lc3) = 1
2102 if(lrbuff_i(lc1) == 1) lrbuff(lc1) = .true.
2106 if(
present(lout))
then 2109 if(lsbuff_i(lc1) == 1) lout(lc1) = .true.
2114 deallocate(lrbuff_i)
2115 deallocate(lsbuff_i)
2140 double precision,
intent(in) :: lData(:)
2142 double precision,
allocatable,
intent(inout) :: lrbuff(:)
2144 double precision,
allocatable,
intent(inout),
optional :: lOut(:)
2146 double precision,
allocatable :: lsbuff(:)
2154 integer lc1, lc2, lc3
2162 if(
allocated(lrbuff))
then 2163 if(
mype == 0)
write(*,
"(3x,& 2164 &'Error in getClusterFieldData_1d: ', & 2165 &'Deallocating receive buffer.')")
2174 if(
present(lout))
allocate(lout(
send_cnt))
2184 do lc1 = 1, cluster%ParticleCount
2188 ijk = pijk(particle%ID,4)
2194 lsbuff(lc3) = ldata(ijk)
2206 if(
present(lout)) lout = lsbuff
2236 double precision,
intent(in) :: lData_1(:)
2237 double precision,
intent(in) :: lData_2(:)
2238 double precision,
intent(in) :: lData_3(:)
2241 double precision,
allocatable,
intent(inout) :: lrbuff(:,:)
2243 double precision,
allocatable,
intent(inout),
optional :: lOut(:,:)
2245 double precision,
allocatable :: lsbuff(:)
2253 integer lc1, lc2, lc3
2261 if(
allocated(lrbuff))
then 2262 if(
mype == 0)
write(*,
"(3x,& 2263 &'Error in getClusterFieldData_3d: ', & 2264 &'Deallocating receive buffer.')")
2273 if(
present(lout))
allocate(lout(
send_cnt,1:3))
2278 lsbuff = -9.87654321
2284 do lc1 = 1, cluster%ParticleCount
2288 ijk = pijk(particle%ID,4)
2294 lsbuff(lc3) = ldata_1(ijk)
2304 if(
present(lout)) lout(:,1) = lsbuff
2307 lsbuff = -9.87654321
2313 do lc1 = 1, cluster%ParticleCount
2317 ijk = pijk(particle%ID,4)
2323 lsbuff(lc3) = ldata_2(ijk)
2333 if(
present(lout)) lout(:,2) = lsbuff
2337 lsbuff = -9.87654321
2343 do lc1 = 1, cluster%ParticleCount
2347 ijk = pijk(particle%ID,4)
2353 lsbuff(lc3) = ldata_3(ijk)
2363 if(
present(lout)) lout(:,3) = lsbuff
2393 double precision,
intent(in) :: lsbuff(:)
2395 double precision,
intent(inout) :: lData(:)
2398 double precision,
allocatable :: lrbuff(:)
2406 integer lc1, lc2, lc3
2425 do lc1 = 1, cluster%ParticleCount
2428 ldata(particle%ID) = lrbuff(lc3)
subroutine getclusterfielddata_1d(lData, lrbuff, lOut)
subroutine getclusterghostdata(lrbuff, lOut)
double precision, dimension(:), allocatable ep_g
subroutine gettopcluster(cluster)
subroutine delete_particles_in_cluster(cluster)
subroutine getclusterparticledata_2d(lData, lrbuff, lOut)
double precision, parameter undefined
subroutine addparticle(this, lMap, lID)
subroutine des_mpi_barrier
subroutine deletetopparticle_in_psearchhistory()
subroutine gettopparticle_in_psearchhistory(particle)
subroutine create_cluster(cluster)
subroutine add_particle_to_cluster(cluster, pID)
integer, parameter clusterpe
subroutine add_particle_to_psearchhistory(particle, pID)
type(particle_type), pointer psearch_history_ll
double precision, dimension(:), allocatable v_g
double precision, dimension(:), allocatable w_g
double precision, parameter large_number
subroutine dbg_print_clusters(lmsgID, lmsg, dbg)
subroutine getclusterparticledata_1d(lData, lrbuff, lOut)
double precision, dimension(:), allocatable mu_g
subroutine getnextcluster(cluster)
subroutine getclusterparticledata_2i(lData, lrbuff, lOut)
integer psearchhistorycount
double precision, dimension(:), allocatable u_g
type(cluster_type), pointer cluster_ll
<<----------------— DMP Related Variables -----------------—>>>!
integer, dimension(:), allocatable recv_cnt
subroutine getclusterparticledata_1i(lData, lrbuff, lOut)
subroutine getclusterfielddata_3d(lData_1, lData_2, lData_3, lrbuff, lOut)
subroutine delete_clusters()
subroutine getnextparticle(cluster, particle)
subroutine sendclusterdata_1d(lsbuff, lData)
subroutine finl_print_clusters(dbg_level)
subroutine print_clusters
subroutine delete_psearchhistory()
integer, dimension(:), allocatable recv_dsp
subroutine init_print_clusters(dbg_level)
double precision, dimension(:), allocatable ro_g
type(ctype), dimension(:), allocatable, target clusters
subroutine deletetopcluster(cluster)
double precision, parameter zero