Working gradient for PBC
authorAdam Sieradzan <adasko@piasek4.chem.univ.gda.pl>
Mon, 24 Feb 2014 19:23:03 +0000 (20:23 +0100)
committerAdam Sieradzan <adasko@piasek4.chem.univ.gda.pl>
Mon, 24 Feb 2014 19:23:03 +0000 (20:23 +0100)
source/unres/src_MD-M/energy_p_new_barrier.F
source/unres/src_MD-M/intcartderiv.F

index e56e104..6d6e18c 100644 (file)
@@ -2871,7 +2871,7 @@ C 14/01/2014 TURN3,TUNR4 does no go under periodic boundry condition
         if (itype(i).eq.ntyp1 .or. itype(i+1).eq.ntyp1
      &  .or. itype(i+2).eq.ntyp1
      &  .or. itype(i+3).eq.ntyp1
-c     &  .or. itype(i-1).eq.ntyp1
+     &  .or. itype(i-1).eq.ntyp1
      &  .or. itype(i+4).eq.ntyp1
      &  ) cycle
         dxi=dc(1,i)
@@ -2918,6 +2918,8 @@ C Condition for being inside the proper box
      &    .or. itype(i+3).eq.ntyp1
      &    .or. itype(i+4).eq.ntyp1
      &    .or. itype(i+5).eq.ntyp1
+     &    .or. itype(i).eq.ntyp1
+     &    .or. itype(i-1).eq.ntyp1
      &                             ) cycle
         dxi=dc(1,i)
         dyi=dc(2,i)
@@ -2970,6 +2972,7 @@ c
       do i=iatel_s,iatel_e
         if (itype(i).eq.ntyp1 .or. itype(i+1).eq.ntyp1
      &  .or. itype(i+2).eq.ntyp1
+     &  .or. itype(i-1).eq.ntyp1
      &                ) cycle
         dxi=dc(1,i)
         dyi=dc(2,i)
@@ -3012,6 +3015,7 @@ c        write (iout,*) 'i',i,' ielstart',ielstart(i),' ielend',ielend(i)
 c          write (iout,*) i,j,itype(i),itype(j)
           if (itype(j).eq.ntyp1.or. itype(j+1).eq.ntyp1
      & .or.itype(j+2).eq.ntyp1
+     & .or.itype(j-1).eq.ntyp1
      &) cycle
           call eelecij(i,j,ees,evdw1,eel_loc)
         enddo ! j
index 12d7dee..f78cadd 100644 (file)
@@ -48,10 +48,12 @@ c We need dtheta(:,:,i-1) to compute dphi(:,:,i)
         do j=1,3
           dcostheta(j,1,i)=-(dc_norm(j,i-1)+cost*dc_norm(j,i-2))/
      &   vbld(i-1)
-          if (itype(i-1).ne.ntyp1) dtheta(j,1,i)=-dcostheta(j,1,i)/sint
+c          if (itype(i-1).ne.ntyp1)
+          dtheta(j,1,i)=-dcostheta(j,1,i)/sint
           dcostheta(j,2,i)=-(dc_norm(j,i-2)+cost*dc_norm(j,i-1))/
      &   vbld(i)
-          if (itype(i-1).ne.ntyp1) dtheta(j,2,i)=-dcostheta(j,2,i)/sint
+c          if (itype(i-1).ne.ntyp1)
+          dtheta(j,2,i)=-dcostheta(j,2,i)/sint
         enddo
       enddo
 #if defined(MPI) && defined(PARINTDER)