c      cross-check
      dimension numm(20000),yokoa(20000),yokob(20000),yokoc(20000)
      open(10,file='I:\GHdata\yoko_gh90mag0.txt',
     +     status='old')
      open(20,file='I:\GHdata\tate_gh90mag0.txt',
     +     status='old')
      open(30,file='I:\GHdata\gh90-res.txt')
c
      ic=0
    1 continue
      read(10,*,end=9) num,ylon,ylat,amag,hdg
      ic=ic+1
      numm(ic)=num
      yokoa(ic)=ylat
      yokob(ic)=ylon
      yokoc(ic)=amag
      go to 1
    9 close(10)
      icny=ic
      write(6,*) 'yoko-read-end'
c
    2 continue
      read(20,*,end=99)  numt,tlon,tlat,tmag,thdg
      do 15 kk=1, icny
        dlat=abs(tlat-yokoa(kk))
        dlon=abs(tlon-yokob(kk))
        if(dlat.le.0.008 .and. dlon.le.0.008) then
        dd=sqrt(dlat*dlat+dlon*dlon)
        if(dd.le.0.005) then
      write(30,300) numm(kk),numt,tlat,tlon,tmag,
     +    yokoa(kk),yokob(kk),yokoc(kk)
      write(6,*) tlat,tlon,tmag,yokoa(kk),yokob(kk),yokoc(kk)
        end if
        end if
   15 continue
      go to 2
   99 close(20)
c
  300   format(i5,i5,f9.5,f10.5,f8.1,f9.5,f10.5,f8.1)
      close(30)
      stop
      end