if ((dist(i,i-1).lt.2.0D0 .or. dist(i,i-1).gt.5.0D0)
&.and.(iti.ne.ntyp1).and.(itype(i-1).ne.ntyp1)) then
write (iout,'(a,i4)') 'Bad Cartesians for residue',i
if ((dist(i,i-1).lt.2.0D0 .or. dist(i,i-1).gt.5.0D0)
&.and.(iti.ne.ntyp1).and.(itype(i-1).ne.ntyp1)) then
write (iout,'(a,i4)') 'Bad Cartesians for residue',i