enddo
iti=itype(i)
di=dist(i,nres+i)
+C 10/03/12 Adam: Correction for zero SC-SC bond length
+ if (itype(i).ne.10 .and. itype(i).ne.21. and. di.eq.0.0d0)
+ & di=dsc(itype(i))
vbld(i+nres)=di
if (itype(i).ne.10) then
vbld_inv(i+nres)=1.0d0/di
call contact(.false.,ncont_ref,icont_ref,co)
if (sideadd) then
+C Following 2 lines for diagnostics; comment out if not needed
+ write (iout,*) "Before sideadd"
+ call intout
if(me.eq.king.or..not.out1file)
& write(iout,*)'Adding sidechains'
maxsi=1000
endif
enddo
endif
+C 10/03/12 Adam: Recalculate coordinates with new side chain positions
+ call chainbuild
+C Following 2 lines for diagnostics; comment out if not needed
+ write (iout,*) "After sideadd"
+ call intout
endif
if (indpdb.eq.0) then
enddo
iti=itype(i)
di=dist(i,nres+i)
+C 10/03/12 Adam: Correction for zero SC-SC bond length
+ if (itype(i).ne.10 .and. itype(i).ne.21. and. di.eq.0.0d0)
+ & di=dsc(itype(i))
vbld(i+nres)=di
if (itype(i).ne.10) then
vbld_inv(i+nres)=1.0d0/di
call contact(.false.,ncont_ref,icont_ref,co)
if (sideadd) then
+C Following 2 lines for diagnostics; comment out if not needed
+ write (iout,*) "Before sideadd"
+ call intout
if(me.eq.king.or..not.out1file)
& write(iout,*)'Adding sidechains'
maxsi=1000
& i,' after ',nsi,' trials'
endif
enddo
+C 10/03/12 Adam: Recalculate coordinates with new side chain positions
+ call chainbuild
endif
+C Following 2 lines for diagnostics; comment out if not needed
+ write (iout,*) "After sideadd"
+ call intout
endif
if (indpdb.eq.0) then
C Read sequence if not taken from the pdb file.