C$Procedure RDMISN ( Read the mission template file. ) SUBROUTINE RDMISN ( MTEMPL, SECTN, PASS1, KWTBLE, KWPTR, KWVALS ) C$ Abstract C C Read a mission template file for generating a set of labels. C This subroutine is for use ONLY with the maklabel program. C C$ Copyright C C Copyright (1997), California Institute of Technology. C U.S. Government sponsorship acknowledged. C C$ Required_Reading C C None. C C$ Keywords C C None. C C$ Declarations IMPLICIT NONE INTEGER LBCELL PARAMETER ( LBCELL = -5 ) CHARACTER*(*) MTEMPL CHARACTER*(*) SECTN LOGICAL PASS1 CHARACTER*(*) KWTBLE ( LBCELL: * ) INTEGER KWPTR ( LBCELL: * ) CHARACTER*(*) KWVALS ( LBCELL: * ) C$ Brief_I/O C C Variable I/O Description C -------- --- -------------------------------------------------- C MTEMPL I The name of the mission template file. C SECTN I The name of the section to read from the file. C PASS1 I A logical indicating whether this is the first read C KWTBLE I/O Name portion of a symbol table C KWPTR I/O Pointer portion of a symbol table C KWVALS I/O Value portion of a symbol table. C C$ Detailed_Input C C MTEMPL The name of the mission template file. This must be a C full path name. This file contains the mission specific C keyword-value pairs in the following format: C C = C = C . C . C . C = C C --
C = C = C . C . C . C = C C --
C = C = C . C . C . C = C C SECTN is the name of a section from which values should C be extracted in the mission template file. C C PASS1 is a logical flag indicating whether the first C block should be read from the mission template. C Normally, PASS1 should be true only if the mission C template file has not been read before. C C If PASS1 is TRUE, the defaults section is read from C the mission template file. If PASS1 is false, C the default section is ignored. C C KWTBLE is a symbol table that contains the results C KWPTR of previous reads of the mission template file C KWVALS The 'name' array KWTBLE will contain the names C of keywords that have been read previously. C The KWVALS contains the values of previously read C keywords. C C$ Detailed_Output C C KWTBLE is a symbol table that contains the results C KWPTR after reading the mission template file. C KWVALS Keywords encountered and parsed on this read C overwrite any previous values. C C$ Parameters C C None. C C$ Exceptions C C C 1) If the mission template file does not exist, the error C MAKLABEL(NOSUCHFILE) will be signalled. C C$ Files C C None. C C$ Particulars C C None. C C$ Examples C C None. C C$ Restrictions C C None. C C$ Literature_References C C None. C C$ Author_and_Institution C C W.L. Taber (JPL) C K.R. Gehringer (JPL) C C$ Version C C- Beta Version 3.0.0, 10-JAN-1997 (WLT) C C With the exception of the check for the existence of the C mission template file, the entire routine has changed. C The calling sequence is not the same as in previous C incarnations nor is the structure of the routine. Now C its basically 3 subroutine calls. Before it was several C hundred lines of code. C C- Beta Version 1.0.0, 13-NOV-1994 (KRG) C C-& C$ Index_Entries C C maklabel read mission template file C C-& C C SPICELIB functions C LOGICAL EXISTS LOGICAL FAILED LOGICAL RETURN C C Local variables C INTEGER WDSIZE PARAMETER ( WDSIZE = 32 ) CHARACTER*(WDSIZE) NAME LOGICAL EOF C C Standard SPICE error handling. C IF ( RETURN () ) THEN RETURN END IF CALL CHKIN ( 'RDMISN' ) C C Be sure that the file exists before we try to open it. This also C detects a blank filename. C IF ( .NOT. EXISTS(MTEMPL) ) THEN CALL SETMSG ( 'The mission template file ''#'' does' . // ' not exist.' ) CALL ERRCH ( '#', MTEMPL ) CALL SIGERR ( 'MAKLABEL(NOSUCHFILE)' ) CALL CHKOUT ( 'RDMISN' ) RETURN END IF C C Open the mission template file. C CALL RDSNEW ( MTEMPL, SECTN, '--', PASS1 ) IF ( FAILED() ) THEN CALL CHKOUT ( 'RDMISN' ) RETURN END IF EOF = .FALSE. DO WHILE ( .NOT. EOF ) CALL RKWVAL ( KWTBLE, KWPTR, KWVALS, NAME, EOF ) IF ( FAILED() ) THEN CALL CHKOUT ( 'RDMISN' ) RETURN END IF END DO CALL CHKOUT ( 'RDMISN' ) RETURN END