C----------------------------------------------------------------------
        subroutine fttkey(keynam,status)

C       test that keyword name contains only legal characters:
C         uppercase letters, numbers, hyphen, underscore, or space

C       keywrd  c*8  keyword name
C       OUTPUT PARAMETERS:
C       status  i  output error status (0 = ok)

        character keynam*(*)
        integer status,i
        character*1 c1

        if (status .gt. 0)return

        do 20 i=1,8
            c1=keynam(i:i)
            if (c1 .ge. 'A' .and. c1 .le. 'Z')then
            else if (c1 .ge. '0' .and. c1 .le. '9')then
            else if (c1 .eq. ' ' .or. c1 .eq. '-' .or. c1 .eq. '_')then
            else 
C                       illegal character found
                        status=207
                        return
            end if
20      continue
        end
