37 INTEGER,
INTENT(IN) :: vid
44numth = omp_get_max_threads()
47if (
ns.ge.1 .and.
ns.lt.numth)
then
48 if (numth .ge. 2*(
ns-1))
then
55if (all_atoms) doatoms=.true.
58 if (
na.lt.numth) numth=
na
60 write (6, *)
"OpenMP on atoms, NUMTH= ",numth
62 call guttman_ring_search_atoms (numth)
65 write (6, *)
"OpenMP on MD steps, NUMTH= ",numth
78SUBROUTINE guttman_ring_search_atoms (NUMTH)
85INTEGER,
INTENT(IN) :: numth
86TYPE (
ring),
DIMENSION(:),
ALLOCATABLE :: the_ring
87INTEGER,
DIMENSION(:),
ALLOCATABLE :: tring, indte, indth
88INTEGER,
DIMENSION(:,:,:),
ALLOCATABLE :: savring, ordring
89INTEGER,
DIMENSION(:,:,:),
ALLOCATABLE :: savr, ordr
90INTEGER :: lora, lorb, lorc, ri
93 RECURSIVE SUBROUTINE inside_ring (THE_RING, FND, S_IR, AI_IR, RID, TAE, TAH, LRA, LRB, &
94 NRPAT, RSAVED, OSAVED, TRING, INDE, INDH, RESL, CPT, VPT)
96 TYPE (
ring),
DIMENSION(TAILLD),
INTENT(INOUT) :: the_ring
97 LOGICAL,
INTENT(INOUT) :: fnd
98 INTEGER,
INTENT(IN) :: s_ir, ai_ir, rid
99 INTEGER,
INTENT(INOUT) :: tae, tah
100 INTEGER,
INTENT(IN) :: lra, lrb
101 INTEGER,
DIMENSION(NA),
INTENT(INOUT) :: nrpat
102 INTEGER,
DIMENSION(TAILLR,NUMA,TAILLR),
INTENT(INOUT) :: rsaved, osaved
103 INTEGER,
DIMENSION(TAILLR),
INTENT(INOUT) :: tring
104 INTEGER,
DIMENSION(NUMA),
INTENT(INOUT) :: inde, indh
105 INTEGER,
DIMENSION(TAILLR),
INTENT(INOUT) :: resl
106 INTEGER,
DIMENSION(NA),
INTENT(IN):: cpt
107 INTEGER,
DIMENSION(NA,MAXN),
INTENT(IN) :: vpt
111 INTEGER,
INTENT(IN) :: idsearch
112 INTEGER,
DIMENSION(TAILLR, NS),
INTENT(IN) :: nri
114 INTEGER FUNCTION rings_to_ogl (STEP, IDSEARCH, NRI, RSAVED, OSAVED)
116 INTEGER,
INTENT(IN) :: step, idsearch
117 INTEGER,
DIMENSION(TAILLR,NS),
INTENT(IN) :: nri
118 INTEGER,
DIMENSION(TAILLR,NUMA,TAILLR),
INTENT(IN) :: rsaved, osaved
120 SUBROUTINE del_this_ring (TLED, RSAVED, OSAVED, TRING, RESL, INDT)
122 INTEGER,
INTENT(IN) :: tled
123 INTEGER,
DIMENSION(TAILLR,NUMA,TAILLR),
INTENT(INOUT) :: rsaved, osaved
124 INTEGER,
DIMENSION(NUMA),
INTENT(INOUT) :: indt
125 INTEGER,
DIMENSION(TAILLR),
INTENT(INOUT) :: resl, tring
130if(
allocated(savring))
deallocate(savring)
131allocate(savring(taillr,numa,taillr), stat=err)
137if(
allocated(ordring))
deallocate(ordring)
138allocate(ordring(taillr,numa,taillr), stat=err)
144if(
allocated(cpat))
deallocate(cpat)
145allocate(cpat(na), stat=err)
151 if(
allocated(vpat))
deallocate(vpat)
152allocate(vpat(na,maxn), stat=err)
176 if (
allocated(rpat))
deallocate(rpat)
177 allocate(rpat(na), stat=err)
183 if(
allocated(res_list))
deallocate(res_list)
184 allocate(res_list(taillr), stat=err)
190 if(
allocated(indte))
deallocate(indte)
191 allocate(indte(numa), stat=err)
196 if(
allocated(indth))
deallocate(indth)
197 allocate(indth(numa), stat=err)
202 if(
allocated(apna))
deallocate(apna)
203 allocate(apna(taillr), stat=err)
209 if(
allocated(savr))
deallocate(savr)
210 allocate(savr(taillr,numa,taillr), stat=err)
216 if(
allocated(ordr))
deallocate(ordr)
217 allocate(ordr(taillr,numa,taillr), stat=err)
223 if(
allocated(tring))
deallocate(tring)
224 allocate(tring(taillr), stat=err)
230 if(
allocated(the_ring))
deallocate(the_ring)
231 allocate(the_ring(tailld), stat=err)
244 if (tbr .or. alc)
goto 003
245 if (tlt .eq. nsp+1 .or. lot(j) .eq. tlt)
then
256 if (cpat(j).ge.2)
then
263 if (lora .ne. lorb)
then
277 the_ring(1)%SPEC=lora
278 the_ring(1)%NEIGHBOR=1
282 the_ring(2)%SPEC=lorb
283 the_ring(2)%NEIGHBOR=cpat(m)
289 call inside_ring (the_ring, found, i, m, 2, taille, taillh, lorb, lora, &
290 rpat, savr, ordr, tring, indte, indth, res_list, cpat, vpat)
291 if (alc) alc_tab=
"INSIDE_RING"
292 if (tbr .or. alc)
goto 003
294 if (apna(taille) .eq. 0)
then
296 minat=
min(minat,taille)
297 maxat=
max(maxat,taille)
301 elseif (no_homo .and. res_list(taillh) .ne. 0)
then
304 call del_this_ring (taillh, savr, ordr, tring, res_list, indth)
306 if (contj(j,i) .ge. 2 .and. contj(m,i) .ge. 2)
then
308 ampat(o,i)=ampat(o,i)+1
319 if (apna(k).eq.1 .and. apna(l).eq.1)
then
321 pna(k,l,i)=pna(k,l,i)+1
326 maxpna(maxat,i)=maxpna(maxat,i)+1
328 minpna(minat,i)=minpna(minat,i)+1
334 if (tring(k).gt.0)
then
335 if (nring(k,i).gt.0)
then
341 if (savring(k,m,n) .ne. savr(k,l,n))
then
350 if (nring(k,i)+o .gt. numa)
then
355 savring(k,nring(k,i)+o,m) = savr(k,l,m)
356 ordring(k,nring(k,i)+o,m) = ordr(k,l,m)
360 nring(k,i)=nring(k,i)+o
364 savring(k,l,m) = savr(k,l,m)
365 ordring(k,l,m) = ordr(k,l,m)
368 nring(k,i) = tring(k)
381 if (
allocated(rpat))
deallocate (rpat)
382 if (
allocated(res_list))
deallocate (res_list)
383 if (
allocated(indte))
deallocate (indte)
384 if (
allocated(indth))
deallocate (indth)
385 if (
allocated(apna))
deallocate (apna)
386 if (
allocated(tring))
deallocate (tring)
387 if (
allocated(savr))
deallocate (savr)
388 if (
allocated(ordr))
deallocate (ordr)
389 if (
allocated(the_ring))
deallocate (the_ring)
391 if (alc .or. tbr)
goto 001
408 call show_error (
"Impossible to allocate memory"//char(0), &
409 "Subroutine: GUTTMAN_RING_SEARCH_ATOMS"//char(0),
"Table: "//alc_tab(1:len_trim(alc_tab))//char(0))
412if (
allocated(cpat))
deallocate (cpat)
413if (
allocated(vpat))
deallocate (vpat)
414if (
allocated(savring))
deallocate (savring)
415if (
allocated(ordring))
deallocate (ordring)
428INTEGER,
INTENT(IN) :: numth
435TYPE (RING),
DIMENSION(:),
ALLOCATABLE :: THE_RING
436INTEGER,
DIMENSION(:),
ALLOCATABLE :: TRING, INDTE, INDTH
437INTEGER,
DIMENSION(:,:,:),
ALLOCATABLE :: SAVRING, ORDRING
438INTEGER :: LORA, LORB, ri
441 RECURSIVE SUBROUTINE inside_ring (THE_RING, FND, S_IR, AI_IR, RID, TAE, TAH, LRA, LRB, &
442 NRPAT, RSAVED, OSAVED, TRING, INDE, INDH, RESL, CPT, VPT)
444 TYPE (RING),
DIMENSION(TAILLD),
INTENT(INOUT) :: THE_RING
445 LOGICAL,
INTENT(INOUT) :: FND
446 INTEGER,
INTENT(IN) :: S_IR, AI_IR, RID
447 INTEGER,
INTENT(INOUT) :: TAE, TAH
448 INTEGER,
INTENT(IN) :: LRA, LRB
449 INTEGER,
DIMENSION(NA),
INTENT(INOUT) :: NRPAT
450 INTEGER,
DIMENSION(TAILLR,NUMA,TAILLR),
INTENT(INOUT) :: RSAVED, OSAVED
451 INTEGER,
DIMENSION(TAILLR),
INTENT(INOUT) :: TRING
452 INTEGER,
DIMENSION(NUMA),
INTENT(INOUT) :: INDE, INDH
453 INTEGER,
DIMENSION(TAILLR),
INTENT(INOUT) :: RESL
454 INTEGER,
DIMENSION(NA),
INTENT(IN):: CPT
455 INTEGER,
DIMENSION(NA,MAXN),
INTENT(IN) :: VPT
459 INTEGER,
INTENT(IN) :: IDSEARCH
460 INTEGER,
DIMENSION(TAILLR, NS),
INTENT(IN) :: NRI
462 INTEGER FUNCTION rings_to_ogl (STEP, IDSEARCH, NRI, RSAVED, OSAVED)
464 INTEGER,
INTENT(IN) :: STEP, IDSEARCH
465 INTEGER,
DIMENSION(TAILLR,NS),
INTENT(IN) :: NRI
466 INTEGER,
DIMENSION(TAILLR,NUMA,TAILLR),
INTENT(IN) :: RSAVED, OSAVED
468 SUBROUTINE del_this_ring (TLED, RSAVED, OSAVED, TRING, RESL, INDT)
470 INTEGER,
INTENT(IN) :: TLED
471 INTEGER,
DIMENSION(TAILLR,NUMA,TAILLR),
INTENT(INOUT) :: RSAVED, OSAVED
472 INTEGER,
DIMENSION(NUMA),
INTENT(INOUT) :: INDT
473 INTEGER,
DIMENSION(TAILLR),
INTENT(INOUT) :: RESL, TRING
490if(
allocated(savring))
deallocate(savring)
491allocate(savring(taillr,numa,taillr), stat=err)
497if(
allocated(ordring))
deallocate(ordring)
498allocate(ordring(taillr,numa,taillr), stat=err)
504if(
allocated(cpat))
deallocate(cpat)
505allocate(cpat(na), stat=err)
511if(
allocated(vpat))
deallocate(vpat)
512allocate(vpat(na,maxn), stat=err)
518if (
allocated(rpat))
deallocate(rpat)
519allocate(rpat(na), stat=err)
525if(
allocated(res_list))
deallocate(res_list)
526allocate(res_list(taillr), stat=err)
532if(
allocated(indte))
deallocate(indte)
533allocate(indte(numa), stat=err)
538if(
allocated(indth))
deallocate(indth)
539allocate(indth(numa), stat=err)
544if(
allocated(apna))
deallocate(apna)
545allocate(apna(taillr), stat=err)
551if(
allocated(tring))
deallocate(tring)
552allocate(tring(taillr), stat=err)
558if(
allocated(the_ring))
deallocate(the_ring)
559allocate(the_ring(tailld), stat=err)
571 if (tbr .or. alc)
goto 002
580 if (tlt .eq. nsp+1 .or. lot(j) .eq. tlt)
then
588 if (cpat(j).ge.2)
then
595 if (lora .ne. lorb)
then
608 the_ring(1)%SPEC=lora
609 the_ring(1)%NEIGHBOR=1
613 the_ring(2)%SPEC=lorb
614 the_ring(2)%NEIGHBOR=cpat(m)
620 call inside_ring (the_ring, found, i, m, 2, taille, taillh, lorb, lora, &
621 rpat, savring, ordring, tring, indte, indth, res_list, cpat, vpat)
622 if (alc) alc_tab=
"INSIDE_RING"
623 if (tbr .or. alc)
goto 002
625 if (apna(taille) .eq. 0)
then
627 minat=
min(minat,taille)
628 maxat=
max(maxat,taille)
632 elseif (no_homo .and. res_list(taillh) .ne. 0)
then
635 call del_this_ring (taillh, savring, ordring, tring, res_list, indth)
637 if (contj(j,i) .ge. 2 .and. contj(m,i) .ge. 2) ampat(o,i)=ampat(o,i)+1
647 if (apna(k).eq.1 .and. apna(l).eq.1)
then
648 pna(k,l,i)=pna(k,l,i)+1
652 maxpna(maxat,i)=maxpna(maxat,i)+1
653 minpna(minat,i)=minpna(minat,i)+1
660 nring(j,i) = tring(j)
685 call show_error (
"Impossible to allocate memory"//char(0), &
686 "Subroutine: GUTTMAN_RING_SEARCH_STEPS"//char(0),
"Table: "//alc_tab(1:len_trim(alc_tab))//char(0))
689if (
allocated(tring))
deallocate (tring)
690if (
allocated(the_ring))
deallocate (the_ring)
691if (
allocated(savring))
deallocate (savring)
692if (
allocated(ordring))
deallocate (ordring)
693if (
allocated(cpat))
deallocate (cpat)
694if (
allocated(vpat))
deallocate (vpat)
695if (
allocated(rpat))
deallocate (rpat)
696if (
allocated(res_list))
deallocate (res_list)
697if (
allocated(indte))
deallocate (indte)
698if (
allocated(indth))
deallocate (indth)
699if (
allocated(apna))
deallocate (apna)
void show_error(char *error, int val, GtkWidget *win)
show error message
integer function recrings(vid)
integer function guttman_rings()
subroutine guttman_ring_search_steps()
subroutine del_this_ring(tled, rsaved, osaved, tring, resl, indt)
subroutine setup_cpat_vpat_ring(nat, str, cont, vois, cpt, vpt)
recursive subroutine inside_ring(the_ring, fnd, s_ir, ai_ir, rid, tae, tah, lra, lrb, nrpat, rsaved, osaved, tring, inde, indh, resl, cpt, vpt)
integer function rings_to_ogl(step, idsearch, nri, rsaved, osaved)
integer function rings_to_ogl_menu(idsearch, nri)