      double precision a,b
      call titre('program COMPAREMAT#',40)
      open(1,file='cdsg2',status='old')
      open(2,file='lsg2',status='old')
      n=0
      do 
         read(1,*,end=1) i,j,a
         read(2,*) k,l,b
         n=n+1
         if(i/=k.or.j/=l.or.abs(a-b)>1.d-6) then
             print'(2i6,f12.8)',i,j,a
             print'(2i6,f12.8)',k,l,b
             stop
         endif
      enddo
 1    continue
      read(2,*,end=2) k,l,b
      print*,'la file lsg2 est plus longue'
      stop
 2    continue
      print*,n,' lectures'
      print*,'pas d''erreur'
      end
