C
	character*69 f1,f2,aa
	integer a(30000)
	real b(30000,8)
	real d1(270),d2(270),d3(270),d4(270),d5(270),d6(270)
	integer di(270)
	
	k=iargc()
	if(k.lt.1)then
	  write(*,*)
	  write(*,*)'***** Usage: j_als2lst file (2000.7)********'
	  write(*,*)
	  write(*,*)
	  stop
	endif
	call getarg(1,f1)
        k=index(f1,'.')
	if(k.ne.0)f1=f1(1:k-1)//'  '

	k=lnblnk(f1)
	f2=f1(1:k)//'.als'
	open(1,file=f2,status='old')
	read(1,'(a)')head
	read(1,'(a)')head
	read(1,'(a)')head
	i=0
110	i=i+1
	read(1,*,err=1100,end=1100)a(i),(b(i,j),j=1,5)
	goto 110
1100	n=i-1
	close(1)

	f2=f1(1:k)//'.lst'
	open(2,file=f2,status='old')
	k=0
10	read(2,'(a)',end=11)aa
	read(aa(1:),*)i
	k=k+1
	di(k)=i
	read(aa(40:),*)d6(k)
	do 13 j=1,n
	if(i.eq.a(j))then
	d1(k)=b(j,1)
	d2(k)=b(j,2)
	d3(k)=b(j,3)
	d4(k)=b(j,4)
	d5(k)=b(j,5)
	goto 10
	endif
13	continue
	goto 10
11	close(2)
	open(1,file=f1(1:lnblnk(f1))//'.lst',status='unknown')
	do 12 i=1,k
12	write(1,'(i6,6f10.3)')di(i),d1(i),d2(i),d3(i),d4(i),d5(i),d6(i)	
	close(1)
        write(*,*)'all psf star:',k
	end

