comment printout
[unres.git] / source / unres / src_MD-M / energy_p_new_barrier.F
index a20ec7b..2647bce 100644 (file)
@@ -3692,13 +3692,13 @@ c        if ((zmedi.gt.((0.5d0)*boxzsize)).or.
 c     &       (zmedi.lt.((-0.5d0)*boxzsize))) then
 c        go to 196
 c        endif
-          xmedi=mod(xmedi,boxxsize)
+          xmedi=dmod(xmedi,boxxsize)
           if (xmedi.lt.0) xmedi=xmedi+boxxsize
-          ymedi=mod(ymedi,boxysize)
+          ymedi=dmod(ymedi,boxysize)
           if (ymedi.lt.0) ymedi=ymedi+boxysize
-          zmedi=mod(zmedi,boxzsize)
+          zmedi=dmod(zmedi,boxzsize)
           if (zmedi.lt.0) zmedi=zmedi+boxzsize
-          zmedi2=mod(zmedi,boxzsize)
+          zmedi2=dmod(zmedi,boxzsize)
           if (zmedi2.lt.0) zmedi2=zmedi2+boxzsize
        if ((zmedi2.gt.bordlipbot)
      &.and.(zmedi2.lt.bordliptop)) then
@@ -3757,11 +3757,11 @@ c     &  .or. itype(i-1).eq.ntyp1
         xmedi=c(1,i)+0.5d0*dxi
         ymedi=c(2,i)+0.5d0*dyi
         zmedi=c(3,i)+0.5d0*dzi
-          xmedi=mod(xmedi,boxxsize)
+          xmedi=dmod(xmedi,boxxsize)
           if (xmedi.lt.0) xmedi=xmedi+boxxsize
-          ymedi=mod(ymedi,boxysize)
+          ymedi=dmod(ymedi,boxysize)
           if (ymedi.lt.0) ymedi=ymedi+boxysize
-          zmedi=mod(zmedi,boxzsize)
+          zmedi=dmod(zmedi,boxzsize)
           if (zmedi.lt.0) zmedi=zmedi+boxzsize
        if ((zmedi.gt.bordlipbot)
      &.and.(zmedi.lt.bordliptop)) then
@@ -3965,6 +3965,7 @@ C lipbufthick is thickenes of lipid buffore
        enddo
        enddo
        if (isubchap.eq.1) then
+C          print *,i,j
           xj=xj_temp-xmedi
           yj=yj_temp-ymedi
           zj=zj_temp-zmedi
@@ -4173,10 +4174,14 @@ C           print *,"bafter", gelc_long(1,i), gelc_long(1,j)
 C Lipidic part for lipscale
             gelc_long(3,j)=gelc_long(3,j)+
      &     ssgradlipj*eesij/2.0d0*lipscale**2
-
+C           if ((ssgradlipj*eesij/2.0d0*lipscale**2).ne.0.0 )
+C     &     write(iout,*) "WTF",j
             gelc_long(3,i)=gelc_long(3,i)+
      &     ssgradlipi*eesij/2.0d0*lipscale**2
 
+C            if ((ssgradlipi*eesij/2.0d0*lipscale**2).ne.0.0 )
+C     &     write(iout,*) "WTF",i
+
 *
 * Loop over residues i+1 thru j-1.
 *
@@ -4647,8 +4652,8 @@ c     &   a33*gmuji2(4)
 #endif
 cd          write (iout,*) 'i',i,' j',j,' eel_loc_ij',eel_loc_ij
 
-          if (energy_dec) write (iout,'(a6,2i5,0pf7.3)')
-     &            'eelloc',i,j,eel_loc_ij
+          if (energy_dec) write (iout,'(a6,2i5,0pf7.3,2f7.3)')
+     &            'eelloc',i,j,eel_loc_ij,a22*muij(1),a23*muij(2)
 c           if (eel_loc_ij.ne.0)
 c     &      write (iout,'(a4,2i4,8f9.5)')'chuj',
 c     &     i,j,a22,muij(1),a23,muij(2),a32,muij(3),a33,muij(4)
@@ -8223,6 +8228,9 @@ c   3 = SC...Ca...Ca...SCi
           esccor=esccor+v1ij*cosphi+v2ij*sinphi
           gloci=gloci+j*(v2ij*cosphi-v1ij*sinphi)
         enddo
