        SUBROUTINE INST_KEY_FIND(KEYNAME,JFILE,FOUND,DEFINED,TYPE,
     .                          NELEM,MULT)
C
C----------------------------------------------------------------------
C
C.IDENTIFICATION: Subroutine INST_KEY_FIND
C.LIBRARY:        PDSLIB
C.AUTHOR:         D. Dal Fiume - TeSRE Bologna
C.VERSIONS:       0.1 - 25 Nov 94 - Test version
C.PURPOSE:        find a keyword and return some characteristics
C.METHOD:         the keyword values are passed via PDSKEYS common
C.SYNTAX:         CALL INST_KEY_FIND(KEYNAME,FOUND,DEFINED,TYPE,NELEM,MULT)
C.PARAMETERS:     KEYNAME char*8   the name of the keyword (in)
C                 JFILE   integer  the XAS ordinal number of the file
C                                  to be scanned (in)
C                 FOUND   logical  .TRUE. if the keyword is legal (out)
C                 DEFINED logical  .TRUE. if the keyword was defined
C                                  or loaded from full header (out)
C                 TYPE    integer  numeric code for type of value
C                                  0 -> character
C                                  1 -> integer*2
C                                  2 -> integer*4
C                                  3 -> real*4
C                                  4 -> real*8         (out)
C                 NELEM   integer  number of elements (if array) (out)
C                 MULT    integer  multiplicity of this keyword (out)
C.RESTRICTIONS:   should be called only via INSTRUMENT_KEY_FIND
C.NOTES:
C.FILES:
C.REFERENCES      none
C
C----------------------------------------------------------------------
C
C
       INCLUDE          'instkeys.inc'
       INCLUDE          'voscommon.inc'
C
       LOGICAL          FOUND, DEFINED
       CHARACTER        KEYNAME*(*)
       INTEGER          TYPE
C
C      Loop on all legal PDS keywords for this type of file
C
       DO 1 I=1,PDSKEYS_NUMKEY(JFILE)
	 IF(PDSKEYS_KEYNAM(I,JFILE).EQ.KEYNAME)THEN
C
C          Ok. We have the right keyword. Get info.
C
	   FOUND=.TRUE.
	   DEFINED=PDSKEYS_KEYFLG(I,JFILE)
	   MULT=PDSKEYS_KEYMUL(I,JFILE)
	   NELEM=PDSKEYS_KEYELM(I,JFILE)
	   IF(PDSKEYS_KEYTYP(I,JFILE).EQ.'C')THEN
	     TYPE=0
	     ELSEIF(PDSKEYS_KEYTYP(I,JFILE).EQ.'I')THEN
	     TYPE=1
	     ELSEIF(PDSKEYS_KEYTYP(I,JFILE).EQ.'J')THEN
	     TYPE=2
	     ELSEIF(PDSKEYS_KEYTYP(I,JFILE).EQ.'R')THEN
	     TYPE=3
	     ELSEIF(PDSKEYS_KEYTYP(I,JFILE).EQ.'D')THEN
	     TYPE=4
	   ENDIF
	   RETURN
	 ENDIF
   1   CONTINUE
C
C      We exited the loop without any good hit.
C      Set FOUND as .FALSE. and leave everything else as is.
C
       FOUND=.FALSE.
       RETURN
       END
