C--------------------------------------------------------------------
C  GSCGT1 - GRAOPT SUBROUTINE - GET A SCALE NUMBER FROM THE USER
C
      SUBROUTINE GSCGT1(ZSUB,ZNAME,ZVAL,ZDEFLT,IRET,XTRA)
C
      CHARACTER*(*) ZSUB
      CHARACTER*(*) ZNAME
      CHARACTER*(*) XTRA
C
C  ZSUB - NAME OF CALLING SUBROUTINE, USED IN UREAD PROMPT
C
C  ZNAME - NAME OF QUANTITY TO READ E.G. "XMIN"
C   ZVAL - VALUE READ IN
C  ZDEFLT- DEFAULT VALUE TO USE IF USER TYPES IN "X"
C
C  IRET = -1 USER TYPED "Q"
C       = 0  USER TYPED IN A VALID FLOATING PT NUMBER
C       = 1  USER TYPED IN SOMETHING INCOMPREHENSIBLE
C       = 1+INDEX(XTRA,user option letter) IF USER TYPED IN AN
C          "XTRA" OPCODE
C
C  XTRA - EXTRA OPTIONS BEYOND "X", "Q" THAT THE USER MAY TYPE IN
C   **XTRA** SHOULD NOT CONTAIN NUMERAL CHARACTERS - ONLY
C   LETTERS OR BLANKS
C
C
C *LISMAK* 12-APR-88  GENERATED LOGICAL DECLARATIONS
      LOGICAL LCHAR
C *LISMAK* END OF GENERATED LOGICAL DECLARATIONS
C
           CALL UREAD(ZSUB//'>> ENTER NEW '//ZNAME//':$$')
           IF(LCHAR('Q')) THEN
             IRET=-1
           ELSE IF(LCHAR('X')) THEN
             IRET=0
             ZVAL=ZDEFLT
           ELSE
C  CHECK XTRA
             IRET=0
             IL=LEN(XTRA)
             DO 10 I=1,IL
               IF(XTRA(I:I).EQ.' ') GO TO 10
               IF(LCHAR(XTRA(I:I))) IRET=1+I
 10          CONTINUE
C  IF LETTER OPTION NOT TYPED, DECODE FLOATING PT ANSWER
             IF(IRET.EQ.0) ZVAL=FDCOD(IRET)
           ENDIF
C
           RETURN
      END
