C  ENDPT ENDS CURRENT PLOT AND PUTS GRAPHICS SYSTEM
C  BACK INTO AN UNSCALED STATE.
C
      SUBROUTINE ENDPT(JSUM)
      DIMENSION JSUM(1)
      INTEGER PXZ00
C
$INCLUDE:'pxz99.cmn'
C
C**************************************************
C
C  VARIABLES:
C      LUT:      FORTRAN LOGICAL UNIT NO. FOR WRITE TO DISK FILE.
C      IWRFUNC:  QIO FUNCTION CODE FOR AN UNFORMATTED WRITE
C                VIRTUAL BLOCK TO ASSIGNED DEVICE.
C      CHANNEL:  CHANNEL ASSIGNED TO NAMDES BY
C                SYSTEM SERVICE CALL TO 'ASSIGN'.
C      NAMDES:   NAME OF THE DEVICE TO BE PLOTTED ON
C                (I.E., TERMINAL NAME).
C
C
C**************************************************
C
C
C      DATA SCLED,ESCLD,IBEL/7.15633E13,-4.43887E-10,7/
      DATA SCLED,ESCLD/7.15633E13,-4.43887E-10/
C
C  CHECK IF SCALED.
      IF (FSCAL.EQ.SCLED) GO TO 10
      IF (JSUM(1).GE.2) JSUM(2)=-1
      RETURN
C
C  SCALED.  CLEAN UP.
   10 IF (LUOUT.NE.LUTTY) GO TO 30
C     ICSTR(1)=IBEL
C     NCSTR=1
      ISUM=JSUM(2)
      IPXZY=PXZ00(3)
C  C  READ(5,20) A
C  20 FORMAT(A1)
      GO TO 40
C
C  NON-TTY AND TEXPLOT -- JUST CLEAR.
   30 IPXZY=PXZ00(3)
C
C  MARK UNSCALED.
   40 FSCAL=ESCLD
C
      N=JSUM(1)
C
C  RETURN DIAGNOSTICS.
      IF (N.LT.2) GO TO 60
      M=0
      K=1
      DO 50 I=1,MAXER
        M=M+IERCK(K)
        K=K+3
   50   CONTINUE
      JSUM(2)=M
      IF (N.LT.3) GO TO 60
      JSUM(3)=NCALS
      IF (N.LT.4) GO TO 60
      JSUM(4)=NCHRI
      IF (N.LT.5) GO TO 60
      JSUM(5)=NCHRO
      IF (N.LT.6) GO TO 60
      JSUM(6)=NLINI
      IF (N.LT.7) GO TO 60
      JSUM(7)=NLINO
      IF (N.LT.8)  GO TO 60
      JSUM(8)=NBLKO
      IF (N.LT.10)  GO TO 60
      JSUM(9)=IFIX(XRASX)
      JSUM(10)=IFIX(YRASX)
C
C  ALL DONE
C  DEASSIGN THE CHANNEL -  CINDY COOPER, JULY 30, 1981
C  60 CALL SYS$DASSGN(CHANNEL)
   60 RETURN
C
      END


