cccccc checks for compressed file
cccccc loops through fits keywords and outputs compressed=1 or 0
ccc  f77 isFileCompressed.f -o isFileCompressed.e -L/star/lib `cfitsio_link`
       program isFileCompressed
       implicit none
       integer isCompressed,inunit,status,ios,readwrite,
     >blocksize,nhdu,hdunum,j,hdutype,nkeys,nspace,
     >i
       character argc*300,filename*300,record*80,comment*80
     >,keyval*80,value*80,keyword*8
       isCompressed=0
       status=0
       call getarg(1,argc)
       read(argc,'(a)',IOSTAT=ios) filename
cc       write (6,*) filename
       call ftgiou(inunit,status)     
       readwrite=0
cc       write (6,*) status
       call ftopen(inunit,filename,readwrite,blocksize,status)
cc       write (6,*) status
       call ftthdu(inunit,hdunum,status)
cc       write (6,*) hdunum
       do j=1,hdunum
       call ftmahd(inunit,j,hdutype,status)
cc       write (6,*) j,hdutype,status
       status=0
     
       call ftghsp(inunit,nkeys,nspace,status)
       do i = 1, nkeys
c           call ftgrec(inunit,i,record,status)
       call ftgkyn(inunit,i,keyword,value,comment,status)
c       write(6,*) keyword,value
       if (keyword .eq. 'TTYPE1  ' .and. 
     > value .eq. '''COMPRESSED_DATA''') then
       isCompressed=1
       goto 99

       end if 
       if (keyword .eq. 'EXTNAME ' .and. 
     > value .eq. '''COMPRESSED_IMAGE''') then
       isCompressed=1
       goto 99

       end if 
       if (keyword .eq. 'ZCMPTYPE')  then
       isCompressed=1
       goto 99
 
       end if 
       end do 





       end do
 99    call ftclos(inunit, status)
       call ftfiou(inunit, status)
       if (isCompressed .eq. 1) then
       write (6,*) 'isCompressed=1'
       else
       write (6,*) 'isCompressed=0'
       end if
       stop
       end
