c 2010,3,20 for bok
	character*60 f1,c*1
        logical logi
        character*80 head(36)

	if(iargc().lt.1)then
	  write(*,*)
	  write(*,*)'         Usage:  pip241 bok_fit [!]'
	  write(*,*)'                                  2012,1'
	  write(*,*)
	  write(*,*)'          2*2 blocks'
	  write(*,*)'     11 12'
	  write(*,*)'     21 22'
          write(*,*)
	  write(*,*)'     if add !, u_psf4k DONOT delete any star' 
	  write(*,*)
	  stop
	endif

	call getarg(1,f1)
	c=' '
	if(iargc().gt.1)then
          call getarg(2,c)
	  if(c.ne.'!')c=' '
	endif

	k=index(f1,'.')
        if(k.eq.0)f1=f1(1:lnblnk(f1))//'.fit'
        inquire(file=f1,exist=logi)
        if(.not.logi)stop ' file not found !'

	k1=index(f1,'.')
	k=k1-1
	call system('u_phot4k '//f1(1:k))
	call system('u_1to4  '//f1(1:k))
	call system('mv '//f1(1:k)//'.ap '//f1(1:k1)//char(48)//'ap')
	do 10 i=1,4
	call system('mv '//f1(1:k1)//char(i+48)//'ap '//f1(1:k1)//'ap')
c 3. 
	call system('u_auto16 '//f1(1:k))
10      continue
        end
