Index of Functions: A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 
Index Page
kinfo

Table of contents
Procedure
Abstract
Required_Reading
Keywords
Declarations
Brief_I/O
Detailed_Input
Detailed_Output
Parameters
Exceptions
Files
Particulars
Examples
Restrictions
Literature_References
Author_and_Institution
Version

Procedure

     KINFO ( Kernel Information )

     ENTRY KINFO ( FILE, FILTYP, SRCFIL, HANDLE, FOUND )

Abstract

     Return information about a specific kernel

Required_Reading

     None.

Keywords

     KERNEL

Declarations

    CHARACTER*(*)         FILE
    CHARACTER*(*)         FILTYP
    CHARACTER*(*)         SRCFIL
    INTEGER               HANDLE
    LOGICAL               FOUND

Brief_I/O

     VARIABLE  I/O  DESCRIPTION
     --------  ---  --------------------------------------------------
     FILE       I   Name of a kernel to fetch information for
     FILTYP     O   The type of the kernel
     SRCFIL     O   Name of the source file used to load FILE.
     HANDLE     O   The handle attached to FILE.
     FOUND      O   .TRUE. if the specified file could be located.

Detailed_Input

     FILE     is the name of a kernel file for which KEEPER
              information is desired.

Detailed_Output

     FILTYP   is the type of the kernel specified by FILE.  FILE
              will be blank if FILE is not on the list of loaded
              kernels.

     SRCFIL   is the name of the source file that was used to
              specify FILE as one to load. If FILE was loaded
              directly via a call to FURNSH, SRCFIL will be blank.
              If FILE is not on the list of loaded kernels, SRCFIL
              will be blank

     HANDLE   is the handle attached to FILE if it is a binary
              kernel. If FILE is a text kernel or meta-text kernel
              HANDLE will be zero. If FILE is not on the list of
              loaded kernels, HANDLE will be set to zero.

     FOUND    is returned .TRUE. if FILE is on the KEEPER list of
              loaded kernels. If there is no such file, FOUND will
              be set to .FALSE.

Parameters

     None.

Exceptions

     Error free.

     1)  If the specified file is not on the list of files that are
         currently loaded via the interface FURNSH, FOUND will be
         .FALSE., HANDLE will be set to zero and FILTYP and SRCFIL will
         be set to blanks.

     2)  If any of  FILTYP or SRCFIL output strings has length too
         short to contain the corresponding output string, the string
         is truncated on the right.

Files

     None.

Particulars

     This entry point allows you to request information directly
     for a specific SPICE kernel.

Examples

     The numerical results shown for this example may differ across
     platforms. The results depend on the SPICE kernels used as
     input, the compiler and supporting libraries, and the machine
     specific arithmetic implementation.

     1) Suppose you wish to determine the types of kernels loaded
        by a given meta-kernel. The following code example shows
        how you might use this routine to do this.

        Use the meta-kernel shown below to load the required SPICE
        kernels.


           KPL/MK

           File name: kinfo_ex1.tm

           This meta-kernel is intended to support operation of SPICE
           example programs. The kernels shown here should not be
           assumed to contain adequate or correct versions of data
           required by SPICE-based user applications.

           In order for an application to use this meta-kernel, the
           kernels referenced here must be present in the user's
           current working directory.

           The names and contents of the kernels referenced
           by this meta-kernel are as follows:

              File name                     Contents
              ---------                     --------
              de421.bsp                     Planetary ephemeris
              pck00008.tpc                  Planet orientation and
                                            radii
              naif0009.tls                  Leapseconds


           \begindata

              KERNELS_TO_LOAD = ( 'de421.bsp',
                                  'pck00008.tpc',
                                  'naif0009.tls'  )

           \begintext

           End of meta-kernel


        Example code begins here.


              PROGRAM KINFO_EX1
              IMPLICIT NONE

        C
        C     SPICELIB functions
        C
              LOGICAL               EQSTR

        C
        C     Local constants.
        C
              INTEGER               FILLEN
              PARAMETER           ( FILLEN = 32 )

              INTEGER               TYPLEN
              PARAMETER           ( TYPLEN = 33 )

              INTEGER               SRCLEN
              PARAMETER           ( SRCLEN = 256 )

        C
        C     Local variables.
        C
              CHARACTER*(FILLEN)    FILE
              CHARACTER*(TYPLEN)    FILTYP
              CHARACTER*(SRCLEN)    SRCFIL

              INTEGER               COUNT
              INTEGER               HANDLE
              INTEGER               WHICH

              LOGICAL               FOUND

        C
        C     Load the meta-kernel.
        C
              CALL FURNSH ( 'kinfo_ex1.tm' )

        C
        C     Find out the total number of kernels in the kernel pool.
        C
              CALL KTOTAL ( 'all', COUNT )

              IF ( COUNT .EQ. 0 ) THEN

                 WRITE(*,*) 'No files loaded at this time.'

              ELSE

                 WRITE(*,*) 'The loaded files files are: '
                 WRITE(*,*) ' '

              END IF

        C
        C     Find the file name, type and source for each of the
        C     kernels in the kernel pool and print its type.
        C
              DO WHICH= 1, COUNT

                 CALL KDATA ( WHICH,  'all',  FILE, FILTYP,
             .                SRCFIL, HANDLE, FOUND        )

                 CALL KINFO ( FILE, FILTYP, SRCFIL, HANDLE, FOUND )

                 IF ( EQSTR( FILTYP, "SPK" ) ) THEN

                    WRITE(*,*) FILE, ' is an SPK file.'

                 ELSE IF ( EQSTR( FILTYP, "CK" ) ) THEN

                    WRITE(*,*) FILE, ' is a CK file.'

                 ELSE IF ( EQSTR( FILTYP, "PCK" ) ) THEN

                    WRITE(*,*) FILE, ' is a PCK file.'

                 ELSE IF ( EQSTR( FILTYP, "DSK" ) ) THEN

                    WRITE(*,*) FILE, ' is a DSK file.'

                 ELSE IF ( EQSTR( FILTYP, "EK" ) ) THEN

                    WRITE(*,*) FILE, ' is an EK file.'

                 ELSE IF ( EQSTR( FILTYP, "META" ) ) THEN

                    WRITE(*,*) FILE, ' is a meta-kernel file.'

                 ELSE

                    WRITE(*,*) FILE, ' is a text kernel.'

                 END IF

              END DO

              END


        When this program was executed on a Mac/Intel/gfortran/64-bit
        platform, the output was:


         The loaded files files are:

         kinfo_ex1.tm                     is a meta-kernel file.
         de421.bsp                        is an SPK file.
         pck00008.tpc                     is a text kernel.
         naif0009.tls                     is a text kernel.

Restrictions

     None.

Literature_References

     None.

Author_and_Institution

     N.J. Bachman       (JPL)
     J. Diaz del Rio    (ODC Space)
     B.V. Semenov       (JPL)
     W.L. Taber         (JPL)

Version

    SPICELIB Version 5.1.0, 08-AUG-2021 (JDR)

        Changed argument name SOURCE to SRCFIL for consistency with
        other routines.

        Edited the header to comply with NAIF standard.
        Created complete code example from existing code fragments.

        Added entry #2 to $Exceptions section.

    SPICELIB Version 5.0.0, 01-FEB-2017 (NJB) (BVS)

        Updated to support use of DSKs.

        Updated the $Author_and_Institution section.

    SPICELIB Version 1.0.0, 01-JUL-1999 (WLT)
Fri Dec 31 18:36:29 2021