Google
 

Trailing-Edge - PDP-10 Archives - bb-h137f-bm - uetp/lib/mtabkr.for
There are 18 other files named mtabkr.for in the archive. Click here to see a list.
CTHIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
C  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
C
CCOPYRIGHT (C) 1977 BY DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
	DIMENSION IARRAY(10,10),JARRAY(10,10)
	IMAX=10
	JMAX=10
	DEV='MAG'
	WRITE(5,12345)
12345	FORMAT(' ENTER NUMBER OF FILES TO USE IN TEST (XXXXX):')
	READ (5,12346) IFLMAX
12346	FORMAT(I5)

CMAGTAPE TESTING. WRITES OUT IFILE NUMBER OF FILES ON MAGTAPE
C  "DEV". THE FILES ARE INTIGER ASCII OF THE SIZE IMAX*JMAX
C   WHERE IMAX AND JMAX ARE READ IN AT RUNTIME FROM FILE PARAMS.DAT
C   ON UNIT 1.  DEV IS ALSO READ FROM  PARAMS


	DO 100 I=1,IMAX
	DO 100 J=1,JMAX
	IARRAY(I,J)=I*JMAX+J-JMAX
100	CONTINUE

	OPEN(UNIT=1,DEVICE=DEV)
	REWIND 1

	DO 300 IFILE=1,IFLMAX
	OPEN(UNIT=1,DEVICE=DEV)

	DO 200 I=1,IMAX
	WRITE(1,910)IFILE,(IARRAY(I,J),J=1,JMAX)
200	CONTINUE

	ENDFILE 1
	NOW=300
	TYPE 960,NOW
300	CONTINUE
C GET TO END OF FILE WITH NORMAL READS IN CASE SKIPRECORD FAILS
C DO REWIND FIRST SO TEST WORKS ON MTA AND DSK.

	REWIND 1

	DO 400 I=1,IMAX
	READ(1,910,END=840,ERR=850)JFILE,(JARRAY(I,J),J=1,JMAX)
400	CONTINUE

C BACKSPACE STRAIGHT THROUGH FILE

	DO  510 I=IMAX,1,-1
	TYPE 950,I
	BACKSPACE 1
	TYPE 951
	READ(1,910,END=841,ERR=851)JFILE,(JARRAY(I,J),J=1,JMAX)
	TYPE 950,I
	BACKSPACE 1

	DO 500 J=1,JMAX
	IF(IARRAY(I,J).NE.JARRAY(I,J))WRITE(5, 1020) DEV,JFILE,I,
	1 J,IARRAY(I,J),JARRAY(I,J),IMAX,JMAX
	NOW=500
	TYPE 960,NOW
500	CONTINUE
	NOW=510
	TYPE 960,NOW
	TYPE 961,IMAX,I,J
510	CONTINUE

C NOW GET TO END AND DO MULTIPLE BACKSPACES

	REWIND 1

	DO 600 I=1,IMAX
	READ(1,910,END=840,ERR=850)JFILE,(JARRAY(I,J),J=1,JMAX)
600	CONTINUE

	DO 700 I=1,IMAX
	BACKSPACE 1
700	CONTINUE

	I=1
	READ(1,910,END=842,ERR=852)JFILE,(JARRAY(I,J),J=1,JMAX)
C NOTE J=JMAX+1 AT EXIT FROM READ
	J=JMAX
	IF(IARRAY(I,J).NE.JARRAY(I,J))WRITE(5,1030)DEV,JFILE,I,J,
	1 IARRAY(I,J),JARRAY(I,J),IMAX,JMAX

	GO TO 9999

C END= COMES HERE
840	WRITE(5,1070)
	WRITE(5, 990)DEV
	WRITE(5, 1040)IMAX,JMAX
	WRITE(5, 1010)JFILE,I,J,JARRAY(I,J)
	GO TO 9999

841	WRITE(5,1070)
	WRITE(5, 990)DEV
	WRITE(5,1050)IMAX,JMAX
	WRITE(5, 1010)JFILE,I,J,JARRAY(I,J)
	GO TO 9999

842	WRITE(5,1070)
	WRITE(5, 990)DEV
	WRITE(5,1060)IMAX,JMAX
	WRITE(5, 1010)JFILE,I,J,JARRAY(I,J)
	GO TO 9999


