dasrwr |
Table of contents
ProcedureDASRWR ( DAS, read/write records ) SUBROUTINE DASRWR ( HANDLE, . RECNO, . RECC, . RECD, . RECI, . FIRST, . LAST, . DATAD, . DATAI, . DATAC ) AbstractRead and write DAS physical records. Required_ReadingDAS KeywordsASSIGNMENT DAS FILES DeclarationsIMPLICIT NONE INTEGER NWD PARAMETER ( NWD = 128 ) INTEGER NWI PARAMETER ( NWI = 256 ) INTEGER NWC PARAMETER ( NWC = 1024 ) INTEGER HANDLE INTEGER RECNO CHARACTER*(*) RECC DOUBLE PRECISION RECD ( NWD ) INTEGER RECI ( NWI ) INTEGER FIRST INTEGER LAST DOUBLE PRECISION DATAD ( * ) INTEGER DATAI ( * ) CHARACTER*(*) DATAC INTEGER BUFSZD PARAMETER ( BUFSZD = 10 ) INTEGER BUFSZI PARAMETER ( BUFSZI = 10 ) INTEGER BUFSZC PARAMETER ( BUFSZC = 10 ) Brief_I/OVARIABLE I/O ENTRY POINTS -------- --- -------------------------------------------------- HANDLE I RRD, RRI, RRC, WRD, WRI, WRC, URD, URI, URC RECNO I RRD, RRI, RRC, WRD, WRI, WRC, URD, URI, URC RECC I WRC RECD I WRD RECI I WRI FIRST I RRD, RRI, RRC, URD, URI, URC LAST I RRD, RRI, RRC, URD, URI, URC DATAD O RRD, URD DATAI O RRI, URI DATAC O RRC, URC NWD P RRD, WRD, URD NWI P RRI, WRI, URI NWC P RRC, WRC, URC BUFSZD P RRD, WRD, URD BUFSZI P RRI, WRI, URI BUFSZC P RRC, WRC, URC Detailed_InputSee the entry points for a discussion of their inputs. Detailed_OutputSee the entry points for a discussion of their outputs. ParametersNWD is the number of DPs in a single DAS record containing DPs. NWI is the number of integers in a single DAS record containing integers. NWC is the number of characters in a single DAS record containing characters. BUFSZD, BUFSZI, BUFSZC are, respectively, the number of records in the data buffers for double precision, integer, and character records. Exceptions1) If this routine is called directly, the error SPICE(BOGUSENTRY) is signaled. 2) See the entry points for discussions of their exceptions. FilesSee the description of the argument HANDLE in the headers of the entry points for a description of files accessed by this set of routines. ParticularsThis suite of routines provides buffered read and write access to DAS files. The purpose of this feature is to increase the performance of application programs that access DAS files: in particular, repeated reads from or writes to a given record should be relatively fast, because the contents of the most recently accessed records are buffered in memory. Thus DASRWR and its entry points act as a miniature virtual memory system for DAS files. These routines are intended primarily for use by other SPICELIB routines; users' application programs will not normally need to call these routines. Writing to a DAS file with these routines demands a particularly circumspect approach: it's quite easy to end up with something other than a DAS file if one misuses the routines. The entry points of DASRWR support writing, reading, and updating the records in a DAS file. The distinction between writing and updating is that any record may be written (as long as the record belongs to a file open for writing), but only existing records may be updated. `Writing' a record sets the values of all of the elements of the record, while a subrange of the elements of an existing record may be `updated'. For each of these three operations, there are three DAS routines, one for each supported data type. The names of the routines are -- For writing: DASWRC, DASWRD, DASWRI -- For updating: DASURC, DASURD, DASURI -- For reading: DASRRC, DASRRD, DASRRI Users should note that, unlike in the case of SPICELIB's DAF routines, the DAS routines buffer data that is written as well as data that is read. Consequently a DAS file does not necessarily yet contain, at any moment, all of the data that has been written to it by the DASWRx or DASURx routines. The written data that is buffered is written out when the need to buffer additional data requires it, and also when the user commands the closure of a file that has been written. So, at the time a DAS file is closed, the contents of the physical file do reflect what has been `written' to the file by the DASWRx and DASURx entry points. At any time, an application program can force the DAS system to write to a DAS file any buffered records maintained for that file. The entry point DASWBR (DAS, write buffered records) provides this capability. DASRWR contains three record buffers: one of character type, one of double precision type, and one of integer type. Each buffer has enough room for an integer number of records. The sizes of the buffers are parameterized and can be increased if necessary. When contemplating the revision of the buffer sizes selected by NAIF, SPICELIB users should take note of the following points: -- Changing values of parameters in NAIF subroutines may cause a maintenance burden for the users of the modified NAIF code, since any changes made to a SPICELIB routine will have to be made to any new version of that routine released by NAIF in a later version of SPICELIB. -- The effect of buffer size on the speed with which an application executes is highly dependent on the specific application. In some cases, increasing the buffer sizes may slow the application down. ExamplesSee the entry points for examples specific to those routines. RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionN.J. Bachman (JPL) J. Diaz del Rio (ODC Space) K.R. Gehringer (JPL) B.V. Semenov (JPL) W.L. Taber (JPL) VersionSPICELIB Version 2.1.0, 07-OCT-2021 (NJB) (JDR) Added initializers for record buffers. Edited the headers of DASRWR and all its entry points to comply with NAIF standard. Cleaned up the $Revisions history. SPICELIB Version 2.0.0, 05-FEB-2015 (NJB) Upgraded to support handle manager integration and reading of non-native files. SPICELIB Version 1.1.1, 10-FEB-2014 (BVS) Added description of NWD, NWI, and NWC to the $Parameters and $Brief_I/O sections of the header. SPICELIB Version 1.1.0, 17-NOV-1995 (NJB) Made modifications to the DASRRx routines to enhance efficiency. Removed references to the function RETURN. Removed weird spaces from ENTRY statements. SPICELIB Version 1.0.1, 28-OCT-1993 (KRG) Removed references to specific DAS file open routines in the $Detailed_Input section of the header for each entry point. This was done in order to minimize documentation changes if the DAS open routines ever change. SPICELIB Version 1.0.0, 30-JUN-1992 (NJB) (WLT) |
Fri Dec 31 18:36:11 2021