From f973c199bc1118ee2c17e28c31718c36544cdc70 Mon Sep 17 00:00:00 2001 From: rojas Date: Tue, 30 Jun 2015 10:49:35 -0400 Subject: [PATCH] Change in energy_p_new_barrier.F, in eelec, aorund line 3065 Because in general iturn3_start and iturn3_end are nnt and nct-3, respectively, if the chain has a GLY as the first or last residues, nnt=1 or nct=nres, the program ends up evaluating itype(0) or itype(nres+1). The first case causes a segmentation fault, the second won't (if maxres is bigger than nres), but it won't cycle the loop which is what was intended --- source/unres/src_MD-M/energy_p_new_barrier.F | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/source/unres/src_MD-M/energy_p_new_barrier.F b/source/unres/src_MD-M/energy_p_new_barrier.F index af14adb..a5d1e86 100644 --- a/source/unres/src_MD-M/energy_p_new_barrier.F +++ b/source/unres/src_MD-M/energy_p_new_barrier.F @@ -3065,10 +3065,13 @@ 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 & .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) -- 1.7.9.5