*-----------------------------------------------------------------------
*     SGLQNP / SGLQID / SGLQCP / SGLQVL / SGLSVL
*-----------------------------------------------------------------------
      SUBROUTINE SGLQNP(NCP)
      INTEGER   NCP
      CHARACTER CP*(*)

      PARAMETER (NPARA = 23)

      LOGICAL   LX(NPARA), LPARA
      LOGICAL   LCHREQ, LFIRST
      CHARACTER CPARAS(NPARA)*8
      CHARACTER CPARAL(NPARA)*40
      CHARACTER CMSG*80

      EXTERNAL  LCHREQ,LENC

      SAVE

* ---- SHORT NAME ----
      DATA      CPARAS( 1)/'LCLIP   '/, LX( 1) / .FALSE. /
      DATA      CPARAS( 2)/'LCHAR   '/, LX( 2) / .FALSE. /
      DATA      CPARAS( 3)/'LLNINT  '/, LX( 3) / .FALSE. /
      DATA      CPARAS( 4)/'LGCINT  '/, LX( 4) / .TRUE. /
      DATA      CPARAS( 5)/'LSOFTF  '/, LX( 5) / .FALSE. /
      DATA      CPARAS( 6)/'LCL2TN  '/, LX( 6) / .FALSE. /
      DATA      CPARAS( 7)/'LCNTL   '/, LX( 7) / .FALSE. /
      DATA      CPARAS( 8)/'LFULL   '/, LX( 8) / .FALSE. /
      DATA      CPARAS( 9)/'LROT    '/, LX( 9) / .FALSE. /
      DATA      CPARAS(10)/'LBUFF   '/, LX(10) / .TRUE. /
      DATA      CPARAS(11)/'LCURV   '/, LX(11) / .TRUE. /
      DATA      CPARAS(12)/'LPROP   '/, LX(12) / .TRUE. /
      DATA      CPARAS(13)/'LUARW   '/, LX(13) / .TRUE. /
      DATA      CPARAS(14)/'LARROW  '/, LX(14) / .FALSE. /
      DATA      CPARAS(15)/'LATONE  '/, LX(15) / .FALSE. /
      DATA      CPARAS(16)/'LDEG    '/, LX(16) / .TRUE. /
      DATA      CPARAS(17)/'LCORNER '/, LX(17) / .TRUE. /
      DATA      CPARAS(18)/'LTITLE  '/, LX(18) / .TRUE. /
      DATA      CPARAS(19)/'LWIDE   '/, LX(19) / .FALSE. /
      DATA      CPARAS(20)/'L2TO3   '/, LX(20) / .FALSE. /
      DATA      CPARAS(21)/'LXLOG3  '/, LX(21) / .FALSE. /
      DATA      CPARAS(22)/'LYLOG3  '/, LX(22) / .FALSE. /
      DATA      CPARAS(23)/'LZLOG3  '/, LX(23) / .FALSE. /
