subroutine lindem c c This subroutine computes the mean square displacement for the c current paths from lattice sites. c Note the use of the centering vector to correct c for any overall drift away from the lattice sites that may have occurred. c The LINDEM flag must have been issued for this routine to be used c deficiencies: we assume translation invariance and that iperm=i c include 'pimc.par' integer i,js,l,m,ic,iflag real*8 alin,ddr,center(mdim),cm(mslices) include 'pimc.cm' save iflag data iflag/0/ c rescale lattice sites for their c.o.m. position if (iflag.eq.0) then iflag=1 do l=1,ndim center(l)=0.d0 do i=1,np center(l)=center(l)+rsites(l,i) enddo center(l)=center(l)/dble(np) enddo do l=1,ndim do i=1,np rsites(l,i)=rsites(l,i)-center(l) enddo enddo endif c alin=0.d0 m=np*nslices do l=1,ndim do js=1,nslices cm(js)=0.d0 enddo do i=1,np do js=1,nslices cm(js)=cm(js)+x(l,i,js) enddo enddo do js=1,nslices cm(js)=cm(js)/dble(np) enddo do i=1,np do js=1,nslices ddr = pbc(x(l,i,js)-cm(js),rsites(l,i),l) alin=alin+ddr**2 enddo enddo enddo alin=alin/dble(m) call cumul1(alin,avp(ilind),anormp(ilind),1) return end