+        if (energy_dec) write(iout,'(a9,2i4,f8.3,3i4)') "esccor",i,j,
+     & esccor,intertyp,
+     & isccori, isccori1
 c      write (iout,*) "EBACK_SC_COR",i,v1ij*cosphi+v2ij*sinphi,intertyp
         gloc_sc(intertyp,i-3,icg)=gloc_sc(intertyp,i-3,icg)+wsccor*gloci
         if (lprn)
@@ -12390,7 +12398,7 @@ C THIS FRAGMENT MAKES TUBE FINITE
 C       print *,mod(c(3,i+nres),boxzsize),bordlipbot,bordliptop
 c for each residue check if it is in lipid or lipid water border area
 C       respos=mod(c(3,i+nres),boxzsize)
-       print *,positi,bordtubebot,buftubebot,bordtubetop
+C       print *,positi,bordtubebot,buftubebot,bordtubetop
        if ((positi.gt.bordtubebot)
      & .and.(positi.lt.bordtubetop)) then
 C the energy transfer exist
@@ -12400,7 +12408,7 @@ C the energy transfer exist
 C lipbufthick is thickenes of lipid buffore
          sstube=sscalelip(fracinbuf)
          ssgradtube=-sscagradlip(fracinbuf)/tubebufthick
-         print *,ssgradtube, sstube,tubetranene(itype(i))
+C         print *,ssgradtube, sstube,tubetranene(itype(i))
          enetube(i)=enetube(i)+sstube*tubetranenepep
 C         gg_tube_SC(3,i)=gg_tube_SC(3,i)
 C     &+ssgradtube*tubetranene(itype(i))
@@ -12478,7 +12486,8 @@ C THIS FRAGMENT MAKES TUBE FINITE
 C       print *,mod(c(3,i+nres),boxzsize),bordlipbot,bordliptop
 c for each residue check if it is in lipid or lipid water border area
 C       respos=mod(c(3,i+nres),boxzsize)
-       print *,positi,bordtubebot,buftubebot,bordtubetop
+C       print *,positi,bordtubebot,buftubebot,bordtubetop
+
        if ((positi.gt.bordtubebot)
      & .and.(positi.lt.bordtubetop)) then
 C the energy transfer exist
@@ -12488,7 +12497,7 @@ C the energy transfer exist
 C lipbufthick is thickenes of lipid buffore
          sstube=sscalelip(fracinbuf)
          ssgradtube=-sscagradlip(fracinbuf)/tubebufthick
-         print *,ssgradtube, sstube,tubetranene(itype(i))
+C         print *,ssgradtube, sstube,tubetranene(itype(i))
          enetube(i+nres)=enetube(i+nres)+sstube*tubetranene(itype(i))
 C         gg_tube_SC(3,i)=gg_tube_SC(3,i)
 C     &+ssgradtube*tubetranene(itype(i))
@@ -12608,17 +12617,17 @@ C now calculate distance from center of tube and direction vectors
       zmin=boxzsize
 
         do j=-1,1
-         vectube(1)=mod((c(1,i)+c(1,i+1))/2.0d0,boxxsize)
+         vectube(1)=dmod((c(1,i)+c(1,i+1))/2.0d0,boxxsize)
          vectube(1)=vectube(1)+boxxsize*j
-         vectube(2)=mod((c(2,i)+c(2,i+1))/2.0d0,boxysize)
+         vectube(2)=dmod((c(2,i)+c(2,i+1))/2.0d0,boxysize)
          vectube(2)=vectube(2)+boxysize*j
-         vectube(3)=mod((c(3,i)+c(3,i+1))/2.0d0,boxzsize)
+         vectube(3)=dmod((c(3,i)+c(3,i+1))/2.0d0,boxzsize)
          vectube(3)=vectube(3)+boxzsize*j
 
 
-         xminact=abs(vectube(1)-tubecenter(1))
-         yminact=abs(vectube(2)-tubecenter(2))
-         zminact=abs(vectube(3)-tubecenter(3))
+         xminact=dabs(vectube(1)-tubecenter(1))
+         yminact=dabs(vectube(2)-tubecenter(2))
+         zminact=dabs(vectube(3)-tubecenter(3))
 
            if (xmin.gt.xminact) then
             xmin=xminact
