C-------------------------------------------------------------------------- subroutine ftgunt(iunit,keywrd,kunit,status) C read the unit string from the comment string from a header record C C iunit i fortran input unit number C keywrd c keyword name C OUTPUT PARAMETERS: C kunit c output keyword units C status i returned error status (0=ok) C C written by Wm Pence, HEASARC/GSFC, July 1997 character*(*) keywrd,kunit integer iunit,ii,status,ulen character value*35,comm*72 if (status .gt. 0)return kunit = ' ' C find the keyword and return value and comment as character strings call ftgkey(iunit,keywrd,value,comm,status) if (status .gt. 0)return C look for brackets enclosing the units string if (comm(1:1) .eq. '[')then ulen=2 do 10 ii = 3,72 if (comm(ii:ii) .eq. ']')go to 20 ulen=ii 10 continue return 20 kunit=comm(2:ulen) end if end