FORTRAN IV-PLUS V02-51D		02:36:28    22-AUG-78		PAGE 1   

CNGBAR.FTN   	/TR:BLOCKS/WR


        C

        C

        C

        C	CNGBAR -- OUTPUT CHANGE-BAR DIF RESULTS

        C

        C

        C

        C

        C	COPYRIGHT (C) 1976

        C	DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

        C

        C	THIS SOFTWARE IS FURNISHED UNDER  A LICENSE FOR USE ONLY  ON  A

        C	SINGLE COMPUTER SYSTEM AND MAY BE  COPIED ONLY WITH  THE INCLU-

        C	SION OF  THE  ABOVE  COPYRIGHT NOTICE.  THIS SOFTWARE,  OR  ANY

        C	OTHER COPIES THEREOF, MAY NOT BE  PROVIDED  OR  OTHERWISE  MADE

        C	AVAILABLE TO ANY OTHER PERSON EXCEPT  FOR  USE  ON  SUCH SYSTEM

        C	AND TO  ONE WHO AGREES  TO  THESE LICENSE  TERMS.  TITLE TO AND

        C	OWNERSHIP OF THE SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.

        C

        C	THE INFORMATION IN THIS SOFTWARE  IS  SUBJECT TO CHANGE WITHOUT

        C	NOTICE AND SHOULD NOT BE CONSTRUED  AS  A COMMITMENT BY DIGITAL

        C	EQUIPMENT CORPORATION.

        C

        C	DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS

        C	SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

        C

        C

        C	K.D. MORSE  22-NOV-76

        C

        C

        C

        C

        C	THIS SUBROUTINE WRITES CHANGE-BAR OUTPUT RESULTING FROM DIF.

        C

        C

        C

        C

        C

        C  MODIFICATIONS:

        C

        C NO		DATE		PROGRAMMER		PURPOSE

        C --		-----		----------		-------

        C

        C

        C

        C

FORTRAN IV-PLUS V02-51D		02:36:28    22-AUG-78		PAGE 2   

CNGBAR.FTN   	/TR:BLOCKS/WR


         

        C

        C

        C  VARIABLES:

        C

        C

        C	ICODE--LOCAL STORAGE FOR ORIGINAL IKIND VALUE

        C	IERR1--ERROR INDICATOR FROM FORTRAN ROUTINES

        C	IERR2--ERROR INDICATOR FROM MACRO ROUTINES

        C	IKIND--INDICATOR OF TYPE OF OUTPUT TO WRITE

        C	ILUN--CHANNEL ON WHICH FILE IS OPEN

        C	INMLNG--LENGTH OF INPUT FILE NAME

        C	INPNAM--NAME OF INPUT FILE

        C	IRECNM--SEQUENTIAL LINE NUMBER OF RECORD TO BE OUTPUT

        C	IRECSZ--SIZE OF RECORD BUFFER

        C	ISTAT--INDICATOR FOR TYPE OF CLOSE TO PERFORM ON INPUT FILE

        C	ISUB--INDICATOR FOR INPUT- OR COMPARE-FILE, I.E., 1=INPUT AND

        C		2=COMPARE, USED TO SUBSCRIPT INTO TABLES AND POINTERS

        C	ITYPE--INDICATOR FOR TYPE OF OPEN TO PERFORM ON INPUT FILE

        C	LENINP--LENGTH OF RECORD

        C	LINSIZ--NUMBER OF CHARACTERS IN AN OUTPUT LINE

        C	LSTMAT--LAST RECORD USED FROM BUFFER

        C	MAPEND--RECORD NUMBER OF LAST MAP VALUE IN TABLE

        C	MAPNAM--NAME OF MAP FILE

        C	MAPMRK--ARRAY HOLDING POINTERS TO NEXT MAP RECORD TO READ FOR

        C		INPUT-FILE MAPPING VALUES AND COMPARE-FILE MAPPING VALUES

        C	MAPTOP--RECORD NUMBER OF FIRST MAP VALUE IN TABLE

        C	MLUN--MAP FILE LUN

        C	MNMLNG--LENGTH OF MAP FILE NAME

        C	MTYPE--INDICATOR OF TYPE OF OPEN TO DO ON MAP FILE

        C	OUTMOD--MODE OF OUTPUT TO PRODUCE, E.G., OCTAL, ASCII, OR

        C		HEXADECIMAL

        C	RECORD--BUFFER TO HOLD ONE RECORD

        C

        C

        C

        C

FORTRAN IV-PLUS V02-51D		02:36:28    22-AUG-78		PAGE 3   

CNGBAR.FTN   	/TR:BLOCKS/WR


         

0001    	SUBROUTINE CNGBAR(ILUN,RECORD,LENINP,ISTAT,INPNAM,INMLNG,ITYPE,

        	1OUTMOD)

        C

        C

