      INTEGER FUNCTION PXZ00(ICODE)
C
C  PXZ00 CALLED BY VARIOUS ROUTINES FOR INITIALIZATION
C  AND DE-INITIALIZATION AT VARIOUS STAGES OF PLOTTING.
C  IN GENERAL, IT IS A SWITCH TO THE DEVICE DEPENDENT
C  SUBROUTINES.
C
C  ICODE=-1  PRE LINE/CHAR
C       =0  POST LINE/CHAR
C       =1  PRE SCALE WHEN UNSCALED
C       =2  POST SCALE
C       =3  PRE ENDPT
C       =4  PLTST CALL
C
C
$INCLUDE:'pxz99.cmn'
C
C
      DATA SCLED/7.15633E13/
C
      PXZ00=0
      IF (ICODE) 10,40,20
   10 IF (FSCAL.NE.SCLED) GO TO 230
      NCALS=NCALS+1
      GO TO 40
   20 IF (ICODE-1) 40,30,40
   30 IF (IPLTR.LE.0.OR.IPLTR.GT.IPLTX) GO TO 230
   40 IF (ICODE.EQ.4)  CALL PXZHO
      GO TO(100,100,100,100,100,85,100,95,95,95,95,95),IPLTR
C  C  GO TO (50,60,65,70,80,85,90,95),IPLTR
C
C     FOR CALCOMP
C  50 CALL PXZ40(ICODE)
C  C  GO TO 120
C
CC    FOR TEKTRONIX 4010,4012
C  60 CALL PXZ30(ICODE)
C  C  GO TO 120
C
CC    FOR TEXPLOT
C  65 CALL PXZ37(ICODE)
C  C  GO TO 120
C
CC    FOR HP7203A
C  70 CALL PXZ38(ICODE)
C  C  GO TO 120
C
CC    FOR TEKTRONIX 4014
C  80 CALL PXZ36(ICODE)
C  C  GO TO 120
C
CC    FOR HP7580A
   85 CALL HPSET(ICODE)
      GO TO 120
C
CC    FOR GENERAL VECTOR OUTPUT
C  90 CALL PXZ34(ICODE)
C
C     FOR PC'S
   95 CALL PXZ42(ICODE)
      GO TO 120
C
C     FOR TANDY DMP-105 PRINTER
C
C  97 CALL PXZ44(ICODE)
C  C  GO TO 120
  100 WRITE(LUERR,110)
  110 FORMAT(' %PLOTTER SELECTED NOT IMPLEMENTED.')
      STOP 777
C
  120 IF (ICODE-1) 190,130,180
C
C  PERFORM REMAINING GENERAL INTITIALIZATION
  130 DO 140 I=1,8
        IDASH(I)=-1
  140 CONTINUE
      IF (INCMT) 160,160,150
  150 XRASP=XRASP/2.54
      YRASP=YRASP/2.54
  160 DO 170 I=1,64
        DASHT(I)=DASHX(I)*XRASP
  170   CONTINUE
      NBLKO=0
      NCALS=0
      NCHRL=-1
      NCHRO=0
      NLINI=0
      NLINO=0
      RYXRS=XRASP/YRASP
      RXYRS=YRASP/XRASP
      NCSTR=0
      NCCNT=0
      NCOUT=0
      GO TO 210
C
  180 IF (ICODE-3)  240,200,240
C
  190 IF (LUOUT.NE.LUTTY) GO TO 240
  200 CALL PXZ07(0.,0.,-1)
C	DO NOT CALL PXZ05 TO PACK CHARACTERS IF
C	THE HP7580A HAS BEEN SELECTED.
	IF (IPLTR .NE. 6) CALL PXZ05
  210 CALL PXZ01
C
C     WRITE EOF'S AND CLOSE OUT DEVICES
      IF (ICODE-3)  240,220,240
  220 CALL PXZHC
      GO TO 240
C
  230 PXZ00=1
      CALL PXZ02(10)
  240 RETURN
C
      END

