subroutine connectivite(bond)
Use lewis_module
implicit real*8 (a-h,o-x,z),logical*1(y)
character(*) bond
character(4) at1,at2
ib1=index(bond,' ')
ib2=index(bond(6:),' ')+5
ib3=index(trim(bond),' ',.true.)
at1=bond(ib1+1:ib2-1)
at2=bond(ib2+1:ib3-1)
l1=len_trim(at1)
l2=len_trim(at2)
read(bond(ib3+1:),*) d
print*,'Connectivite   ',at1,at2,d
d=d/0.529177249
print*,'natom',natom
do i=1,natom
   if(atom(i)(1:l1)==trim(at1)) then
      call connec2(atom(i),l1,ybon)
      if(ybon) then
         ideb=1
         if(at1==at2) ideb=i+1
         do j=ideb,natom
            if(atom(j)(1:l1)==trim(at2)) then
               call connec2(atom(j),l1,ybon2)
               if(ybon2) then
                  dist=sqrt((coord(1,i)-coord(1,j))**2+ &
                  (coord(2,i)-coord(2,j))**2+ &
                  (coord(3,i)-coord(3,j))**2)
!                        if(dist<d)
!     *                  print'(2a6,f12.6)',
!     *                  trim(atom(i)(1:4))//atom(i)(5:6)//'   ',
!     *                  trim(atom(j)(1:4))//atom(j)(5:6),dist*0.529177249
                  if(dist<d.and.atom(i)(6:6)=='1') &
                  print'(2a6,f12.6)', &
                  trim(atom(i)(1:4))//'   ', &
                  trim(atom(j)(1:4)),dist*0.529177249
               endif
            endif
         enddo
      endif
   endif
enddo
end
 subroutine connec2(atom,l,ybon)
implicit real*8 (a-h,o-x,z),logical*1(y)
character(*) atom
character(1) c(11)
c=(/' ','1','2','3','4','5','6','7','8','9','0'/)
ybon=.true.
if(l==4) return
if(any(atom(l+1:l+1)==c)) return
ybon=.false.
end
