C ***** This is the routine in the COMINT Address Program ***** C ***** that processes the Data Section in the COMINT ***** C ***** Address Specification File. This routine will ***** C ***** read each record in the Data Section and look for ***** C ***** one of the following: blank line, comment only ***** C ***** line, end_of_data_section, address_specification ***** C ***** phrase, repeat block, invert_card_address_prom_msb, ***** C ***** Start Setting Card Address PROM Next to MSB phrase, ***** C ***** or else it is an illegal COMINT Address ***** C ***** Specification data section record. ***** C ***** ***** C ***** COMINT Address Program Rev. 29-OCT-1992 ***** SUBROUTINE Process_Data_Section C ***************************************** C Define all Variables and Arrays C ***************************************** IMPLICIT NONE INCLUDE 'ComAdrs_Common.INC' INTEGER*2 LineLength C *************************************************************** C Advertize that processing of the Data Section will start C *************************************************************** WRITE ( 6, 41 ) 41 FORMAT ( /, & ' The Data Section of the COMINT Address Specification', /, & ' file has beem found and will now be processed. ', /) C ******************************************************* C Get a record and see what it is C ******************************************************* 100 CALL Get_Record_and_Capitalize IF ( IOSTATUS .EQ. -1 ) GOTO 940 IF ( IOSTATUS .NE. 0 ) GOTO 970 C ************************************************************** C ***** Now test to see if this record is a blank line ***** C ************************************************************** IF ( NumChr .NE. 0 ) GOTO 180 C This record IS a blank line so get the next record IF ( Full_Display .EQ. 0 ) GOTO 100 WRITE ( 6, 170 ) 170 FORMAT ( /, ' This record is a blank line. ', / ) GOTO 100 C ********************************************************************** C ***** Now test to see if this record contains only a comment ***** C ********************************************************************** C Test the first character to see if it is a comment 180 IF ( ThisLine(1) .EQ. ';' ) GOTO 192 IF ( ThisLine(1) .EQ. '!' ) GOTO 192 IF ( ThisLine(1) .EQ. '*' ) GOTO 192 C The first character was NOT a comment so continue with tests GOTO 200 C The first character WAS a comment so get next record 192 IF ( Full_Display .EQ. 0 ) GOTO 100 WRITE ( 6, 195 ) 195 FORMAT ( /, ' This record contains only a comment. ', / ) GOTO 100 C ********************************************************************** C ***** This record is not a blank line or a comment only line, ***** C ***** so test to see if it is the end of the Data Section. ***** C ********************************************************************** 200 IF ( ThisLine(1) .EQ. 'E' .AND. & ThisLine(2) .EQ. 'N' .AND. & ThisLine(3) .EQ. 'D' .AND. & ThisLine(4) .EQ. '_' .AND. & ThisLine(5) .EQ. 'O' .AND. & ThisLine(6) .EQ. 'F' .AND. & ThisLine(7) .EQ. '_' .AND. & ThisLine(8) .EQ. 'D' .AND. & ThisLine(9) .EQ. 'A' .AND. & ThisLine(10) .EQ. 'T' .AND. & ThisLine(11) .EQ. 'A' .AND. & ThisLine(12) .EQ. '_' .AND. & ThisLine(13) .EQ. 'S' .AND. & ThisLine(14) .EQ. 'E' .AND. & ThisLine(15) .EQ. 'C' .AND. & ThisLine(16) .EQ. 'T' .AND. & ThisLine(17) .EQ. 'I' .AND. & ThisLine(18) .EQ. 'O' .AND. & ThisLine(19) .EQ. 'N' ) GOTO 220 C This is NOT the End of the Data Section so continue with other tests GOTO 250 C This IS the End of the Data Section so RETURN from Data Section processing 220 IF ( Full_Display .EQ. 0 ) RETURN WRITE ( 6, 221 ) 221 FORMAT (/, ' This record is the End of the Data Section. ', /) RETURN C ********************************************************************** C ***** This record is not a blank line, a comment only line, ***** C ***** or the end of the Data Section, so test to see if ***** C ***** this record is an Address Specification Phrase. ***** C ********************************************************************** C Test the first characters to see if they are: "Adrs=" 250 IF ( ThisLine(1) .EQ. 'A' .AND. & ThisLine(2) .EQ. 'D' .AND. & ThisLine(3) .EQ. 'R' .AND. & ThisLine(4) .EQ. 'S' .AND. & ThisLine(5) .EQ. '=' ) GOTO 260 C This does NOT look like the beginning of an Address Specification Phrase. GOTO 300 C This DOES look like the beginning of an Address Specification Phrase. C First test to verify that the Data Section has not yet included a C Start Setting CA PROM Next to MSB phrase and then call the C routine to handle the Address Specification phrase. 260 IF ( Set_CA_NT_MSB_Flag .EQ. .TRUE. ) GOTO 910 CALL Process_Address_Specification GOTO 100 C ********************************************************************** C ***** This record is not a blank line, a comment only line, ***** C ***** the end of the Data Section, or an Address Specification ***** C ***** Phrase, so test to see if this record is a Repeat Block. ***** C ********************************************************************** C Test the first characters to see if they are: "Repeat Block" 300 IF ( ThisLine(1) .EQ. 'R' .AND. & ThisLine(2) .EQ. 'E' .AND. & ThisLine(3) .EQ. 'P' .AND. & ThisLine(4) .EQ. 'E' .AND. & ThisLine(5) .EQ. 'A' .AND. & ThisLine(6) .EQ. 'T' .AND. & ThisLine(7) .EQ. 'B' .AND. & ThisLine(8) .EQ. 'L' .AND. & ThisLine(9) .EQ. 'O' .AND. & ThisLine(10) .EQ. 'C' .AND. & ThisLine(11) .EQ. 'K' ) GOTO 360 C This does NOT look like the beginning of a Repeat Block Statement. GOTO 380 C This DOES look like the beginning of a Repeat Block Statement. C First test to verify that the Data Section has not yet included a C Start Setting CA PROM Next to MSB phrase and then call the C routine to handle the Repeat Block. 360 IF ( Set_CA_NT_MSB_Flag .EQ. .TRUE. ) GOTO 920 CALL Process_Repeat_Block GOTO 100 C *********************************************************************** C ***** This record is not a blank line, a comment only line, ***** C ***** the end of the Data Section, an Address Specification ***** C ***** Phrase, or a Repeat Block, so test to see if it is a ***** C ***** Invert Card Address PROM MSB statement. ***** C *********************************************************************** C Test to see if this is an "Invert Card Address PROM MSB" statement. 380 IF ( ThisLine(1) .EQ. 'I' .AND. & ThisLine(2) .EQ. 'N' .AND. & ThisLine(3) .EQ. 'V' .AND. & ThisLine(4) .EQ. 'E' .AND. & ThisLine(5) .EQ. 'R' .AND. & ThisLine(6) .EQ. 'T' .AND. & ThisLine(7) .EQ. 'C' .AND. & ThisLine(8) .EQ. 'A' .AND. & ThisLine(9) .EQ. 'R' .AND. & ThisLine(10) .EQ. 'D' .AND. & ThisLine(11) .EQ. 'A' .AND. & ThisLine(12) .EQ. 'D' .AND. & ThisLine(13) .EQ. 'D' .AND. & ThisLine(14) .EQ. 'R' .AND. & ThisLine(15) .EQ. 'E' .AND. & ThisLine(16) .EQ. 'S' .AND. & ThisLine(17) .EQ. 'S' .AND. & ThisLine(18) .EQ. 'P' .AND. & ThisLine(19) .EQ. 'R' .AND. & ThisLine(20) .EQ. 'O' .AND. & ThisLine(21) .EQ. 'M' .AND. & ThisLine(22) .EQ. 'M' .AND. & ThisLine(23) .EQ. 'S' .AND. & ThisLine(24) .EQ. 'B' ) GOTO 385 C This does NOT look like the beginning of an C "Invert Card Address PROM MSB" statement. GOTO 400 C This DOES look like the beginning of an C "Invert Card Address PROM MSB" statement. 385 IF ( Full_Display .EQ. 0 ) THEN Inv_CA_PROM_MSB = .TRUE. GOTO 100 ELSE WRITE ( 6, 387 ) 387 FORMAT (/, ' This record is Invert Card Adrs PROM MSB. ',/) Inv_CA_PROM_MSB = .TRUE. GOTO 100 END IF C *********************************************************************** C ***** This record is not a blank line, a comment only line, ***** C ***** the end of the Data Section, an Address Specification ***** C ***** Phrase, a Repeat Block, an Invert Card Address PROM MSB ***** C ***** statement; so test to see if it is a Start Setting Card ***** C ***** Address PROM Next to MSB phrase. ***** C *********************************************************************** C Test to see if this is an "Invert Card Address PROM MSB" statement. 400 IF ( ThisLine(1) .EQ. 'S' .AND. & ThisLine(2) .EQ. 'T' .AND. & ThisLine(3) .EQ. 'A' .AND. & ThisLine(4) .EQ. 'R' .AND. & ThisLine(5) .EQ. 'T' .AND. & ThisLine(6) .EQ. 'S' .AND. & ThisLine(7) .EQ. 'E' .AND. & ThisLine(8) .EQ. 'T' .AND. & ThisLine(9) .EQ. 'T' .AND. & ThisLine(10) .EQ. 'I' .AND. & ThisLine(11) .EQ. 'N' .AND. & ThisLine(12) .EQ. 'G' .AND. & ThisLine(13) .EQ. 'C' .AND. & ThisLine(14) .EQ. 'A' .AND. & ThisLine(15) .EQ. 'R' .AND. & ThisLine(16) .EQ. 'D' .AND. & ThisLine(17) .EQ. 'A' .AND. & ThisLine(18) .EQ. 'D' .AND. & ThisLine(19) .EQ. 'D' .AND. & ThisLine(20) .EQ. 'R' .AND. & ThisLine(21) .EQ. 'E' .AND. & ThisLine(22) .EQ. 'S' .AND. & ThisLine(23) .EQ. 'S' .AND. & ThisLine(24) .EQ. 'P' .AND. & ThisLine(25) .EQ. 'R' .AND. & ThisLine(26) .EQ. 'O' .AND. & ThisLine(27) .EQ. 'M' .AND. & ThisLine(28) .EQ. 'N' .AND. & ThisLine(29) .EQ. 'E' .AND. & ThisLine(30) .EQ. 'X' .AND. & ThisLine(31) .EQ. 'T' .AND. & ThisLine(32) .EQ. 'T' .AND. & ThisLine(33) .EQ. 'O' .AND. & ThisLine(34) .EQ. 'M' .AND. & ThisLine(35) .EQ. 'S' .AND. & ThisLine(36) .EQ. 'B' ) GOTO 405 C This does NOT look like the beginning of a C "Start Setting Card Address PROM Next to MSB" phrase. GOTO 500 C This DOES look like the beginning of a C "Start Setting Card Address PROM Next to MSB" phrase. 405 IF ( Full_Display .EQ. 0 ) THEN Set_CA_NT_MSB_Flag = .TRUE. CALL Set_CA_NT_MSM GOTO 100 ELSE WRITE ( 6, 410 ) 410 FORMAT (/, ' This record is a Start Setting Card ', /, & ' Address PROM Next to MSB phrase. ' , / ) Set_CA_NT_MSB_Flag = .TRUE. CALL Set_CA_NT_MSM GOTO 100 END IF C *********************************************************************** C ***** This record is not a blank line, a comment only line, ***** C ***** the end of the Data Section, an Address Specification ***** C ***** Phrase, a Repeat Block, an Invert Card Address PROM MSB ***** C ***** statement or, a Start Setting Card Address PROM Next to ***** C ***** MSB phrase; thus this record is an illegal Data Section ***** C ***** record. ***** C *********************************************************************** 500 WRITE ( 6, 555 ) 555 FORMAT ( /, & ' An illegal record was found in the Data ', / & ' Section. This is a fatal error. ', / & ' No output files will be produced. ', / ) CLOSE ( UNIT=10 ) GOTO 998 C ************************************************************ C This is the section for handling IO Errors and all Exits C ***********************************---------*********-----** 910 WRITE ( 6, 911 ) 911 FORMAT ( /, & ' An Address Specification phrase was read ', /, & ' from the Data Section after a Start Setting ', /, & ' Card Address PROM Next to MSB phrase had ', /, & ' previously been read from the Data Section. ', /, & ' This is a Fatal illegal order of phrases. ', / ) CLOSE ( UNIT=10 ) GOTO 998 920 WRITE ( 6, 921 ) 921 FORMAT ( /, & ' A Repeat Block phrase was read from the ', /, & ' Data Section after a Start Setting Card ', /, & ' Address PROM Next to MSB phrase had ', /, & ' previously been read from the Data Section. ', /, & ' This is a Fatal illegal order of phrases. ', / ) CLOSE ( UNIT=10 ) GOTO 998 940 WRITE ( 6, 941 ) 941 FORMAT ( /, & ' The end of the COMMINT Address Specification ', /, & ' file was reached before finding the end of ', /, & ' the Data Section. ', / ) CLOSE ( UNIT=10 ) GOTO 998 970 WRITE ( 6, 971 ) IOSTATUS 971 FORMAT ( /, & ' There has been an IO System Error trying ', /, & ' to Read from the COMINT Address Specification ', /, & ' file. Is this file of the correct format? ', //, & ' Did you type the filename correctly? ', //, & ' Fortran Read IOSTAT = ', I3, //, & ' You will need to restart the program. ' , // ) CLOSE ( UNIT=10 ) 998 WRITE ( 6, 999 ) 999 FORMAT ( / ' COMINT Address Program will now exit. ', // ) STOP ' ' END