-c write (iout,*) "Chain ended",ires,ishift,ires_old
+ write (iout,*) "Chain ended",ires,ishift,ires_old
-c write (iout,*) i,itype(i)
- if (itype(i).eq.ntyp1) then
- if (itype(i+1).eq.ntyp1) then
+ write (iout,*) i,itype(i),itype(i+1)
+ if (itype(i).eq.ntyp1.and.iterter(i).eq.1) then
+ if (itype(i+1).eq.ntyp1.and.iterter(i+1).eq.1 ) then
C 16/01/2014 by Adasko: Adding to dummy atoms in the chain
C first is connected prevous chain (itype(i+1).eq.ntyp1)=true
C second dummy atom is conected to next chain itype(i+1).eq.ntyp1=false
if (unres_pdb) then
C 2/15/2013 by Adam: corrected insertion of the last dummy residue
C 16/01/2014 by Adasko: Adding to dummy atoms in the chain
C first is connected prevous chain (itype(i+1).eq.ntyp1)=true
C second dummy atom is conected to next chain itype(i+1).eq.ntyp1=false
if (unres_pdb) then
C 2/15/2013 by Adam: corrected insertion of the last dummy residue
call refsys(i-3,i-2,i-1,e1,e2,e3,fail)
if (fail) then
e2(1)=0.0d0
e2(2)=1.0d0
e2(3)=0.0d0
endif !fail
call refsys(i-3,i-2,i-1,e1,e2,e3,fail)
if (fail) then
e2(1)=0.0d0
e2(2)=1.0d0
e2(3)=0.0d0
endif !fail
do j=1,3
c(j,i)=c(j,i-1)-1.9d0*e2(j)
enddo
else !unres_pdb
do j=1,3
dcj=(c(j,i-2)-c(j,i-3))/2.0
do j=1,3
c(j,i)=c(j,i-1)-1.9d0*e2(j)
enddo
else !unres_pdb
do j=1,3
dcj=(c(j,i-2)-c(j,i-3))/2.0