| ckhave |
|
Table of contents
Procedure
CKHAVE ( CK --- Are there any loaded? )
ENTRY CKHAVE ( FOUND )
Abstract
Determine whether or not any C-kernels are currently loaded.
Required_Reading
CK
DAF
Keywords
CK
Declarations
LOGICAL FOUND
Brief_I/O
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
FOUND O .TRUE. if at least one C-kernel is loaded.
Detailed_Input
None.
Detailed_Output
FOUND is returned with the value .TRUE. if at least one
C-kernel is currently loaded. Otherwise it returns
the value .FALSE.
Parameters
None.
Exceptions
Error free.
Files
None.
Particulars
This entry point allows the user to query the set of "loaded"
C-kernels to make sure that at least one C-kernel has been loaded.
This allows you to avoid making a search of an empty set of
loaded kernels which forces a SPICELIB error to be signaled.
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 want to call one of the C-kernel readers, but wish
to handle the exceptional case of "no kernels loaded" so that
the SPICE exception handling mechanism is avoided in the case
of an empty set of loaded kernels. The code example below
shows how you might do this.
Example code begins here.
PROGRAM CKHAVE_EX1
IMPLICIT NONE
C
C Local variables.
C
LOGICAL LOADED
C
C We have not loaded any CK.
C
CALL CKHAVE ( LOADED )
IF ( LOADED ) THEN
C
C Here we could be calling CK readers. For this
C example, just display a message indicating that
C at least one CK has been loaded.
C
WRITE(*,*) 'At least one CK has been loaded. '
. // 'You may call CK readers.'
ELSE
WRITE(*,*) 'No CK has been loaded.'
WRITE(*,*) 'Calling CK readers will result in an '
. // 'error.'
END IF
END
When this program was executed on a Mac/Intel/gfortran/64-bit
platform, the output was:
No CK has been loaded.
Calling CK readers will result in an error.
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 4.0.4, 16-JUL-2020 (JDR)
Edited the header to comply with NAIF standard. Added complete
code example based on existing example code fragment.
SPICELIB Version 4.0.3, 30-JAN-2017 (NJB)
Corrected various spelling errors within comments.
SPICELIB Version 4.0.2, 28-FEB-2008 (BVS)
Corrected the contents of the $Required_Reading section.
SPICELIB Version 4.0.1, 31-OCT-2001 (NJB)
Typo corrected.
SPICELIB Version 4.0.0, 17-FEB-2000 (WLT)
Added the Entry point CKHAVE.
SPICELIB Version 3.0.0, 03-MAR-1999 (WLT)
|
Fri Dec 31 18:36:02 2021