NOLINEUP C C PROGRAM TO PRINT A SCANLIB CMTABL IN TABULAR FORM C C 1981-DEC-16 - JWB - REVISION 2 C INCLUDE (SCANLIB.PARAMS) INCLUDE (SCANLIB.CMTABL) C CHARACTER*4 MATBUF(30) PARAMETER (LISTSZ = MAX(CMTBSZ,KWTBSZ)) INTEGER INDEX(LISTSZ), LSTNDX(LISTSZ) C C ------------ PRINT TABLE 1 - COMMAND-ORIENTED TABLES ------------ C WRITE (*,1000) 1000 FORMAT('1SCANLIB COMMAND TABLES -- TABLE 1 -- COMMAND-', *'ORIENTED TABLES'/ *'0 # COMMND CNARGS CARGTP CLSTDX KWSTRT KWSTOP'/ *' ------ ------ ------ ------ ------ ------') MAXKWD = 0 DO FOR ICMD=1,CMTBSZ WRITE (*,1002) ICMD, (CMDTBL(I,ICMD),I=1,6), CNARGS(ICMD), *CARGTP(ICMD), CLSTDX(ICMD), KWSTRT(ICMD), KWSTOP(ICMD) 1002 FORMAT(1X,I3,1X,6A1,1X,I4,5X,I1,4X,I4,3X,I4,3X,I4) MAXKWD = MAX(MAXKWD,KWSTOP(ICMD)) END FOR C WRITE (*,1008) 1008 FORMAT('1SCANLIB COMMAND TABLES -- TABLE 1A -- COMMAND-', *'ORIENTED TABLES (BY LIST TYPE)'/ *'0 # COMMND CNARGS CARGTP CLSTDX KWSTRT KWSTOP'/ *' ------ ------ ------ ------ ------ ------') DO FOR JLIST=1,4 LINDEX = 0 DO FOR ICMD=1,CMTBSZ IF (CARGTP(ICMD).EQ.JLIST .AND. CNARGS(ICMD).NE.0) THEN LINDEX = LINDEX + 1 INDEX (LINDEX) = ICMD LSTNDX(LINDEX) = CLSTDX(ICMD) ENDIF END FOR DO (SORT) DO FOR IND=1,LINDEX ICMD = INDEX(IND) WRITE (*,1002) ICMD, (CMDTBL(I,ICMD),I=1,6), CNARGS(ICMD), *CARGTP(ICMD), CLSTDX(ICMD), KWSTRT(ICMD), KWSTOP(ICMD) END FOR END FOR C C ------------ PRINT TABLE 2 - KEYWORD-ORIENTED TABLES ------------ C WRITE (*,2000) 2000 FORMAT('1SCANLIB COMMAND TABLES -- TABLE 2 -- KEYWORD-', *'ORIENTED TABLES'/ *'0 # KEYWRD KNARGS KARGTP KLSTDX NMSTRT NMSTOP'/ *' ------ ------ ------ ------ ------ ------') MAXNAM = 0 DO FOR KWD=1,MAXKWD WRITE (*,1002) KWD, (KWDTBL(I,KWD),I=1,6), KNARGS(KWD), *KARGTP(KWD), KLSTDX(KWD), NMSTRT(KWD), NMSTOP(KWD) MAXNAM = MAX(MAXNAM,NMSTOP(KWD)) END FOR IF (MAXKWD.LT.KWTBSZ) WRITE (*,2004) MAXKWD+1, KWTBSZ 2004 FORMAT('0KEYWORD TABLE ENTRIES',I4, ' THROUGH',I4, ' ARE SPARE.') C WRITE (*,2008) 2008 FORMAT('1SCANLIB COMMAND TABLES -- TABLE 2A -- KEYWORD-', *'ORIENTED TABLES (BY LIST TYPE)'/ *'0 # KEYWRD KNARGS KARGTP KLSTDX NMSTRT NMSTOP'/ *' ------ ------ ------ ------ ------ ------') DO FOR JLIST=1,4 LINDEX = 0 DO FOR KWD=1,MAXKWD IF (KARGTP(KWD).EQ.JLIST .AND. KNARGS(KWD).NE.0) THEN LINDEX = LINDEX + 1 INDEX (LINDEX) = KWD LSTNDX(LINDEX) = KLSTDX(KWD) ENDIF END FOR DO (SORT) DO FOR IND=1,LINDEX KWD = INDEX(IND) WRITE (*,1002) KWD, (KWDTBL(I,KWD),I=1,6), KNARGS(KWD), *KARGTP(KWD), KLSTDX(KWD), NMSTRT(KWD), NMSTOP(KWD) END FOR END FOR C C ------------- PRINT TABLE 3 - COMMAND/KEYWORD MATRIX ------------- C MINCMD = -29 DO WHILE (MINCMD+30.LE.CMTBSZ) MINCMD = MINCMD + 30 MAXCMD = MIN(MINCMD+29,CMTBSZ) WRITE (*,3000) 3000 FORMAT('1SCANLIB COMMAND TABLES -- TABLE 3 -- COMMAND-', *'KEYWORD MATRIX'//) DO FOR I=1,6 WRITE (*,3002) (CMDTBL(I,ICMD),ICMD=MINCMD,MAXCMD) 3002 FORMAT(8X,30('.',1X,A1,1X)) END FOR DO FOR K=1,MAXKWD DO FOR ICMD=MINCMD,MAXCMD IF (KWSTRT(ICMD).LE.K .AND. K.LE.KWSTOP(ICMD)) THEN WRITE (MATBUF(ICMD-MINCMD+1),3003) K 3003 FORMAT('.',I3) ELSE MATBUF(ICMD-MINCMD+1) = '. ' ENDIF END FOR MAXMAT = MAXCMD - MINCMD + 1 WRITE (*,3004) (KWDTBL(I,K),I=1,6), (MATBUF(I),I=1,MAXMAT) 3004 FORMAT(1X,6A1,1X,30(A4)) END FOR END WHILE C C -------------- PRINT TABLE 4 - KEYWORD/NAME MATRIX -------------- C KWDMIN = -29 DO WHILE (KWDMIN+30.LE.MAXKWD) KWDMIN = KWDMIN + 30 KWDMAX = MIN(KWDMIN+29,MAXKWD) WRITE (*,4000) 4000 FORMAT('1SCANLIB COMMAND TABLES -- TABLE 4 -- KEYWORD-', *'NAME MATRIX'//) DO FOR I=1,6 WRITE (*,3002) (KWDTBL(I,KWD),KWD=KWDMIN,KWDMAX) END FOR DO FOR N=1,MAXNAM DO FOR KWD=KWDMIN,KWDMAX IF (NMSTRT(KWD).LE.N .AND. N.LE.NMSTOP(KWD)) THEN WRITE (MATBUF(KWD-KWDMIN+1),3003) N ELSE MATBUF(KWD-KWDMIN+1) = '. ' ENDIF END FOR MAXMAT = KWDMAX - KWDMIN + 1 WRITE (*,3004) (NAMTBL(I,N),I=1,6), (MATBUF(I),I=1,MAXMAT) END FOR END WHILE C IF (MAXNAM.LT.NMTBSZ) WRITE (*,5004) MAXNAM+1, NMTBSZ 5004 FORMAT('0NAME TABLE ENTRIES',I4, ' THROUGH',I4, ' ARE SPARE.') C STOP C C$CCC ---------------------------------------------------------------- C PROCEDURE (SORT) DO FOR IPASS=1,LINDEX-1 DO FOR IX=1,LINDEX-IPASS IF (LSTNDX(IX).GT.LSTNDX(IX+1)) THEN ITEMP = LSTNDX(IX) LSTNDX(IX) = LSTNDX(IX+1) LSTNDX(IX+1) = ITEMP ITEMP = INDEX(IX) INDEX(IX) = INDEX(IX+1) INDEX(IX+1) = ITEMP ENDIF END FOR END FOR END PROCEDURE C END PROGRAM