      SUBROUTINE G1CLS3(IFUNCO,LENGTH,IDATA,RDATA)
C
C          ------------------------------------------------
C          ROUTINE NO. (1014)   VERSION (A8.7)    07:NOV:96
C          ------------------------------------------------
C
C          THIS PROVIDES PARAMETER-SETTING OPERATIONS.
C
C
C          THE ARGUMENTS ARE AS FOLLOWS:
C
C          <IFUNCO> GIVES THE FUNCTION CODE:
C                   =  1, OPEN DEVICE CHANNEL             (N),
C                   =  2, CLOSE DEVICE CHANNEL            (N),
C                   =  3, ERASE PICTURE WITH PROMPT/WAIT,
C                   =  4, SET LINE THICKNESS              (N),
C                   =  5, -NO LONGER USED-
C                   =  6, SET LINE PATTERN                (N1...N4),
C                   =  7, SET LINE HARDWARE MODE          (N),
C                   =  8, SET LINE BLINK                  (N),
C                   =  9, SET LINE COLOUR NUMBER          (N),
C                   = 10, EMPTY DEVICE BUFFERS,
C                   = 11, ERASE PICTURE WITHOUT PROMPT/WAIT,
C                   = 12, SET DEVICE RESOLUTION           (N).
C          <LENGTH> GIVES THE DATA LENGTH (IN BYTES),
C          [IDATA]  IS THE INTEGER DATA ARRAY, AND
C          [RDATA]  IS THE ALTERNATIVE REAL DATA ARRAY.
C
C
      REAL    RDATA(*)
      INTEGER IDATA(*)
      LOGICAL OPEN,LHRDW1
C
      COMMON /T1CPOS/ XCHAR,YCHAR
      COMMON /T1DENA/ OPEN
      COMMON /T1DEVS/ KCHAN1(5),IRESL1
      COMMON /T1DRES/ DRESX,DRESY
      COMMON /T1HRDL/ LHRDW1
      COMMON /T1KDEF/ KOLLID,KOLBAD,MAXCLS
      COMMON /T1LATT/ KOLIN1,ITHIK1
      COMMON /T1LINT/ ELWID,NFILLI,THIKST
      COMMON /T1LPAT/ MARKA1,MISSA1,MARKB1,MISSB1
      COMMON /T1MAPP/ X1MAP1,X2MAP1,Y1MAP1,Y2MAP1
      COMMON /T1PNUM/ NDPICS
      COMMON /T1PPBT/ XPLOTB,YPLOTB
      COMMON /T1PPOS/ XPLOT1,YPLOT1
C
C
      IF (IFUNCO.LT.1.OR.IFUNCO.GT.14) RETURN
      GO TO (1,2,3,4,5,6,7,8,9,10,11,13), IFUNCO
C
C          THIS OPENS THE DEVICE CHANNEL. (WITHOUT THIS
C          BEING DONE, NO GRAPHICAL OUTPUT IS POSSIBLE).
C
    1 IVALUE= IDATA(1)
      IF (IVALUE.LE.0.OR.IVALUE.GT.5) RETURN
C
      KCHAN1(IVALUE)= 1
      CALL G1FILB(0,0,-86,IVALUE)
      OPEN= .TRUE.
      RETURN
C
C          AND THIS CLOSES THE DEVICE CHANNEL.
C
    2 IVALUE= IDATA(1)
      IF (IVALUE.LE.0.OR.IVALUE.GT.5) RETURN
C
      KCHAN1(IVALUE)= 0
      CALL G1FILB(0,0,-87,IVALUE)
      OPEN= .FALSE.
C
      DO 100 ITEST= 1,5
        IF (KCHAN1(ITEST).EQ.1) OPEN= .TRUE.
  100 CONTINUE
      RETURN
C
C          THIS ERASES THE PICTURE WITH A PROMPT/WAIT.
C
    3 IF (.NOT.OPEN) RETURN
C
      KODERA= -81
      GO TO 12
C
C          THIS SETS THE LINE THICKNESS.
C
    4 ITHIK1= IDATA(1)
      NFILLI= (ITHIK1/ELWID)+0.5
      IF (ITHIK1.EQ.1.OR.NFILLI.LT.1) NFILLI= 1
C
      THIKST= (0.0005*ITHIK1)/NFILLI
      RETURN
C
C          THIS SETS THE LINE INTENSITY.
C          (IT IS NO LONGER IMPLEMENTED).
C
    5 RETURN
C
C          THIS SETS THE CURRENT LINE PATTERN, AND IN
C          THE CASE OF HARDWARE BROKEN LINES SETS THE
C          APPROPRIATE PATTERN VIA SUBROUTINE <G1HRDW>.
C
    6 MARKA1= IDATA(1)
      MISSA1= IDATA(2)
      MARKB1= IDATA(3)
      MISSB1= IDATA(4)
      RESMIN= 1000.0/AMIN1(DRESX,DRESY)
      IF (FLOAT(MARKA1).LT.RESMIN) MARKA1= 0
      IF (FLOAT(MISSA1).LT.RESMIN) MISSA1= 0
      IF (FLOAT(MARKB1).LT.RESMIN) MARKB1= 0
      IF (FLOAT(MISSB1).LT.RESMIN) MISSB1= 0
      IF (LHRDW1) CALL G1HRDW(1)
      RETURN
C
C          THIS SETS LINE HARDWARE MODE.
C
    7 LHRDW1= .FALSE.
      IF (IDATA(1).EQ.1) LHRDW1= .TRUE.
C
      CALL G1HRDW(1)
      RETURN
C
C          THIS SETS DISPLAY BLINKING.
C          (IT IS NOT IMPLEMENTED HERE).
C
    8 RETURN
C
C          THIS SETS THE LINE COLOUR NUMBER.
C
    9 KOLIN1= IDATA(1)
      IF (KOLIN1.EQ.0) KOLIN1= KOLLID
C
      CALL G1HRDW(4)
      RETURN
C
C          THIS CAUSES ALL THE INTERNAL BUFFERS TO
C          BE EMPTIED IMMEDIATELY RATHER THAN AFTER
C          THEY BECOME FULL (AS IS THE NORMAL CASE).
C
   10 CALL G1FILB(0,0,-84,0)
      RETURN
C
C          THIS ERASES THE DEVICE WITHOUT A PROMPT/WAIT.
C
   11 IF (.NOT.OPEN) RETURN
C
      KODERA= -82
   12 XPLOT1= X1MAP1
      YPLOT1= Y1MAP1
      CALL G1LINE(0.0,0.0,.FALSE.)
      XCHAR= XPLOTB
      YCHAR= YPLOTB
      NDPICS= NDPICS+1
      CALL G1FILB(0,0,KODERA,0)
      RETURN
C
C          THIS SETS THE DEVICE RESOLUTION.
C
   13 IRESL1= IDATA(1)
      CALL G1HRDW(9)
      RETURN
      END
