program orb6corbits c c This program reads data from orb6.master and c generates html files containing the "keeper" orbits c for the calibration pairs. c character*1 junk,keep,note,ref2 character*20 rad,ads,hd,hip,v1,v2,p,pe,a,ae,ii,iie,nn, $ nne,t,te,e,ee,o,oe,eqnx,last character*7 ref1 character*4 ads1 character*10 wds,wdsc(100) character*15 star,starc(100) character*18 png character*168 header character*232 data character*264 header2 c open(10,file='/home/wih/Orbits/Catalog/orb6.master', $ status='UNKNOWN') open(11,file='orb6corbits.top',status='UNKNOWN') open(12,file='orb6corbits.html',status='UNKNOWN') open(13,file='orb6corbits.body',status='UNKNOWN') open(16,file='orb6c.stars',status='UNKNOWN') c c read in calibration stars c ncal=1 50 read(16,950,end=80) wdsc(ncal),starc(ncal) 950 format(a10,1x,a15) ncal=ncal+1 go to 50 80 ncal=ncal-1 c c read header lines from orbit catalog c do 100 n=1,4 100 read(10,901) junk 901 format(a1) c do 120 n=1,13 read(11,922) header 922 format(a168) write(12,922) header 120 continue c norbits=0 c c write header lines for orb6orbits.body c write(13,902) 902 format(''/''/''/ $ ''/'

'/'
')
c
c	read and write header lines for html file
c
  200	read(11,903,end=300) header
  903	format(a168)
  	write(12,903) header
	go to 200
c
c	read star name and orbital elements. Loop back for another 
c	if orbit isn't a "keeper"
c
  300	read(10,904,end=700) rad,wds,star,ads,hd,hip,v1,v2,p,pe,a,ae,
     $     ii,iie,nn,nne,t,te,e,ee,o,oe,eqnx,last,grade,note,keep,
     $     ref1,ref2,png,data
  904	format(a18,1x,a10,1x,a15,a6,2a7,2a7,1x,a13,a12,a11,a9,
     $     2a9,a10,a9,a13,a12,2a9,2a9,2a5,10x,f3.1,1x,a1,1x,a1,1x,
     $     a7,a1,1x,a18,t1,a232)
	if (wds .eq. '          ') go to 300
	if (keep .ne. 'y') go to 300
c
	iflag=0
	do 350 nc=1,ncal
	if (wds .ne. wdsc(nc)) go to 350
	if (star .ne. starc(nc)) go to 350
	iflag=1
	go to 370
  350	continue
  370	if (iflag .eq. 0) go to 300
c
	igrade=nint(grade)
	if (grade .lt. 1.49) igrade=1
	if (grade .gt. 4.51) igrade=5
	if (grade .gt. 7.51) igrade=8
	if (grade .gt. 8.51) igrade=9
c
c	write lines for orb6orbits.html
c
        ads1='ADS '
        if (ads .eq. '.     ') ads='      '
        if (ads .eq. '      ') ads1='    '
c
	if ((note .ne. 'n') .and. (grade .ne. 6.6))
     $     write(12,905) wds,rad,wds,star,hd,v1,p,a,ii,
     $     nn,t,e,o,eqnx,igrade,note,png,wds,ref1,ref2,ref1,ref2
  905   format('',a18,1x,a10,1x,a15,a7,1x,a7,1x,
     $     a13,2x,a11,1x,a9,1x,a10,1x,a13,2x,a9,1x,a9,1x,a5,i2,1x,a1,
     $     ' P',
     $     ' E',
     $     '  ',a7,a1,'')
c
	if ((note .eq. 'n') .and. (grade .ne. 6.6)) 
     $     write(12,906) wds,rad,wds,star,hd,v1,p,a,ii,
     $     nn,t,e,o,eqnx,igrade,wds,png,wds,ref1,ref2,ref1,ref2
  906   format('',a18,1x,a10,1x,a15,a7,1x,a7,1x,
     $     a13,2x,a11,1x,a9,1x,a10,1x,a13,2x,a9,1x,a9,1x,a5,i2,
     $     ' N',
     $     ' P',
     $     ' E',
     $     '  ',a7,a1,'')
c
        write(12,907) ads1,ads,hip,v2,pe,ae,iie,nne,te,ee,oe,last
  907   format(30x,a4,a6,5x,a7,1x,a7,2x,a12,3x,a9,2x,a9,1x,a9,3x,
     $     a12,2x,a9,1x,a9,1x,a5/)
c
c	write lines for orb6corbits.body
c
	if ((note .ne. 'n') .and. (ref2 .ne. ' ') .and. 
     $     (grade .ne. 6.6))
     $     write(13,908) rad,wds,star,hd,v1,p,a,ii,nn,t,e,o,eqnx,
     $     igrade,note,png,wds,ref1,ref2,ref1,ref2
  908	format(a18,1x,a10,1x,a15,a7,1x,a7,1x,
     $     a13,2x,a11,1x,a9,1x,a10,1x,a13,2x,a9,1x,a9,1x,a5,i2,1x,a1,
     $     ' P',
     $     ' E ',
     $     ' ',a7,a1,'')
c
  	if ((note .eq. 'n') .and. (ref2 .ne. ' ') .and. 
     $     (grade .ne. 6.6))
     $     write(13,909) rad,wds,star,hd,v1,p,a,ii,nn,t,e,o,eqnx,
     $     igrade,wds,png,wds,ref1,ref2,ref1,ref2
  909	format(a18,1x,a10,1x,a15,a7,1x,a7,1x,a13,2x,a11,1x,a9,1x,a10,
     $     1x,a13,2x,a9,1x,a9,1x,a5,i2,
     $     ' N',
     $     ' P',
     $     ' E ',
     $     ' ',a7,a1,'')
c
	if ((note .ne. 'n') .and. (ref2 .eq. ' ') .and. 
     $     (grade .ne. 6.6))
     $     write(13,910) rad,wds,star,hd,v1,p,a,ii,nn,t,e,o,eqnx,
     $     igrade,note,png,wds,ref1,ref1
  910	format(a18,1x,a10,1x,a15,a7,1x,a7,1x,
     $     a13,2x,a11,1x,a9,1x,a10,1x,a13,2x,a9,1x,a9,1x,a5,i2,1x,a1,
     $     ' P',
     $     ' E ',
     $     ' ',a7,'')
c
  	if ((note .eq. 'n') .and. (ref2 .eq. ' ') .and. 
     $     (grade .ne. 6.6)) 
     $     write(13,911) rad,wds,star,hd,v1,p,a,ii,nn,t,e,o,eqnx,
     $     igrade,wds,png,wds,ref1,ref1
  911	format(a18,1x,a10,1x,a15,a7,1x,a7,1x,a13,2x,a11,1x,a9,1x,a10,
     $     1x,a13,2x,a9,1x,a9,1x,a5,i2,
     $     ' N',
     $     ' P',
     $     ' E ',
     $     ' ',a7,'')
c
        write(13,907) ads1,ads,hip,v2,pe,ae,iie,nne,te,ee,oe,last
c
	go to 300
c
  700	write(12,913)
  913	format('
'/'') write(13,914) 914 format(''/'') c 999 stop end