dasioc |
Table of contents
ProcedureDASIOC ( DAS, Fortran I/O, character ) SUBROUTINE DASIOC ( ACTION, UNIT, RECNO, RECORD ) AbstractPerform Fortran reads and writes of DAS character records. Required_ReadingDAS KeywordsDAS FILES UTILITY DeclarationsIMPLICIT NONE INTEGER NWC PARAMETER ( NWC = 1024 ) CHARACTER*(*) ACTION INTEGER UNIT INTEGER RECNO CHARACTER*(NWC) RECORD Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- ACTION I Action to take (read or write). UNIT I Fortran unit connected to DAS file. RECNO I Number of record to read or write. RECORD I-O DAS character record. Detailed_InputACTION is a character string specifying whether to read from or write to the specified DAS file. Possible values are: 'READ' 'WRITE' Case and leading or trailing blanks are not significant. UNIT is the Fortran unit number connected to the DAS file that is to be read or written. Given the handle of the DAS file, the unit number can be obtained using ZZDDHHLU. RECNO is the Fortran record number of the record to be read or written. RECORD is a character array whose contents are to be written to record RECNO, if ACTION is WRITE. Detailed_OutputRECORD is a character array whose contents are to be set equal to those of record RECNO, if ACTION is READ. ParametersNWC is the number of characters in a DAS character record. Exceptions1) If the value of ACTION is not recognized, the error SPICE(UNRECOGNIZEDACTION) is signaled. 2) If a Fortran read error occurs, the error SPICE(DASFILEREADFAILED) is signaled. 3) If a Fortran write error occurs, the error SPICE(DASFILEWRITEFAILED) is signaled. FilesSee the description of the argument UNIT in $Detailed_Input. ParticularsNormally, routines outside of SPICELIB will not need to call this routine directly. Writes to DAS files should be performed using the DASADx and DASUDx routines; reads should be performed using the DASRDx routines. This routines centralizes I/O and the concomitant error handling for DAS character records. Although most DAS routines use file handles to identify DAS files, this routine uses Fortran logical units for this purpose. Using unit numbers allows the DASIOx routines to be called from any DAS routine, including entry points of DASFM. (DASFM contains as entry points the routines DASHLU and DASLUH, which map between handles and unit numbers.) Examples1) Read and print to the screen character records number 10 through 20 from the DAS file designated by HANDLE. CHARACTER*(NWC) RECORD . . . CALL ZZDDHHLU ( HANDLE, 'DAS', .FALSE., UNIT ) CALL DASHFN ( HANDLE, NAME ) DO I = 1, 20 CALL DASIOC ( 'READ', UNIT, 10, RECORD ) LABEL = 'Contents of the # record in DAS file #: ' CALL REPMOT ( LABEL, '#', I, 'L', LABEL ) CALL REPMC ( LABEL, '#', NAME, LABEL ) WRITE (*,*) LABEL WRITE (*,*) ' ' WRITE (*,*) RECORD END DO 2) Write the contents of the string RECORD to record number 10 in the DAS file designated by HANDLE. CHARACTER*(NWC) RECORD . . . CALL ZZDDHHLU ( HANDLE, 'DAS', .FALSE., UNIT ) CALL DASIOC ( 'WRITE', UNIT, 10, RECORD ) RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionN.J. Bachman (JPL) J. Diaz del Rio (ODC Space) W.L. Taber (JPL) VersionSPICELIB Version 1.1.0, 12-AUG-2021 (JDR) Added IMPLICIT NONE statement. Edited the header to comply with NAIF standard. SPICELIB Version 1.0.1, 05-FEB-2015 (NJB) Header was updated to refer to ZZDDHHLU. SPICELIB Version 1.0.0, 30-JUN-1992 (NJB) (WLT) |
Fri Dec 31 18:36:11 2021