c *************************************************************** subroutine juxta(n,index) c c Test whether two desinated sites have collided or not. implicit double precision(a-h, o-z) parameter(maxa=500,maxb=10) integer i,j,k,index,n,n2 common/matrix/x(maxa,3),bangle(maxa) common/matrix2/r(maxa,maxa) common/Pdl/ nPdl(maxa) common/jux_info/djux(maxb),ndis,njux,iset(maxb), + iflag(maxb,maxb,maxa),njuxtaposed common/bf_coords/f(maxa,3),v(maxa,3),u(maxa,3) n2 = n/2 call update_rij(n) if (njuxtaposed.eq.1) return it1 = 0 do 100 k = 1, njux do 100 i = 1, n id = i + iset(k) if (id .gt. n) id = id - n do 100 j = 1, ndis it1 = 1 if (r(i,id) .le. djux(j)) then c call cal_dtwist(n,i,id,dtwist) c dtwist=0 c dtwist here =cos(u1,u2) c do iii=1,3 c dtwist=dtwist+u(i,iii)*u(id,iii) c enddo c call out_juxtaed(n,i,id) nPdl(iset(k))=nPdl(iset(k))+1 c write(*,*) 'nPdL',index,iset(k), nPdl(iset(k)) if (iflag(j,k,i).eq.1) goto 100 mp = 700+(j-1)*100+iset(k) iflag(j,k,i) = 1 write(mp,701) i, id, r(i,id), index call flush(mp) endif 100 continue if (it1 .eq. 0) then write(*,*) 'all juxtaposed' njuxtaposed=1 endif if (mod(index, 10000).eq.1) then do k=1, njux xxx=1.0*nPdl(iset(k))/n/index write(999,711) iset(k), xxx, index enddo call flush(999) endif 701 format(2(1x,i4),1x,f10.4,1x,i10) 711 format(i4,1x,f10.4,1x,i4) return end c *************************************************************** subroutine set_juxta(n) implicit double precision(a-h, o-z) parameter(maxa=500,maxb=10) integer i,j,n common/matrix/x(maxa,3),r(maxa,maxa),bangle(maxa) common/jux_info/djux(maxb),ndis,njux,iset(maxb), + iflag(maxb,maxb,maxa) common/Pdl/ nPdl(maxa) c nPdl save the counts finding a pair separated by dL site juxtaposed open(unit=121,file='Input_juxta',status='old') read(121,*)ndis do i = 1, ndis read(121,*) djux(i) enddo read(121,*)njux do i = 1, njux read(121,*)iset(i) do j = 1, n do k = 1, ndis iflag(k,i,j) = 0 enddo enddo enddo do i=1, n nPdl(i)=0 enddo write(*,*) 'ndistance:',ndis write(*,*) 'njux:',njux close(121) return end c *************************************************************** c cont_juxta continued trajectory with juxtaposed information subroutine cont_juxta(n) implicit double precision(a-h, o-z) parameter(maxa=500,maxb=10) integer i,j,n character*20 filename common/matrix/x(maxa,3),r(maxa,maxa),bangle(maxa) common/jux_info/djux(maxb),ndis,njux,iset(maxb), + iflag(maxb,maxb,maxa) write(*,*) 'njux=',njux open(unit=112,file='Init_fort',status='unknown') do k=1,njux write(*,*) 'iset',k,iset(k) do j=1,ndis mp = 700+(j-1)*100+iset(k) i11=mp/100;mp=mp-100*i11;i11=i11+48;i12=mp/10+48;i13=49 filename='fort.'//char(i11)//char(i12)//char(i13) read(112,*) n1 if (n1.ne.0) then open(unit=111,file=filename,status='unknown') do i1=1,n1 read(111,*) i,j2,x1,j3,x2 iflag(j,k,i)=1 enddo close(111) endif enddo enddo return end