* ---- LONG  NAME ----
      DATA      CPARAL( 1) / 'ENABLE_CLIPING' /
      DATA      CPARAL( 2) / 'ENABLE_LINE_LABELING' /
      DATA      CPARAL( 3) / 'ENABLE_LINEAR_INTERPOLATION' /
      DATA      CPARAL( 4) / 'ENABLE_GREATCIRCLE_INTERPOLATION' /
      DATA      CPARAL( 5) / 'ENABLE_SOFTFILL' /
      DATA      CPARAL( 6) / 'ENABLE_COLOR_SUBSTITUTION' /
      DATA      CPARAL( 7) / 'ENABLE_CONTROL_CHAR' /
      DATA      CPARAL( 8) / 'USE_FULL_WINDOW' /
      DATA      CPARAL( 9) / 'ENABLE_LINE_LABEL_ROTATION' /
      DATA      CPARAL(10) / 'ENABLE_LINE_BUFFERING' /
      DATA      CPARAL(11) / 'DISABLE_LINE_LABEL_AT_CURVE' /
      DATA      CPARAL(12) / 'FIX_ARROWHEAD_PROPORTION' /
      DATA      CPARAL(13) / 'ENABLE_ARROWHEAD_MAPPING' /
      DATA      CPARAL(14) / '----LARROW  ' /
      DATA      CPARAL(15) / 'ENABLE_ARROWHEAD_SHADE' /
      DATA      CPARAL(16)/ 'USE_DEGREE' /
      DATA      CPARAL(17) / 'DRAW_CORNERMARK' /
      DATA      CPARAL(18) / 'DRAW_PAGE_TITLE' /
      DATA      CPARAL(19) / '****LWIDE   ' /
      DATA      CPARAL(20) / '****L2TO3   ' /
      DATA      CPARAL(21) / '++++LXLOG3  ' /
      DATA      CPARAL(22) / '++++LYLOG3  ' /
      DATA      CPARAL(23) / '++++LZLOG3  ' /

      DATA      LFIRST/.TRUE./

      NCP = NPARA

      RETURN
*-----------------------------------------------------------------------
      ENTRY SGLQID(CP, IDX)

      DO 10 N = 1, NPARA
        IF (LCHREQ(CP, CPARAS(N))
     &        .OR. LCHREQ(CP, CPARAL(N))) THEN
          IDX = N
          RETURN
        ENDIF
   10 CONTINUE
      CMSG = 'PARAMETER '''//CP(1:LENC(CP))//''' IS NOT DEFINED.'
      CALL MSGDMP('E','SGLQID',CMSG)

      RETURN
*-----------------------------------------------------------------------
      ENTRY SGLQCP(IDX, CP)

      IF (1.LE.IDX .AND. IDX.LE.NPARA) THEN
        CP = CPARAS(IDX)
      ELSE
        CALL MSGDMP('E','SGLQCP','IDX IS OUT OF RANGE.')
      ENDIF

      RETURN
*-----------------------------------------------------------------------
      ENTRY SGLQCL(IDX, CP)

      IF (1.LE.IDX .AND. IDX.LE.NPARA) THEN
        CP = CPARAL(IDX)
      ELSE
        CALL MSGDMP('E','SGLQCL','IDX IS OUT OF RANGE.')
      ENDIF

      RETURN
*-----------------------------------------------------------------------
      ENTRY SGLQVL(IDX, LPARA)

      IF (LFIRST) THEN
        CALL RTLGET('SG:', CPARAS, LX, NPARA)
        CALL RLLGET(CPARAL, LX, NPARA)
        LFIRST=.FALSE.
      ENDIF

      IF (1.LE.IDX .AND. IDX.LE.NPARA) THEN
        LPARA = LX(IDX)
      ELSE
        CALL MSGDMP('E','SGLQVL','IDX IS OUT OF RANGE.')
      ENDIF

      RETURN
*-----------------------------------------------------------------------
      ENTRY SGLSVL(IDX, LPARA)

      IF (LFIRST) THEN
        CALL RTLGET('SG:', CPARAS, LX, NPARA)
        CALL RLLGET(CPARAL, LX, NPARA)
        LFIRST = .FALSE.
      ENDIF

      IF (1.LE.IDX .AND. IDX.LE.NPARA) THEN
        LX(IDX) = LPARA
      ELSE
        CALL MSGDMP('E','SGLSVL','IDX IS OUT OF RANGE.')
      ENDIF

      RETURN
*-----------------------------------------------------------------------
      ENTRY SGLQIN(CP, IN)

      DO 20 N = 1, NPARA
         IF (LCHREQ(CP, CPARAS(N)) .OR.
     &        LCHREQ(CP, CPARAL(N))) THEN
            IN = N
            RETURN
         ENDIF
 20   CONTINUE

      IN = 0

      RETURN

      END
