ckhave |
Table of contents
ProcedureCKHAVE ( CK --- Are there any loaded? ) ENTRY CKHAVE ( FOUND ) AbstractDetermine whether or not any C-kernels are currently loaded. Required_ReadingCK DAF KeywordsCK DeclarationsLOGICAL FOUND Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- FOUND O .TRUE. if at least one C-kernel is loaded. Detailed_InputNone. Detailed_OutputFOUND is returned with the value .TRUE. if at least one C-kernel is currently loaded. Otherwise it returns the value .FALSE. ParametersNone. ExceptionsError free. FilesNone. ParticularsThis 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. ExamplesThe 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. RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionN.J. Bachman (JPL) J. Diaz del Rio (ODC Space) B.V. Semenov (JPL) W.L. Taber (JPL) VersionSPICELIB 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