	program temp
c
c	determine obs date range for all orbit pairs, for plot of Nrevolutions vs grade
c
	character*10 wds(3000),wds1
	character*12 dd(3000),dd1
	character*1 pflag,keep
	dimension grade(3000),rev(3000),p(3000)
	integer nobs(3000)
c
	open(10,file='orb6.master',status='UNKNOWN')
	open(11,file='/home/wih/WDS/wds.summ',status='UNKNOWN')
	open(12,file='temp.out',status='UNKNOWN')
c
	do 100 n=1,4
	read(10,901) junk
  901	format(a1)
  100	continue
c
	norb=0
  200	read(10,902,end=300) wds1,dd1,p1,pflag,grade1,keep
  902	format(t20,a10,1x,a12,t81,f12.6,a1,t244,f3.1,t250,a1)
	if (wds1   .eq. '          ') go to 200
	if (keep   .ne. 'y') go to 200
	if (grade1 .gt. 6.5) go to 200
	if (pflag  .eq. 'c') p1=p1*100.
	if (pflag  .eq. 'd') p1=p1/365.2422
	norb=norb+1
	wds(norb)=wds1
	dd(norb)=dd1
	p(norb)=p1
	grade(norb)=grade1
	rev(norb)=0.
	go to 200
c
  300	write(6,991) norb
  991	format(' orb6.master read, norb = ',i6)
c
  400	read(11,903,end=600) wds1,dd1,date1,date2,nobs1
  903	format(a10,a12,2f5.0,i5)
	do 500 n=1,norb
	if (wds1 .ne. wds(n)) go to 500
	if (dd1 .ne. dd(n)) go to 500
	rev(n)=(date2-date1)/p(n)
	nobs(n)=nobs1
  500	continue
	go to 400
c
  600	do 700 n=1,norb
	write(12,904) wds(n),dd(n),p(n),rev(n),nobs(n),grade(n)
  904	format(a10,1x,a12,2f12.5,i5,f6.1)
  700	continue
c
  999	stop
	end

	