0002    	COMMON MAP(100,2),NUMLIN,MAPTOP(2),LSTMAP(2),MLUN,

        	1IHOLD(30,2),NINCOR,IFREE(2),IFIRST(2),LAST(2),MAXBUF,

        	2BUFR,ISWTCH,COMCHR,NSWVAL(10),LSTMAT(2),IRECSZ,

        	3MRKPNT(4,2),INOUT,MAPEND(2),LINSIZ,MAPNAM,MNMLNG,MTYPE,MSTAT

        	4,IERR1,IERR2,IKIND,OLUN,MAPMRK(3,2),MPRINT,BARCHR

        C

        C

0003    	DIMENSION NOW(2)

0004    	INTEGER	OLUN

0005    	BYTE INPNAM(1),MAPNAM(12),COMCHR(16),BUFR(7680,2),BARCHR

0006    	BYTE OUTMOD,RECORD(512)

         

0007    111	FORMAT(' FILE ',<INMLNG>A1)

0008    121	FORMAT(' ',<MIN0(LINSIZ,72)>('*')/,' '<MIN0(LINSIZ,72)/2-14>

        	1('*'),' CHANGE-BAR OUTPUT FOR FILE ',<MIN0(LINSIZ,72)/2-14>

        	2('*'),/' ',<(MIN0(LINSIZ,72)-INMLNG-2)/2>('*'),' ',<INMLNG>A1,

        	3' ',<(MIN0(LINSIZ,72)-INMLNG-2)/2>('*'),/' ',<MIN0(LINSIZ,72)>

        	4('*')//)

0009    131	FORMAT('1')

        C

        C	OPEN INPUT AND MAP FILE.  MARK THE NEXT RECORD OF THE

        C	MAP FILE TO READ.

        C

0010    	CALL OPNFIL(MAPNAM,MNMLNG,MLUN,RECORD,IRECSZ,MTYPE,IERR2)

0011    	IF (IERR2 .LE. 0) GOTO 924

0012    100	ISUB=1

0013    	IF (ILUN .EQ. 3) ISUB=2

0014    	CALL MRKREC(MLUN,MAPMRK(1,ISUB),IERR2)

0015    	IF (IERR2 .LE. 0) GOTO 927

0016    	CALL OPNFIL(INPNAM,INMLNG,ILUN,RECORD,IRECSZ,ITYPE,IERR2)

0017    	IF (IERR2 .LE. 0) GOTO 912

        C

        C	FILL BUFFER WITH RECORDS.

        C

0018    	CALL FILBUF(ILUN,RECORD,LENINP,ISTAT,INPNAM,INMLNG,ITYPE)

0019    	IF (IERR2 .EQ. 0) GOTO 105

0020    	IF (IERR1 .LT. 0) GOTO 1000

0021    105	IRECNM=1

0022    	IERR1=1

0023    	ICODE=IKIND

0024    	IF (INOUT .GT. 1) WRITE(OLUN,131,ERR=918)

0025    	WRITE(OLUN,121,ERR=918)(INPNAM(I),I=1,INMLNG)

        C

        C	FILL MAPPING TABLE.

        C

0026    110	CALL READMP(ISUB)

0027    	IF (IERR2 .EQ. 0) GOTO 130

0028    	IF (IERR1 .LT. 0) GOTO 1000

        C

        C	IF RECORD IS NOT MAPPED, SET INDICATOR FOR CHANGE-BAR.

        C	WRITE OUT RECORD.

FORTRAN IV-PLUS V02-51D		02:36:28    22-AUG-78		PAGE 4   

CNGBAR.FTN   	/TR:BLOCKS/WR


        C

0029    115	IKIND=ICODE

0030    	IF (MAP(IRECNM-MAPTOP(ISUB)+1,ISUB) .EQ. 0) IKIND=IKIND+4

0031    	CALL BAROUT(ILUN,RECORD,LENINP,ISTAT,INPNAM,INMLNG,ITYPE,

        	1IRECNM,OUTMOD)

0032    	IF (IERR2 .EQ. 0) GOTO 130

0033    	IF (IERR1 .LT. 0) GOTO 1000

0034    	LSTMAT(ISUB)=IRECNM

0035    120	IRECNM=IRECNM+1

0036    	IF (IRECNM .GT. MAPEND(ISUB)) GOTO 110

0037    	GOTO 115

0038    130	IERR1=1

0039    	CALL CLSFIL(ILUN,ISTAT,IERR2)

0040    	IF (IERR2 .LE. 0) GOTO 913

0041    	GOTO 1000

        C

        C	ERROR CODES

        C

        C	INPUT FILE:

        C

        C		-12 = OPEN ERROR

        C		-13 = CLOSE ERROR

        C

        C	OUTPUT FILE:

        C

        C		-18 = READ/WRITE ERROR

        C

        C

        C	COMPARE FILE:

        C

        C		-20 = OPEN ERROR

        C		-21 = CLOSE ERROR

        C

        C	MAP FILE:

        C

        C		-24 = OPEN ERROR

        C		-25 = CLOSE ERROR

        C		-27 = MARK/POINT ERROR

        C

0042    912	IERR1=-(ISUB*4+8)

0043    	GOTO 1000

0044    913	IERR1=-(ISUB*4+9)

0045    	GOTO 1000

0046    918	IERR1=-18

0047    	GOTO 1000

0048    924	IERR1=-24

0049    	GOTO 1010

0050    925	IERR1=-25

0051    	GOTO 1010

0052    927	IERR1=-27

0053    	GOTO 1010

0054    1000	CALL CLSFIL(MLUN,MSTAT,IERR2)

0055    	IF (IERR2 .LE. 0) GOTO 925

0056    1010	RETURN

0057    	END

FORTRAN IV-PLUS V02-51D		02:36:28    22-AUG-78		PAGE 5   

CNGBAR.FTN   	/TR:BLOCKS/WR


PROGRAM SECTIONS



NUMBER	 NAME	    SIZE		ATTRIBUTES



  1	$CODE1	001570   444		RW,I,CON,LCL

  2	$PDATA	000004     2		RW,D,CON,LCL

  3	$IDATA	000352   117		RW,D,CON,LCL

  4	$VARS	000014     6		RW,D,CON,LCL

  5	$TEMPS	000004     2		RW,D,CON,LCL

  6	.$$$$.	037222  8009		RW,D,OVR,GBL





ENTRY POINTS



 NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS   



 CNGBAR	      1-000000





VARIABLES



 NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS   



 BARCHR	L*1   6-037220	 I	I*2   4-000012	 ICODE	I*2   4-000010	 IERR1	I*2   6-037172	 IERR2	I*2   6-037174

 IKIND	I*2   6-037176	 ILUN	I*2   F-000002*	 INMLNG	I*2   3-000202*	 INOUT	I*2   6-037140	 IRECNM	I*2   4-000006

 IRECSZ	I*2   6-037116	 ISTAT	I*2   F-000010*	 ISUB	I*2   4-000004	 ISWTCH	I*2   6-037044	 ITYPE	I*2   F-000016*

 LENINP	I*2   F-000006*	 LINSIZ	I*2   6-037146	 MAXBUF	I*2   6-001042	 MLUN	I*2   6-000632	 MNMLNG	I*2   6-037164

 MPRINT	I*2   6-037216	 MSTAT	I*2   6-037170	 MTYPE	I*2   6-037166	 NINCOR	I*2   6-001024	 NUMLIN	I*2   6-000620

 OLUN	I*2   6-037200	 OUTMOD	L*1   F-000020*





ARRAYS



 NAME   TYPE  ADDRESS	    SIZE 	DIMENSIONS



 BUFR	L*1   6-001044	036000  7680	(7680,2)

 COMCHR	L*1   6-037046	000020     8	(16)

 IFIRST	I*2   6-001032	000004     2	(2)

 IFREE	I*2   6-001026	000004     2	(2)

 IHOLD	I*2   6-000634	000170    60	(30,2)

 INPNAM	L*1   F-000012*	000001     0	(1)

 LAST	I*2   6-001036	000004     2	(2)

 LSTMAP	I*2   6-000626	000004     2	(2)

 LSTMAT	I*2   6-037112	000004     2	(2)

 MAP	I*2   6-000000	000620   200	(100,2)

 MAPEND	I*2   6-037142	000004     2	(2)

 MAPMRK	I*2   6-037202	000014     6	(3,2)

 MAPNAM	L*1   6-037150	000014     6	(12)

 MAPTOP	I*2   6-000622	000004     2	(2)

 MRKPNT	I*2   6-037120	000020     8	(4,2)

 NOW	I*2   4-000000	000004     2	(2)

 NSWVAL	I*2   6-037066	000024    10	(10)

 RECORD	L*1   F-000004*	001000   256	(512)





LABELS

FORTRAN IV-PLUS V02-51D		02:36:28    22-AUG-78		PAGE 6   

CNGBAR.FTN   	/TR:BLOCKS/WR




 LABEL   ADDRESS 	 LABEL   ADDRESS 	 LABEL   ADDRESS 	 LABEL   ADDRESS 	 LABEL   ADDRESS 	



 100	    **   	 105	 1-000404	 110	 1-000566	 111'	    **   	 115	 1-000630

 120	    **   	 121'	 3-000000	 130	 1-001056	 131'	 3-000152	 912	 1-001132

 913	 1-001164	 918	 1-001216	 924	 1-001234	 925	 1-001252	 927	 1-001270

 1000	 1-001306	 1010	 1-001336





FUNCTIONS AND SUBROUTINES REFERENCED



 BAROUT	 CLSFIL	 FILBUF	 MRKREC	 OPNFIL	 READMP	 $MIN0





TOTAL SPACE ALLOCATED = 041410  8580



NO FPP INSTRUCTIONS GENERATED



OBJ$:CNGBAR,LIS$:CNGBAR/-SP=SRC$:CNGBAR

