	program addpng
c
c	add names of new png files to orb6.newmaster
c
	character*278 title
	character*243 orb(3000),orb1
	character*14 ref(3000),ref1
	character*18 png(3000),png1
	character*10 rad
	integer iflag(3000)
	dimension grade(3000)
c
	open(10,file='addpng.in',status='UNKNOWN')
	open(11,file='orb6.newmaster',status='UNKNOWN')
	open(12,file='orb6.newmaster2',status='UNKNOWN')
	open(13,file='addpng.nomatch',status='UNKNOWN')
c
	do 100 n=1,4
	read(11,903) title
  903	format(a278)
	write(12,903) title
  100	continue
c
	norb=183
	do 150 n=1,norb
   	read(10,901) orb(n),grade(n),ref(n),png(n)
  901	format(a243,f3.1,a14,a18)
	iflag(n)=0
  150	continue
c
  200	read(11,902,end=600) orb1,grade1,ref1,png1,rad
  902	format(a243,f3.1,a14,a18,t1,a10)
	if (rad .eq. '          ') go to 500
	if (grade1 .le. 0.1) write(6,901) orb1,grade1,ref1,png1
	if (png1 .ne. '                  ') go to 400
	do 300 n=1,norb
	if (orb1 .ne. orb(n)) go to 300
	if (ref1 .ne. ref(n)) go to 300
	if (abs(grade1-grade(n)) .gt. 0.51) go to 300
	png1=png(n)
	grade1=grade(n)
	iflag(n)=iflag(n)+1
	go to 400
  300	continue
c
  400	write(12,901) orb1,grade1,ref1,png1
	go to 200
c
  500	write(12,904)
  904	format(277x,' ')
	go to 200
c
  600	do 700 n=1,norb
	if (iflag(n) .ne. 1) write(13,901) orb(n),grade(n),ref(n),png(n)
  700	continue
c
  999	stop
	end
