Merge branch 'multichain' of mmka:unres into multichain
authorAdam Sieradzan <adasko@piasek4.chem.univ.gda.pl>
Mon, 6 Jul 2015 09:21:26 +0000 (11:21 +0200)
committerAdam Sieradzan <adasko@piasek4.chem.univ.gda.pl>
Mon, 6 Jul 2015 09:21:26 +0000 (11:21 +0200)
1  2 
source/unres/src_MD-M/energy_p_new_barrier.F

  C 14/01/2014 TURN3,TUNR4 does no go under periodic boundry condition
        do i=iturn3_start,iturn3_end
          if (itype(i).eq.ntyp1 .or. itype(i+1).eq.ntyp1
 +C changes suggested by Ana to avoid out of bounds
 +     & .or.((i+4).gt.nres)
 +     & .or.((i-1).le.0)
 +C end of changes by Ana
       &  .or. itype(i+2).eq.ntyp1
-      &  .or. itype(i+3).eq.ntyp1
-      &  .or. itype(i-1).eq.ntyp1
-      &  .or. itype(i+4).eq.ntyp1
-      &  ) cycle
+      &  .or. itype(i+3).eq.ntyp1) cycle
+         if(i.gt.1)then
+           if(itype(i-1).eq.ntyp1)cycle
+         end if
+         if(i.LT.nres-3)then
+           if (itype(i+4).eq.ntyp1) cycle
+         end if
          dxi=dc(1,i)
          dyi=dc(2,i)
          dzi=dc(3,i)
        enddo
        do i=iturn4_start,iturn4_end
          if (itype(i).eq.ntyp1 .or. itype(i+1).eq.ntyp1
 +C changes suggested by Ana to avoid out of bounds
 +     & .or.((i+5).gt.nres)
 +     & .or.((i-1).le.0)
 +C end of changes suggested by Ana
       &    .or. itype(i+3).eq.ntyp1
       &    .or. itype(i+4).eq.ntyp1
       &    .or. itype(i+5).eq.ntyp1
@@@ -3162,10 -3157,6 +3165,10 @@@ c Loop over all pairs of interacting pe
  c
        do i=iatel_s,iatel_e
          if (itype(i).eq.ntyp1 .or. itype(i+1).eq.ntyp1
 +C changes suggested by Ana to avoid out of bounds
 +     & .or.((i+2).gt.nres)
 +     & .or.((i-1).le.0)
 +C end of changes by Ana
       &  .or. itype(i+2).eq.ntyp1
       &  .or. itype(i-1).eq.ntyp1
       &                ) cycle
@@@ -3219,10 -3210,6 +3222,10 @@@ c        write (iout,*) 'i',i,' ielstar
          do j=ielstart(i),ielend(i)
  c          write (iout,*) i,j,itype(i),itype(j)
            if (itype(j).eq.ntyp1.or. itype(j+1).eq.ntyp1
 +C changes suggested by Ana to avoid out of bounds
 +     & .or.((j+2).gt.nres)
 +     & .or.((j-1).le.0)
 +C end of changes by Ana
       & .or.itype(j+2).eq.ntyp1
       & .or.itype(j-1).eq.ntyp1
       &) cycle