dafrdr |
Table of contents
ProcedureDAFRDR ( DAF, read double precision record ) ENTRY DAFRDR ( HANDLE, RECNO, BEGIN, END, DATA, FOUND ) AbstractRead a portion of the contents of a double precision record in a DAF file. Obsolete: This routine has been superseded by DAFGDR, and it is supported for purposes of backwards compatibility only. Required_ReadingDAF KeywordsFILES DeclarationsINTEGER HANDLE INTEGER RECNO INTEGER BEGIN INTEGER END DOUBLE PRECISION DATA ( * ) LOGICAL FOUND Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- HANDLE I Handle of DAF. RECNO I Record number. BEGIN I First word to read from record. END I Last word to read from record. DATA O Contents of record. FOUND O .TRUE. if record is found. Detailed_InputHANDLE is the handle associated with a DAF. RECNO is the record number of a particular double precision record within the DAF, whose contents are to be read. BEGIN is the first word in the specified record to be returned. END is the final word in the specified record to be returned. Detailed_OutputDATA contains the specified portion (from BEGIN to END, inclusive) of the specified record from the specified file, specifically. FOUND is .TRUE. when the specified record is found, and is .FALSE. otherwise. ParametersNone. Exceptions1) If the file associated with HANDLE is not of the native binary file format, the error SPICE(UNSUPPORTEDBFF) is signaled. FilesNone. ParticularsDAFRDR checks the record buffer to see if the requested record can be returned without actually reading it from external storage. If not, it reads the record and stores it in the buffer, typically removing another record from the buffer as a result. Once in the buffer, the specified portion of the record is returned, using the following control loop. J = 1 DO I = MAX( 1, BEGIN ), MIN( 128, END ) DATA( J ) = Buffered record ( I ) J = J + 1 END DO Therefore bad values for BEGIN and END (BEGIN < 1, END < BEGIN, etc.) are not signaled as errors, but result in the actions implied by the above. This routine has been made obsolete by the routine DAFGDR, and it is supported for reasons of backwards compatibility only. New software development should utilize DAFGDA. ExamplesThe following code fragment illustrates one way that DAFRDR and DAFWDR can be used to update part of a double precision record. If the record does not yet exist, we can assume that it is filled with zeros. CALL DAFRDR ( HANDLE, RECNO, 1, 128, DREC, FOUND ) IF ( .NOT. FOUND ) THEN CALL MOVED ( 0.D0, 128, DREC ) END IF DO I = FIRST, LAST DREC(I) = NEW_VALUE(I) END DO CALL DAFWDR ( HANDLE, RECNO, DREC ) Note that since only entire records may be written using DAFWDR, the entire record needs to be read also. Restrictions1) An integer overflow may occur if the number of requests by a single program exceeds the maximum number that can be stored in an integer variable. 2) Bad values for BEGIN and END ( BEGIN < 1, END > 128, END < BEGIN ) are not signaled as errors. The effects of such assignments on the returned data are defined by the following control structure: J = 1 DO I = MAX( 1, BEGIN ), MIN( 128, END ) DATA( J ) = Buffered record ( I ) J = J + 1 END DO Literature_ReferencesNone. Author_and_InstitutionN.J. Bachman (JPL) J. Diaz del Rio (ODC Space) J.M. Lynch (JPL) H.A. Neilan (JPL) W.L. Taber (JPL) F.S. Turner (JPL) I.M. Underwood (JPL) VersionSPICELIB Version 2.1.0, 12-AUG-2021 (NJB) (JDR) Bug fix: now NREAD is not incremented once it reaches INTMAX(), if it does. Tweaked one line of code to suppress ftnchek warning. Re-ordered header sections. Corrected typos in comments. Edited the header to comply with NAIF standard. Removed DAF required reading from $Literature_References. SPICELIB Version 2.0.0, 16-NOV-2001 (FST) Added SPICE(UNSUPPORTEDBFF) exception to the routine. SPICELIB Version 1.3.0, 24-MAR-2000 (WLT) The loop in DAFRDR that moved buffered d.p.s into the output array DATA was modified to use the routine MOVED. SPICELIB Version 1.2.0, 01-AUG-1997 (NJB) Unnecessary CHKIN and CHKOUT calls were removed from entry point DAFRDR. SPICELIB Version 1.1.0, 25-NOV-1992 (JML) 1) In DAFRDR, the found flag is now set to false if the call to DAFHLU fails. 2) In the example code fragment in DAFRDR and DAFWDR, the calling sequence to MOVED was corrected. 3) In the call to MINAI the argument for the minimum value was changed from I to MINVAL. SPICELIB Version 1.0.2, 10-MAR-1992 (WLT) Comment section for permuted index source lines was added following the header. SPICELIB Version 1.0.1, 22-MAR-1990 (HAN) Literature references added to the header. SPICELIB Version 1.0.0, 31-JAN-1990 (IMU) |
Fri Dec 31 18:36:09 2021