	program wds_vs_orb6
c
c	check coordinates and magnitudes in orb6 versus those in wds for differences
c
	character*10 wds(120000),wds1
	character*7 dd(120000),dd1
	character*5 comp(120000),comp1,v1(120000),v11,v2(120000),v22
	character*18 rad(120000),rad1
c
	open(10,file='/data/wih/WDS/wds.summ',status='UNKNOWN')
	open(11,file='/data/Orbits/Catalog/orb6.master',status='UNKNOWN')
	open(12,file='wds_vs_orb6.nomatch',status='UNKNOWN')
	open(13,file='wds_vs_orb6.out',status='UNKNOWN')
c
c	read in info from wds.summ
c
	nwds=1
  100	read(10,901,end=200) wds(nwds),dd(nwds),comp(nwds),v1(nwds),
     $     v2(nwds),rad(nwds)
  901	format(a10,a7,a5,t59,a5,1x,a5,t113,a18)
	if (comp(nwds) .eq. '     ') comp(nwds)='AB   '
	nwds=nwds+1
	go to 100
c
  200	nwds=nwds-1
c
c	read in lines from orb6. if no match of wds, dd, and comp, print to file12
c
	do 210 n=1,4
  210	read(11,902) v11
  902	format(a5)
c
  300	read(11,903,end=999) rad1,wds1,dd1,comp1,v11,v22
  903	format(a18,1x,a10,1x,a7,a5,t67,a5,2x,a5)
	if (wds1 .eq. '          ') go to 300
	if (comp1 .eq. '     ') comp1='AB   '
c
	do 400 n=1,nwds
	if (wds1 .ne. wds(n)) go to 400
	if (dd1 .ne. dd(n)) go to 400
	if (comp1 .ne. comp(n)) go to 400
	if (rad1 .ne. rad(n)) write(13,904) wds1,dd1,comp1,rad1,rad(n)
  904	format(a10,a7,a5,2x,a18,2x,a18)
	if ((v11 .ne. v1(n)) .or. v22 .ne. v2(n)) 
     $     write(13,905) wds1,dd1,comp1,v11,v22,v1(n),v2(n)
  905	format(a10,a7,a5,2x,a5,1x,a5,2x,a5,1x,a5)
	go to 300
  400	continue
c
	write(12,906) wds1,dd1,comp1
  906	format(a10,a7,a5)
	go to 300
c
  999	stop
	end
