36LOGICAL :: doatoms=.false.
41 INTEGER,
INTENT(IN) :: vid
53numth = omp_get_max_threads()
56if (
ns.ge.1 .and.
ns.lt.numth)
then
57 if (numth .ge. 2*(
ns-1))
then
64if (all_atoms) doatoms=.true.
67 if (
na.lt.numth) numth=
na
69 write (6, *)
"OpenMP on atoms, NUMTH= ",numth
71 call primitive_ring_search_atoms (rid, numth)
74 write (6, *)
"OpenMP on MD steps, NUMTH= ",numth
87SUBROUTINE primitive_ring_search_atoms (RID, NUMTH)
92INTEGER,
INTENT(IN) :: numth
93INTEGER,
INTENT(IN) :: rid
94INTEGER,
DIMENSION(:),
ALLOCATABLE :: tring, indte
95INTEGER,
DIMENSION(:,:,:),
ALLOCATABLE :: savring, ordring
96INTEGER,
DIMENSION(:,:,:),
ALLOCATABLE :: savr, ordr
98LOGICAL,
DIMENSION(2) :: fndtab
102 INTEGER,
INTENT(IN) :: idsearch
103 INTEGER,
DIMENSION(TAILLR, NS),
INTENT(IN) :: nri
105 INTEGER FUNCTION rings_to_ogl (STEP, IDSEARCH, NRI, RSAVED, OSAVED)
107 INTEGER,
INTENT(IN) :: step, idsearch
108 INTEGER,
DIMENSION(TAILLR,NS),
INTENT(IN) :: nri
109 INTEGER,
DIMENSION(TAILLR,NUMA,TAILLR),
INTENT(IN) :: rsaved, osaved
114if(
allocated(savring))
deallocate(savring)
115allocate(savring(taillr,numa,taillr), stat=err)
121if(
allocated(ordring))
deallocate(ordring)
122allocate(ordring(taillr,numa,taillr), stat=err)
128if(
allocated(cpat))
deallocate(cpat)
129allocate(cpat(nna), stat=err)
135 if(
allocated(vpat))
deallocate(vpat)
136allocate(vpat(nna,maxn), stat=err)
156 if(
allocated(matdist))
deallocate(matdist)
157 allocate(matdist(nna), stat=err)
163 if(
allocated(queue))
deallocate(queue)
164 allocate(queue(nna), stat=err)
170 if (
allocated(pringord))
deallocate(pringord)
171 allocate(pringord(numa*10,taillr), stat=err)
177 if (
allocated(npring))
deallocate(npring)
178 allocate(npring(nna), stat=err)
184 if(
allocated(res_list))
deallocate(res_list)
185 allocate(res_list(taillr), stat=err)
191 if(
allocated(savr))
deallocate(savr)
192 allocate(savr(taillr,numa,taillr), stat=err)
198 if(
allocated(ordr))
deallocate(ordr)
199 allocate(ordr(taillr,numa,taillr), stat=err)
205 if(
allocated(indte))
deallocate(indte)
206 allocate(indte(numa), stat=err)
211 if (
allocated(tring))
deallocate(tring)
212 allocate(tring(taillr), stat=err)
218 if(
allocated(apna))
deallocate(apna)
219 allocate(apna(taillr), stat=err)
231 if (tbr .or. alc)
goto 003
232 if (tlt .eq. nsp+1 .or. lot(j-nnp) .eq. tlt)
then
239 call dijkstra (j, cpat, vpat, queue, matdist)
240 if (tbr .or. alc)
goto 003
242 do k=1, taillr/2 + mod(taillr,2)
248 if (matdist(l) .eq. k)
then
249 call spath_rec (path,l,k,k,matdist,cpat,vpat,npring,pringord)
253 if (
allocated(querng))
deallocate(querng)
254 allocate(querng(h,2), stat=err)
271 if (pringord(m,o) .eq. pringord(n,p))
then
286 call prim_ring (fndtab, j, l, k, h, cpat, vpat, querng, pringord, matdist, &
287 savr, ordr, tring, indte, res_list)
288 if (tbr .or. alc)
goto 003
291 if (apna(m).eq.0)
then
300 if (apna(m).eq.0)
then
307 if (
allocated(querng))
deallocate(querng)
314 if (apna(k).eq.1 .and. apna(l).eq.1)
then
316 pna(k,l,i)=pna(k,l,i)+1
321 maxpna(maxat,i)=maxpna(maxat,i)+1
323 minpna(minat,i)=minpna(minat,i)+1
333 if (tbr .or. alc)
goto 002
337 if (tring(k).gt.0)
then
338 if (nring(k,i).gt.0)
then
344 if (savring(k,m,n) .ne. savr(k,l,n))
then
353 if (nring(k,i)+o .gt. numa)
then
358 savring(k,nring(k,i)+o,m) = savr(k,l,m)
359 ordring(k,nring(k,i)+o,m) = ordr(k,l,m)
363 nring(k,i)=nring(k,i)+o
367 savring(k,l,m) = savr(k,l,m)
368 ordring(k,l,m) = ordr(k,l,m)
371 nring(k,i) = tring(k)
381 if (
allocated(indte))
deallocate (indte)
382 if (
allocated(apna))
deallocate (apna)
383 if (
allocated(tring))
deallocate (tring)
384 if (
allocated(savr))
deallocate (savr)
385 if (
allocated(ordr))
deallocate (ordr)
386 if (
allocated(matdist))
deallocate(matdist)
387 if (
allocated(queue))
deallocate(queue)
388 if (
allocated(pringord))
deallocate(pringord)
392 if (alc .or. tbr)
goto 001
396 if (nring(k,i) .ne. 0)
then
425 call show_error (
"Impossible to allocate memory"//char(0), &
426 "Subroutine: PRIMITIVE_RING_SEARCH_ATOMS"//char(0),
"Table: "//alc_tab(1:len_trim(alc_tab))//char(0))
429if (
allocated(cpat))
deallocate (cpat)
430if (
allocated(vpat))
deallocate (vpat)
431if (
allocated(savring))
deallocate (savring)
432if (
allocated(ordring))
deallocate (ordring)
445INTEGER,
INTENT(IN) :: numth
452INTEGER,
INTENT(IN) :: RID
453INTEGER,
DIMENSION(:),
ALLOCATABLE :: TRING, INDTE
454INTEGER,
DIMENSION(:,:,:),
ALLOCATABLE :: SAVRING, ORDRING
456LOGICAL,
DIMENSION(2) :: FNDTAB
460 INTEGER,
INTENT(IN) :: IDSEARCH
461 INTEGER,
DIMENSION(TAILLR, NS),
INTENT(IN) :: NRI
463 INTEGER FUNCTION rings_to_ogl (STEP, IDSEARCH, NRI, RSAVED, OSAVED)
465 INTEGER,
INTENT(IN) :: STEP, IDSEARCH
466 INTEGER,
DIMENSION(TAILLR,NS),
INTENT(IN) :: NRI
467 INTEGER,
DIMENSION(TAILLR,NUMA,TAILLR),
INTENT(IN) :: RSAVED, OSAVED
483if(
allocated(matdist))
deallocate(matdist)
484allocate(matdist(nna), stat=err)
490if(
allocated(queue))
deallocate(queue)
491allocate(queue(nna), stat=err)
497if (
allocated(pringord))
deallocate(pringord)
498allocate(pringord(numa*10,taillr), stat=err)
504if (
allocated(npring))
deallocate(npring)
505allocate(npring(nna), stat=err)
511if(
allocated(cpat))
deallocate(cpat)
512allocate(cpat(nna), stat=err)
518if(
allocated(vpat))
deallocate(vpat)
519allocate(vpat(nna,maxn), stat=err)
525if(
allocated(res_list))
deallocate(res_list)
526allocate(res_list(taillr), stat=err)
532if(
allocated(savring))
deallocate(savring)
533allocate(savring(taillr,numa,taillr), stat=err)
539if(
allocated(ordring))
deallocate(ordring)
540allocate(ordring(taillr,numa,taillr), stat=err)
546if(
allocated(indte))
deallocate(indte)
547allocate(indte(numa), stat=err)
552if (
allocated(tring))
deallocate(tring)
553allocate(tring(taillr), stat=err)
559if(
allocated(apna))
deallocate(apna)
560allocate(apna(taillr), stat=err)
570 if (tbr .or. alc)
goto 002
578 if (tlt .eq. nsp+1 .or. lot(j-nnp) .eq. tlt)
then
585 call dijkstra(j, cpat, vpat, queue, matdist)
586 if (tbr .or. alc)
goto 002
588 do k=1, taillr/2 + mod(taillr,2)
594 if (matdist(l) .eq. k)
then
595 call spath_rec (path,l,k,k,matdist,cpat,vpat,npring,pringord)
599 if (
allocated(querng))
deallocate(querng)
600 allocate(querng(h,2), stat=err)
617 if (pringord(m,o) .eq. pringord(n,p))
then
632 call prim_ring (fndtab, j, l, k, h, cpat, vpat, querng, pringord, matdist, &
633 savring, ordring, tring, indte, res_list)
634 if (tbr .or. alc)
goto 002
637 if (apna(m).eq.0)
then
646 if (apna(m).eq.0)
then
653 if (
allocated(querng))
deallocate(querng)
660 if (apna(k).eq.1 .and. apna(m).eq.1)
then
661 pna(k,m,i)=pna(k,m,i)+1
665 maxpna(maxat,i)=maxpna(maxat,i)+1
666 minpna(minat,i)=minpna(minat,i)+1
674 nring(j,i) = tring(j)
682 if (nring(k,i) .ne. 0)
then
716 call show_error (
"Impossible to allocate memory"//char(0), &
717 "Subroutine: PRIMITIVE_RING_SEARCH_STEPS"//char(0),
"Table: "//alc_tab(1:len_trim(alc_tab))//char(0))
720if (
allocated(tring))
deallocate (tring)
721if (
allocated(savring))
deallocate (savring)
722if (
allocated(ordring))
deallocate (ordring)
723if (
allocated(cpat))
deallocate (cpat)
724if (
allocated(vpat))
deallocate (vpat)
725if (
allocated(indte))
deallocate (indte)
726if (
allocated(apna))
deallocate (apna)
727if(
allocated(matdist))
deallocate(matdist)
728if(
allocated(queue))
deallocate(queue)
729if (
allocated(pringord))
deallocate(pringord)
745INTEGER,
INTENT(IN) :: NODE
746INTEGER,
DIMENSION(NNA),
INTENT(INOUT) :: QUE, MATDIS
747INTEGER,
DIMENSION(NNA),
INTENT(IN) :: CPT
748INTEGER,
DIMENSION(NNA,MAXN),
INTENT(IN) :: VPT
749INTEGER :: QBEGIN, QEND, QID, AT1, AT2, DAT1
761do while (qbegin < qend)
770 if (matdis(at2) .gt. dat1)
then
788RECURSIVE SUBROUTINE spath_rec (PTH, NODE, LENGTH, LNGTH, MATDIS, CPT, VPT, NPRI, PORDR)
794INTEGER,
INTENT(INOUT) :: pth
795INTEGER,
INTENT(IN) :: node, length, lngth
796INTEGER,
DIMENSION(NNA),
INTENT(IN) :: cpt, matdis
797INTEGER,
DIMENSION(NNA,MAXN),
INTENT(IN) :: vpt
798INTEGER,
DIMENSION(NNA),
INTENT(INOUT) :: npri
799INTEGER,
DIMENSION(NUMA*10,TAILLR),
INTENT(INOUT) :: pordr
800INTEGER :: distnn, idv, vdi, idt
811 if (distnn .eq. 0)
then
815 pordr(pth,idt)=npri(idt)
818 elseif (distnn .eq. length-1)
then
820 call spath_rec (pth, vdi, distnn, lngth, matdis, cpt, vpt, npri, pordr)
831INTEGER,
INTENT(IN) :: ind, nats
838SUBROUTINE prim_ring (FNDTAB, NODE, PTH, LGTH, NPT, CPT, VPT, QRNG, PORD, MATDIS, &
839 RSAVED, OSAVED, TRIN, INDP, RESLP)
845LOGICAL,
DIMENSION(2),
INTENT(INOUT) :: FNDTAB
846INTEGER,
INTENT(IN) :: NODE, PTH, LGTH, NPT
847INTEGER,
DIMENSION(NNA),
INTENT(IN) :: CPT, MATDIS
848INTEGER,
DIMENSION(TAILLR),
INTENT(INOUT) :: TRIN
849INTEGER,
DIMENSION(NNA,MAXN),
INTENT(IN) :: VPT
850INTEGER,
DIMENSION(NPT,2),
INTENT(IN) :: QRNG
851INTEGER,
DIMENSION(NUMA*10,TAILLR),
INTENT(INOUT) :: PORD
852INTEGER,
DIMENSION(TAILLR,NUMA,TAILLR),
INTENT(INOUT) :: RSAVED, OSAVED
853INTEGER,
DIMENSION(NUMA),
INTENT(INOUT) :: INDP
854INTEGER,
DIMENSION(TAILLR),
INTENT(INOUT) :: RESLP
855INTEGER :: RM, RN, PR, PTH1, PTH2, IRS, IRX
856INTEGER :: ATB, ATA, ATC, ATD, ATE, MAXD, MIND
858INTEGER,
DIMENSION(TAILLR) :: TOPRIM, PRIMTO
859LOGICAL:: GOAL, TOSAVE
860LOGICAL,
DIMENSION(NNA) :: CHK
863 INTEGER,
INTENT(IN) :: IND, NATS
881 if (ate .eq. atb) probe=1
884 if (ata .eq. atb .or. probe .eq. 1)
then
887 do rn=rm, lgth-1+probe
891 maxd=matdis(atc)+matdis(atd)
892 mind=2*lgth+probe-maxd
895 call pair_search (goal, atc, atd, 1, maxd, mind, cpt, vpt, chk)
905 do rm=rn, lgth-1+probe
909 maxd=matdis(atc)+matdis(atd)
910 mind=2*lgth+probe-maxd
913 call pair_search (goal, atc, atd, 1, maxd, mind, cpt, vpt, chk)
922 if ((probe.eq.0 .and. 2*lgth.le.
taillr) .or. (probe.eq.1 .and. 2*lgth.lt.
taillr))
then
927 toprim(irx)=pord(pth1,irx)
929 if (probe .eq. 1) toprim(lgth+1)=pord(pth2,lgth)
933 toprim(irs)=pord(pth2,irx)
938 do irx=1, 2*lgth+probe
943 if (probe .eq. 0)
then
952 if (tosave .and. lgth*2+probe.le.
taillr)
then
955 call strong_rings (fndtab, lgth, probe, toprim, primto, rsaved, osaved, trin, indp, reslp, cpt, vpt)
958 fndtab(1+probe)=.true.
960 if (
tbr .or.
alc)
goto 002
976RECURSIVE SUBROUTINE pair_search (GOAL, AT1, AT2, LG, MAXM, MINM, CPT, VPT, CHK)
982LOGICAL,
INTENT(INOUT) :: goal
983INTEGER,
INTENT(IN) :: at1, at2, lg, maxm, minm
984INTEGER,
DIMENSION(NNA),
INTENT(IN) :: cpt
985INTEGER,
DIMENSION(NNA,MAXN),
INTENT(IN) :: vpt
986LOGICAL,
DIMENSION(NNA),
INTENT(INOUT) :: chk
991if (at1 .eq. at2)
then
1001 if (.not.chk(at3))
then
1003 if (at3.eq.at2)
then
1008 elseif (lg.lt.maxm-1 .and. lg.lt.minm-1)
then
1010 call pair_search (goal, at3, at2, lg+1, maxm, minm, cpt, vpt, chk)
1030SUBROUTINE strong_rings (FNDTAB, RLGTH, RPROBE, TOPRIM, PRIMTO, ASRING, OSRING, TRNG, INDT, RESL, CPT, VPT)
1036LOGICAL,
DIMENSION(2),
INTENT(INOUT) :: FNDTAB
1037INTEGER,
INTENT(IN) :: RLGTH, RPROBE
1038INTEGER,
DIMENSION(TAILLR),
INTENT(IN) :: TOPRIM, PRIMTO
1039INTEGER,
DIMENSION(TAILLR,NUMA,TAILLR),
INTENT(INOUT) :: ASRING, OSRING
1040INTEGER,
DIMENSION(NUMA),
INTENT(INOUT) :: INDT
1041INTEGER,
DIMENSION(TAILLR),
INTENT(INOUT) :: TRNG, RESL
1042INTEGER,
DIMENSION(NNA),
INTENT(IN) :: CPT
1043INTEGER,
DIMENSION(NNA,MAXN),
INTENT(IN) :: VPT
1044INTEGER :: RM, RN, STLGT
1045LOGICAL,
DIMENSION(NNA) :: CHKS
1048LOGICAL :: SGOAL=.false.
1049LOGICAL :: FGOAL=.false.
1060 call search_strong_rings (dvstr, rm, rn, stlgt, stlgt, sgoal, fgoal, toprim, cpt, vpt, chks)
1061 if (
tbr .or.
alc)
goto 002
1072fndtab(1+rprobe)=.true.
1074if (
tbr .or.
alc)
goto 002
1080RECURSIVE SUBROUTINE search_strong_rings (DLOW, IDX, IDY, DLGTR, LGTR, SRGOAL, FRGOAL, TOTER, CPT, VPT, CHKS)
1086INTEGER,
INTENT(IN) :: dlgtr, lgtr, idx, idy
1087LOGICAL,
INTENT(INOUT) :: dlow, srgoal, frgoal
1088INTEGER,
DIMENSION(DLGTR),
INTENT(IN) :: toter
1089INTEGER,
DIMENSION(NNA),
INTENT(IN) :: cpt
1090INTEGER,
DIMENSION(NNA,MAXN),
INTENT(IN) :: vpt
1091LOGICAL,
DIMENSION(NNA),
INTENT(INOUT) :: chks
1092INTEGER :: dxy, dyx, dtest, dmin
1093INTEGER :: rg, rf, rh, rj, rl, ro, rp, rq, rr
1094INTEGER :: nbpath, idz
1095INTEGER,
DIMENSION(:),
ALLOCATABLE :: strst, newter
1096INTEGER,
DIMENSION(:,:),
ALLOCATABLE :: totpath
1097LOGICAL,
DIMENSION(:),
ALLOCATABLE :: cutring
1098LOGICAL,
DIMENSION(NNA) :: chk
1099TYPE(
ring),
TARGET :: st_ring
1100TYPE(
ring),
POINTER :: sring, tmp_ri
1103 RECURSIVE SUBROUTINE path_search (AT0,AT1,AT2,IDT1,IDT2,DMAX,DMED,DARING,NPATH,DLPATH, &
1104 STPATH,ACRING,TPATH,CUTPATH,CPT,VPT,CHK,CHKS,SRING)
1106 INTEGER,
INTENT(IN) :: at0, at1, at2, idt1, idt2, dmax, dmed, daring
1107 INTEGER,
INTENT(INOUT) :: npath
1108 LOGICAL,
INTENT(INOUT) :: dlpath
1109 INTEGER,
DIMENSION(DMAX*DMAX),
INTENT(INOUT) :: stpath
1110 INTEGER,
DIMENSION(DMAX*DMAX,DMAX),
INTENT(INOUT) :: tpath
1111 INTEGER,
DIMENSION(DMED),
INTENT(IN) :: acring
1112 INTEGER,
DIMENSION(NNA),
INTENT(IN) :: cpt
1113 INTEGER,
DIMENSION(NNA,MAXN),
INTENT(IN) :: vpt
1114 LOGICAL,
DIMENSION(DMAX*DMAX),
INTENT(INOUT) :: cutpath
1115 LOGICAL,
DIMENSION(NNA),
INTENT(INOUT) :: chk, chks
1116 TYPE (
ring),
POINTER,
INTENT(INOUT) :: sring
1120 INTEGER,
INTENT(IN) :: ida, idb, idc, dlt
1121 INTEGER,
DIMENSION(DLT),
INTENT(IN) :: tabab
1122 TYPE(
ring),
POINTER,
INTENT(INOUT) :: sring
1126 TYPE (
ring),
INTENT(INOUT) :: ring_init
1127 INTEGER,
INTENT(IN) :: elem_cr
1129 SUBROUTINE do_ring (THE_RING, ELEM_DO)
1131 TYPE (
ring),
POINTER,
INTENT(INOUT) :: the_ring
1132 INTEGER,
INTENT(IN) :: elem_do
1137 chks(toter(rg))=.true.
1154 if (
allocated(totpath))
deallocate(totpath)
1155 allocate(totpath(rj*rj,rj), stat=err)
1156 if (err .ne. 0)
then
1161 if (
allocated(cutring))
deallocate(cutring)
1162 allocate(cutring(rj*rj), stat=err)
1163 if (err .ne. 0)
then
1168 if (
allocated(strst))
deallocate(strst)
1169 allocate(strst(rj*rj), stat=err)
1170 if (err .ne. 0)
then
1191 call path_search (toter(idx),toter(idx),toter(idy),idx,idy,rj,dlgtr,lgtr,nbpath,dlow, &
1192 strst,toter,totpath,cutring,cpt,vpt,chk,chks,sring)
1194 if (nbpath .ne. 0)
then
1199 if (cutring(rh))
then
1201 if (toter(rg) .eq. strst(rh))
then
1210 if (.not.cutring(rh))
then
1215 call do_ring (sring, totpath(rh,rg))
1218 if (dxy .le. dyx)
then
1220 call do_ring (sring, toter(rg))
1224 call do_ring (sring, toter(rg))
1228 do rg=idy-1, idx, -1
1229 call do_ring (sring, toter(rg))
1237 call do_ring (sring, toter(rg))
1240 chks(totpath(rh,1))=.true.
1256 if (sring%SPEC+1 .lt. lgtr)
then
1260 tmp_ri => tmp_ri%PAST
1261 deallocate (tmp_ri%NEXT)
1272 if (chks(rg)) rf=rf+1
1274 if (rf .eq. nna)
then
1278 tmp_ri => tmp_ri%PAST
1279 deallocate (tmp_ri%NEXT)
1288 if (
allocated(newter))
deallocate(newter)
1289 allocate(newter(rr), stat=err)
1290 if (err .ne. 0)
then
1298 newter(rr-rg+1)=tmp_ri%ATOM
1299 if (rg .lt. rr)
then
1300 tmp_ri => tmp_ri%PAST
1301 deallocate (tmp_ri%NEXT)
1307 if (dmin .eq. 1)
then
1323 if (dmin .eq. 1)
then
1334 call search_strong_rings (dlow, rg, rf, rr, lgtr, srgoal, frgoal, newter, cpt, vpt, chks)
1335 if (tbr .or. alc)
goto 001
1336 if (srgoal .or. frgoal)
goto 001
1338 chks(toter(rl))=.true.
1340 if (idz.eq.0 .and. cutring(rh)) chks(totpath(rh,1))=.true.
1345 if (
allocated(newter))
deallocate(newter)
1351 if (idz.eq.0 .and. cutring(rh)) chks(totpath(rh,1))=.false.
1361 if (
allocated(totpath))
deallocate(totpath)
1362 if (
allocated(cutring))
deallocate(cutring)
1363 if (
allocated(strst))
deallocate(strst)
1371if (
allocated(totpath))
deallocate(totpath)
1372if (
allocated(cutring))
deallocate(cutring)
1373if (
allocated(strst))
deallocate(strst)
1374if (
allocated(newter))
deallocate(newter)
1377 chks(toter(rg))=.false.
1382RECURSIVE SUBROUTINE path_search (AT0,AT1,AT2,IDT1,IDT2,DMAX,DMED,DARING,NPATH,DLPATH, &
1383 STPATH,ACRING,TPATH,CUTPATH,CPT,VPT,CHK,CHKS,SRING)
1387INTEGER,
INTENT(IN) :: at0, at1, at2, idt1, idt2, dmax, dmed, daring
1388INTEGER,
INTENT(INOUT) :: npath
1389LOGICAL,
INTENT(INOUT) :: dlpath
1390INTEGER,
DIMENSION(DMAX*DMAX),
INTENT(INOUT) :: stpath
1391INTEGER,
DIMENSION(DMAX*DMAX,DMAX),
INTENT(INOUT) :: tpath
1392INTEGER,
DIMENSION(DMED),
INTENT(IN) :: acring
1393INTEGER,
DIMENSION(NNA),
INTENT(IN) :: cpt
1394INTEGER,
DIMENSION(NNA,MAXN),
INTENT(IN) :: vpt
1395LOGICAL,
DIMENSION(DMAX*DMAX),
INTENT(INOUT) :: cutpath
1396LOGICAL,
DIMENSION(NNA),
INTENT(INOUT) :: chk, chks
1397TYPE (
ring),
POINTER,
INTENT(INOUT) :: sring
1399INTEGER :: at3, at4, at5, at6, at7
1400INTEGER :: duv, duw, dvw
1401LOGICAL :: val1, val2
1403TYPE (
ring),
POINTER :: tmpr
1406 SUBROUTINE do_ring (THE_RING, ELEM_DO)
1408 TYPE (
ring),
POINTER,
INTENT(INOUT) :: the_ring
1409 INTEGER,
INTENT(IN) :: elem_do
1415if (at1.eq.at2 .and. sring%SPEC.eq.dmax)
then
1421 tpath(npath,dmax-at3+1)=tmpr%ATOM
1422 if (at3 .lt. dmax) tmpr => tmpr%PAST
1430 if (.not.chk(at3))
then
1434 if (at3 .eq. at2 .and. sring%SPEC.eq.dmax)
then
1439 tpath(npath,dmax-at5+1)=tmpr%ATOM
1440 if (at5 .lt. dmax) tmpr => tmpr%PAST
1443 elseif (sring%SPEC.lt.dmax .and. .not.chks(at3))
then
1451 if (at6 .eq. at0) val1=.true.
1452 if (at6 .eq. at2) val2=.true.
1455 if (at6.ne.at0 .and. at6.ne.at2) stpath(npath+1)=at6
1460 if (acring(at5) .eq. stpath(npath+1))
then
1465 if (at7 .eq. 0)
then
1467 elseif (at7.eq.1 .and. val1 .and. .not.val2)
then
1469 elseif (at7.eq.1 .and. val2 .and. .not.val1)
then
1471 elseif (at7.eq.1 .and. .not.val1 .and. .not.val2)
then
1473 elseif (at7.eq.2 .and. val1 .and. val2 .and. dmax.eq.2)
then
1475 elseif (at7.gt.2 .and. val1 .and. val2 .and. dmax.eq.2)
then
1479 if (at6 .ne. 0)
then
1480 if (at6 .lt. idt1)
then
1484 elseif(at6 .lt. idt2)
then
1488 elseif(at6 .gt. idt2)
then
1493 if (duv.lt.daring-1 .and. duw.lt.daring-1)
then
1494 cutpath(npath+1)=.true.
1496 elseif (dvw.lt.daring-1 .and. duw.lt.daring-1)
then
1497 cutpath(npath+1)=.true.
1499 elseif (duv.lt.daring-1 .and. dvw.lt.daring-1)
then
1500 cutpath(npath+1)=.true.
1506 cutpath(npath+1)=.true.
1513 if (.not.touch)
then
1514 call path_search (at0,at3,at2,idt1,idt2,dmax,dmed,daring,npath,dlpath, &
1515 stpath,acring,tpath,cutpath,cpt,vpt,chk,chks,sring)
1520 deallocate (sring%NEXT)
1539INTEGER,
INTENT(IN) :: IDA, IDB, IDC, DLT
1540INTEGER,
DIMENSION(DLT),
INTENT(IN) :: TABAB
1541TYPE(
ring),
POINTER,
INTENT(INOUT) :: SRING
1543INTEGER :: LXY, LXZ, LYZ
1546 SUBROUTINE do_ring (THE_RING, ELEM_DO)
1548 TYPE (RING),
POINTER,
INTENT(INOUT) :: THE_RING
1549 INTEGER,
INTENT(IN) :: ELEM_DO
1553if (ida .gt. idc)
then
1558 if (lxy .gt. lyz)
then
1559 if (lxy .gt. lxz)
then
1561 call do_ring (sring, tabab(idd))
1566 call do_ring (sring, tabab(idd))
1571 if (lxz .gt. lyz)
then
1573 call do_ring (sring, tabab(idd))
1578 call do_ring (sring, tabab(idd))
1582 call do_ring (sring, tabab(idd))
1589 if (idc .gt. idb)
then
1595 if (lxy .gt. lyz)
then
1596 if (lxy .gt. lxz)
then
1598 call do_ring (sring, tabab(idd))
1603 call do_ring (sring, tabab(idd))
1607 call do_ring (sring, tabab(idd))
1612 if (lyz .ge. lxz)
then
1614 call do_ring (sring, tabab(idd))
1619 call do_ring (sring, tabab(idd))
1630 if (lxy .gt. lyz)
then
1631 if (lxy .gt. lxz)
then
1633 call do_ring (sring, tabab(idd))
1637 call do_ring (sring, tabab(idd))
1642 call do_ring (sring, tabab(idd))
1647 if (lyz .gt. lxz)
then
1649 call do_ring (sring, tabab(idd))
1654 call do_ring (sring, tabab(idd))
1672LOGICAL,
INTENT(INOUT) :: VALTEST
1673INTEGER,
INTENT(IN) :: LGTEST
1674INTEGER,
DIMENSION(TAILLR),
INTENT(IN) :: PRIMT
1675INTEGER :: LTA, LTB, LTC, LTD
1681if (lta .ne. ltb)
then
1684 if (mod(ltd,2).eq.0 .and. ltc.ne.ltb)
then
1687 elseif (mod(ltd,2).ne.0 .and. ltc.ne.lta)
then
1704LOGICAL,
INTENT(INOUT) :: VALTEST
1705INTEGER,
INTENT(IN) :: LGTEST
1706INTEGER,
DIMENSION(TAILLR),
INTENT(IN) :: PRIMT
1712 if (lta .eq. 2*lgtest) ltb=1
1713 if (
lot(primt(lta)) .eq.
lot(primt(ltb)))
then
1727INTEGER,
DIMENSION(TAILLR),
INTENT(IN) :: TAB
1728INTEGER,
INTENT(IN) :: TLES
1729INTEGER,
DIMENSION(TAILLR,NUMA,TAILLR),
INTENT(INOUT) :: RSAVED, OSAVED
1730INTEGER,
DIMENSION(NUMA),
INTENT(INOUT) :: INDT
1731INTEGER,
DIMENSION(TAILLR),
INTENT(INOUT) :: RESL, TRING
1734INTEGER,
DIMENSION(TLES) :: TOTRI, TOSAV
1742 totri(idx)= tab(idx)
1743 tosav(idx)= tab(idx)
1747call tri(totri, tles)
1749if (tring(tles) .ne. 0)
then
1751 do idx=1, tring(tles)
1757 if (totri(idy) .ne. rsaved(tles,idx,idy))
then
1763 if (.not.newring)
then
1766 indt(idx)=indt(idx)+1
1783 resl(tles)=resl(tles)+1
1784 tring(tles)=tring(tles)+1
1785 if (tring(tles) .gt.
numa)
then
1789 indt(tring(tles))=indt(tring(tles))+1
1791 rsaved(tles,tring(tles),idx)=totri(idx)
1792 osaved(tles,tring(tles),idx)=tosav(idx)
void show_error(char *error, int val, GtkWidget *win)
show error message
integer, dimension(:), allocatable lot
integer function recrings(vid)
subroutine setup_cpat_vpat_ring(nat, str, cont, vois, cpt, vpt)
subroutine save_dijkstra_ring(tab, tles, rsaved, osaved, tring, indt, resl)
subroutine testabab(valtest, lgtest, primt)
subroutine dijkstra(node, cpt, vpt, que, matdis)
integer function primitive_rings()
recursive subroutine pair_search(goal, at1, at2, lg, maxm, minm, cpt, vpt, chk)
recursive subroutine search_strong_rings(dlow, idx, idy, dlgtr, lgtr, srgoal, frgoal, toter, cpt, vpt, chks)
subroutine primitive_ring_search_steps(rid)
subroutine testhomo(valtest, lgtest, primt)
subroutine strong_rings(fndtab, rlgth, rprobe, toprim, primto, asring, osring, trng, indt, resl, cpt, vpt)
recursive subroutine spath_rec(pth, node, length, lngth, matdis, cpt, vpt, npri, pordr)
integer function real_atom_id(ind, nats)
subroutine shortcut_ring(ida, idb, idc, dlt, tabab, sring)
recursive subroutine path_search(at0, at1, at2, idt1, idt2, dmax, dmed, daring, npath, dlpath, stpath, acring, tpath, cutpath, cpt, vpt, chk, chks, sring)
subroutine prim_ring(fndtab, node, pth, lgth, npt, cpt, vpt, qrng, pord, matdis, rsaved, osaved, trin, indp, reslp)
integer function rings_to_ogl(step, idsearch, nri, rsaved, osaved)
integer function rings_to_ogl_menu(idsearch, nri)
subroutine do_ring(the_ring, elem_do)
subroutine creat_ring(ring_init, elem_cr)
subroutine tri(tab, dimtab)