C ERR= COMES HERE
850	WRITE(5,1070)
	WRITE(5, 1000)DEV
	WRITE(5, 1040)IMAX,JMAX
	WRITE(5, 1010)JFILE,I,J,JARRAY(I,J)
	GO TO 9999
851	WRITE(5,1070)
	WRITE(5, 1000)DEV
	WRITE(5,1050)IMAX,JMAX
	WRITE(5, 1010)JFILE,I,J,JARRAY(I,J)
	GO TO 9999

852	WRITE(5,1070)
	WRITE(5, 1000)DEV
	WRITE(5,1060)IMAX,JMAX
	WRITE(5,1010)JFILE,I,J,JARRAY(I,J)
	GO TO 9999


910	FORMAT(I5,(10I5))
920	FORMAT(' ***** ***** BACKSPACE FILES ON',A5,'FAILED'/
	1 13X,'FILE',I5,'FOUND, FILE',I5,'EXPECTED.')
930	FORMAT(' ***** ***** REWIND DIDNOT END UP AT FIRST 
	1 FILE ON ',A5)
940	FORMAT(' ***** ***** SKIP RECORD PROBLEM ON ',A5)
950	FORMAT(' I=',I5,' BACKSPACE')
951	FORMAT(' OK, READ')
952	FORMAT(' IFL=',I5,'I=',I5,'JFILE=',I5,'ARRAY=',I5)
960	FORMAT(' NOW=',I5)
961	FORMAT(' 500 LOOP DONE, IMAX=',I5,' I=',I5,' J=',I5)
962	FORMAT(' 820 DONE, K= ',I5)
970	FORMAT(' ***** ***** SKIP FILE ERROR ON',A5,/
	1 T13,'EXPECTED FILE NUMBER',I5,/
	2 T13,'FOUND FILE NUMBER   ',I5)
980	FORMAT(' ***** ***** FORTRAN SKIP FILE MTA ERROR ON ',A5/
	1 T13,'WHILE READING FILE NUMBER ',I5/
	2 T13,' DURING ARRAY READ, COMPARING INPUT WITH ARRAY WRITTEN'/
	3 T13,'RECORD ',I5,'ITEM ',I5/
	4 T13,'EXPECTED VALUE ',I5,'FOUND 'I5/
	5 T13,'ARRAY IS',I5,' BY',I5/' ***** *****')
990	FORMAT(' "END=" ON ',A5)
1000	FORMAT(' "ERR=" ON ',A5)
1010	FORMAT(' FILE NUMBER',I5/
	1 ' RECORD',I5,' ITEM',I5,' VALUE',I5)
1020	FORMAT(' +++++TEST MTABKR.FOR MAGTAPE BACKSPACE RECORD
	1 TEST+++++'/
	2 ' ***** ***** BACKSPACE SINGLE RECORD FAILED ON DEVICE,',
	1 A5/T13,'FILE',I5,' RECORD',I5,' ITEM',I5/
	2 T13,' RECORD COMPARE EXPECTED',I5,' FOUND',I5/
	3 T13,' FILE IS ARRAY',I5,' BY',I5/' ***** *****')
1030	FORMAT(' +++++TEST MTABKR.FOR MAGTAPE BACKSPACE RECORD+++++'/
	1 ' ***** ***** BACKSPACE MULTIPLE RECORDS FAILED ON',A5/
	1 T13,' FILE',I5,' RECORD',I5,' ITEM',I5/
	2 T13,' RECORD COMPARE EXPECTED',I5,' FOUND',I5/
	3 T13,' FILE IS',I5,' BY',I5,' ARRAY'/' ***** *****')
1040	FORMAT(' DURING SEQUENTIAL READS,RECORD MAX=,',I5,'ITEM MAX=',I5)
1050	FORMAT(' DURING BACKSPACE, READ, BACKSPACE'/' RECORD MAX=',I5,
	1 ' ITEM MAX=',I5)
1060	FORMAT(' DURING BACKSPACE',I5,' TIMES FOLLOWED BY'/' READ OF
	1 ONE RECORD CONTAINING',I5,' ITEMS')
1070	FORMAT(' +++++TEST MTABKR.FOR MAGTAPE BACKSPACE RECORD
	1 TEST+++++')

9999	END