C C subroutine VERS.PGM C LOGICAL*1 QDIRCT,QFILE,QPLOT,QDEL C C First, define the device specific characteristics for RASGEN. C (remember that VERS.MAC also defines these numbers for DOTS) C NIBX = 200 ! 200 nibs/inch for X and Y NIBY = 200 ! MAXNX = 100 ! nibs/raster band (.5 inch) MAXNY = 2112 ! nibs/page (across) C C a few other initializations ... C ICOPY = 0 ! we've printed no copies yet QDIRCT = .FALSE. QFILE = .FALSE. QPLOT = .FALSE. QDEL = .FALSE. C IF (IOPTNS .EQ. 0) QDIRCT = .TRUE. IF ((IOPTNS .AND. "1) .NE. 0) QFILE = .TRUE. IF ((IOPTNS .AND. "2) .NE. 0) QPLOT = .TRUE. IF ((IOPTNS .AND. "4) .NE. 0) QDEL = .TRUE. C C first, check the options. do we make a raster? a file? C IF ((.NOT. QDIRCT) .AND. (.NOT. QFILE)) GOTO 100 ! neither direct or file IF (QFILE) OPEN (UNIT=LOONRS, NAME=RASFIL, TYPE='NEW', 1 FORM='UNFORMATTED',ACCESS='SEQUENTIAL',ERR=1000) IF (QDIRCT) CALL ASSIGN(LOONOU,OUTDEV) C C--------------------------------------------------------------------------------- C C RASTERIZE: start with raster band 0 C 5 QDONE = .FALSE. IRAS = 0 MAXIRS = -1 C C go make a raster C 10 JRAS = IRAS CALL RASGEN(JRAS) IF (JRAS .GE. 0) GOTO 20 C C problem - tell us to input more and leave C QINPUT = .TRUE. IF (QFILE) CLOSE(UNIT=LOONRS) IF (QDIRCT) CLOSE(UNIT=LOONOU) RETURN C C got a raster band - do something with it C 20 IF (QDIRCT) CALL VERDMP(LOONOU) ! write out the band to printer IF (QFILE) CALL VERDMP(LOONRS) ! write to a file C C more bands to make? C IRAS = IRAS + 1 IF (JRAS .GE. IRAS) GOTO 10 C C all done with this plot - more copies? C IF (QFILE) CLOSE (UNIT=LOONRS) ICOPY = ICOPY + 1 IF (QDIRCT .AND. (ICOPY .LT. NCOPY)) GOTO 5 IF (.NOT. QDIRCT) GOTO 100 CLOSE(UNIT=LOONOU) RETURN C C--------------------------------------------------------------------------------- C C done - files closed. now deal with the other options C 100 IF (.NOT. QPLOT) GOTO 120 C C option 2: plot a file: direct output - pip style C CALL ASSIGN(LOONOU,OUTDEV) DO 110 ICOPY = 1,NCOPY OPEN(UNIT=LOONRS, NAME=RASFIL, TYPE='OLD', 1 CARRIAGECONTROL='LIST',ERR=1020) CALL VERPIP CLOSE(UNIT=LOONRS) 110 CONTINUE CLOSE(UNIT=LOONOU) C C option 4: delete the raster file C 120 IF (.NOT. QDEL) RETURN OPEN(UNIT=LOONRS, NAME=RASFIL, TYPE='OLD', 1 CARRIAGECONTROL='LIST',ERR=1020) CLOSE(UNIT=LOONRS,DISPOSE='DELETE') RETURN C C error processing here C 1000 WRITE (LOONTI,1010) RASFIL 1010 FORMAT('0RASTER error opening a new raster file: ',32A1) GOTO 1100 1020 WRITE (LOONTI,1030) RASFIL 1030 FORMAT('0RASTER error opening an old raster file: ',32A1) 1100 QINPUT = .TRUE. IF (QPLOT) CLOSE(UNIT=LOONOU) RETURN END