	logical lo
	character*20 f2
        k=iargc()
        if(k.eq.0)then
          write(*,*)'               usage: pip512 batch'
          write(*,*)'                                      '
          write(*,*)
          stop
        endif
        call getarg(1,f2)
        
	inquire(file=f2,exist=lo)
	if(.not.lo)stop "batch file not found!"
	call b15("j_find512",f2)
	call b15("j_phot512",f2)
	call b15("j_xy512ad",f2)

	end

	subroutine b15(ch1,f2)
	character*(*) ch1
	character*20 f0,f1,f2
        f0=ch1
	open(15,file=f2,status='old')
10	read(15,'(a)',end=99)f1 
	call system(f0//' '//f1)
	goto 10
99	close(15)
	end
