make cp src-HCD-5D
[unres.git] / source / unres / src-HCD-5D / elecont.f
index 73325f2..690fd44 100644 (file)
@@ -12,6 +12,7 @@
       double precision app_(2,2),bpp_(2,2),rpp_(2,2)
       integer ncont,icont(2,maxcont)
       double precision econt(maxcont)
+      integer xshift,yshift,zshift
 *
 * Load the constants of peptide bond - peptide bond interactions.
 * Type 1 - ordinary peptide bond, type 2 - alkylated peptide bond (e.g.
@@ -52,13 +53,16 @@ c      data epp    / 0.3045d0, 0.3649d0, 0.3649d0, 0.5743d0/
         xmedi=xi+0.5*dxi
         ymedi=yi+0.5*dyi
         zmedi=zi+0.5*dzi
+c        write (iout,*) "i",xmedi,ymedi,zmedi
           xmedi=mod(xmedi,boxxsize)
           if (xmedi.lt.0) xmedi=xmedi+boxxsize
           ymedi=mod(ymedi,boxysize)
           if (ymedi.lt.0) ymedi=ymedi+boxysize
           zmedi=mod(zmedi,boxzsize)
           if (zmedi.lt.0) zmedi=zmedi+boxzsize
+c        write (iout,*) "i",xmedi,ymedi,zmedi
         do 4 j=i+2,nct-1
+c          write (iout,*) "i",i," j",j
           if (itype(j).eq.ntyp1 .or. itype(j+1).eq.ntyp1) goto 4
           ind=ind+1
           iteli=itel(i)
@@ -75,13 +79,16 @@ c      data epp    / 0.3045d0, 0.3649d0, 0.3649d0, 0.5743d0/
           xj=c(1,j)+0.5*dxj
           yj=c(2,j)+0.5*dyj
           zj=c(3,j)+0.5*dzj
+c          write (iout,*) "j",xj,yj,zj
           xj=mod(xj,boxxsize)
           if (xj.lt.0) xj=xj+boxxsize
           yj=mod(yj,boxysize)
           if (yj.lt.0) yj=yj+boxysize
           zj=mod(zj,boxzsize)
           if (zj.lt.0) zj=zj+boxzsize
-      dist_init=(xj-xi)**2+(yj-yi)**2+(zj-zi)**2
+c          write (iout,*) "j",xj,yj,zj
+      dist_init=(xj-xmedi)**2+(yj-ymedi)**2+(zj-zmedi)**2
+c      write (iout,*) "dist",dsqrt(dist_init)
       xj_safe=xj
       yj_safe=yj
       zj_safe=zj
@@ -92,7 +99,9 @@ c      data epp    / 0.3045d0, 0.3649d0, 0.3649d0, 0.5743d0/
           xj=xj_safe+xshift*boxxsize
           yj=yj_safe+yshift*boxysize
           zj=zj_safe+zshift*boxzsize
-          dist_temp=(xj-xi)**2+(yj-yi)**2+(zj-zi)**2
+          dist_temp=(xj-xmedi)**2+(yj-ymedi)**2+(zj-zmedi)**2
+c          write (iout,*) "shift",xshift,yshift,zshift," dist_temp",
+c     &      dist_temp," dist_init",dist_init
           if(dist_temp.lt.dist_init) then
             dist_init=dist_temp
             xj_temp=xj
@@ -113,8 +122,6 @@ c      data epp    / 0.3045d0, 0.3649d0, 0.3649d0, 0.5743d0/
           zj=zj_safe-zmedi
        endif
           rij=xj*xj+yj*yj+zj*zj
-            sss=sscale(sqrt(rij))
-            sssgrad=sscagrad(sqrt(rij))
           rrmij=1.0/(xj*xj+yj*yj+zj*zj)
           rmij=sqrt(rrmij)
           r3ij=rrmij*rmij
@@ -140,7 +147,7 @@ c      data epp    / 0.3045d0, 0.3649d0, 0.3649d0, 0.5743d0/
             econt(ncont)=eesij
           endif
           ees=ees+eesij
-          evdw=evdw+evdwij*sss
+c          write (iout,*) "i"," j",j," rij",dsqrt(rij)," eesij",eesij
     4   continue
     1 continue
       if (lprint) then
@@ -251,7 +258,7 @@ c--------------------------------------------
       include 'DIMENSIONS'
       include 'COMMON.CHAIN'
       include 'COMMON.IOUNITS'
-      include 'COMMON.DISTFIT'
+      include 'COMMON.FRAG'
       include 'COMMON.VAR'
       include 'COMMON.GEO'
       include 'COMMON.CONTROL'