dafgdr |
Table of contents
ProcedureDAFGDR ( DAF, get double precision record ) ENTRY DAFGDR ( HANDLE, RECNO, BEGIN, END, DATA, FOUND ) AbstractRead a portion of the contents of a double precision record in a DAF file. 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. ExceptionsNone. FilesNone. ParticularsDAFGDR 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. ExamplesThe following code fragment illustrates one way that DAFGDR 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 DAFGDR ( 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) 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) F.S. Turner (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. 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) |
Fri Dec 31 18:36:08 2021