@@ -12671,13 +12680,13 @@ C go to 667
          enecavtube(i)=0.0
          faccav=0.0
          else
-         denominator=(1.0+dcavtubpep*rdiff6*rdiff6)
+         denominator=(1.0d0+dcavtubpep*rdiff6*rdiff6)
          enecavtube(i)=
-     &   (bcavtubpep*rdiff+acavtubpep*sqrt(rdiff)+ccavtubpep)
+     &   (bcavtubpep*rdiff+acavtubpep*dsqrt(rdiff)+ccavtubpep)
      &   /denominator
          enecavtube(i)=0.0
-         faccav=((bcavtubpep*1.0d0+acavtubpep/2.0d0/sqrt(rdiff))
-     &   *denominator-(bcavtubpep*rdiff+acavtubpep*sqrt(rdiff)
+         faccav=((bcavtubpep*1.0d0+acavtubpep/2.0d0/dsqrt(rdiff))
+     &   *denominator-(bcavtubpep*rdiff+acavtubpep*dsqrt(rdiff)
      &   +ccavtubpep)*rdiff6**2.0d0/rdiff*dcavtubpep*12.0d0)
      &   /denominator**2.0d0
 C         faccav=0.0
@@ -12698,7 +12707,7 @@ C now direction of gg_tube vector
         enddo
 
        do i=itube_start,itube_end
-        enecavtube(i)=0.0 
+        enecavtube(i)=0.0d0
 C Lets not jump over memory as we use many times iti
          iti=itype(i)
 C lets ommit dummy atoms for now
@@ -12710,17 +12719,17 @@ C      .or.(iti.eq.10)
       ymin=boxysize
       zmin=boxzsize
         do j=-1,1
-         vectube(1)=mod((c(1,i+nres)),boxxsize)
+         vectube(1)=dmod((c(1,i+nres)),boxxsize)
          vectube(1)=vectube(1)+boxxsize*j
-         vectube(2)=mod((c(2,i+nres)),boxysize)
+         vectube(2)=dmod((c(2,i+nres)),boxysize)
          vectube(2)=vectube(2)+boxysize*j
-         vectube(3)=mod((c(3,i+nres)),boxzsize)
+         vectube(3)=dmod((c(3,i+nres)),boxzsize)
          vectube(3)=vectube(3)+boxzsize*j
 
 
-         xminact=abs(vectube(1)-tubecenter(1))
-         yminact=abs(vectube(2)-tubecenter(2))
-         zminact=abs(vectube(3)-tubecenter(3))
+         xminact=dabs(vectube(1)-tubecenter(1))
+         yminact=dabs(vectube(2)-tubecenter(2))
+         zminact=dabs(vectube(3)-tubecenter(3))
 
            if (xmin.gt.xminact) then
             xmin=xminact
@@ -12769,16 +12778,16 @@ C now direction of gg_tube vector
 C Now cavity term E=a(x+bsqrt(x)+c)/(1+dx^12)
          if (acavtub(iti).eq.0.0d0) then
 C go to 667
-         enecavtube(i+nres)=0.0
-         faccav=0.0
+         enecavtube(i+nres)=0.0d0
+         faccav=0.0d0
          else
-         denominator=(1.0+dcavtub(iti)*rdiff6*rdiff6)
+         denominator=(1.0d0+dcavtub(iti)*rdiff6*rdiff6)
          enecavtube(i+nres)=
-     &   (bcavtub(iti)*rdiff+acavtub(iti)*sqrt(rdiff)+ccavtub(iti))
+     &   (bcavtub(iti)*rdiff+acavtub(iti)*dsqrt(rdiff)+ccavtub(iti))
      &   /denominator
 C         enecavtube(i)=0.0
-         faccav=((bcavtub(iti)*1.0d0+acavtub(iti)/2.0d0/sqrt(rdiff))
-     &   *denominator-(bcavtub(iti)*rdiff+acavtub(iti)*sqrt(rdiff)
+         faccav=((bcavtub(iti)*1.0d0+acavtub(iti)/2.0d0/dsqrt(rdiff))
+     &   *denominator-(bcavtub(iti)*rdiff+acavtub(iti)*dsqrt(rdiff)
      &   +ccavtub(iti))*rdiff6**2.0d0/rdiff*dcavtub(iti)*12.0d0)
      &   /denominator**2.0d0
 C         faccav=0.0