*-----------------------------------------------------------------------
*     GET EXTERNAL PARAMETER FROM 'DCLRC' FILE
*-----------------------------------------------------------------------
      SUBROUTINE RPNXFL
      CHARACTER CPFIX*(*), CP*(*)
      INTEGER   IPARA, IFROMC
      LOGICAL   LPARA, LFROMC
      REAL      RPARA, RFROMC
      CHARACTER CVAL*(*)
      PARAMETER (NPARA = 100)

      LOGICAL   LCHREQ
      INTEGER   LENC
      CHARACTER CPARA(NPARA)*80,CX(NPARA)*80,CDSN*80,CLINE*80,CPX*16,
     +          CADJ*32

      EXTERNAL  LCHREQ, LENC, IUFOPN, IFROMC, LFROMC, RFROMC

      SAVE

      NN = 0

      CALL GLQFNM('DCLRC',CDSN)
      IF (CDSN .EQ. ' ') RETURN

      IU = IUFOPN()
      IF (IU .EQ. 0) RETURN

      OPEN(IU, FILE = CDSN, FORM = 'FORMATTED')
      REWIND(IU)

 10   CONTINUE
      READ(IU, '(A)', IOSTAT = IOS) CLINE
      IF (IOS.EQ.0) THEN
         IF (CLINE(1:1).NE.'*' .AND. CLINE(3:3).EQ.':') THEN
            NN = NN + 1
            IF (NN .GT. NPARA) THEN
               CALL MSGDMP('E','RTNXFL',
     +              'NUMBER OF INPUT PARAMETERS IS TOO LARGE (>100).')
            END IF
            IDB = INDEX(CLINE,' ')
            CPARA(NN) = CLINE(1:IDB-1)
          CX(NN) = CLINE(IDB+1:LENC(CLINE))
          CALL CLADJ(CX(NN))
         ENDIF
      ENDIF
      IF (IOS.EQ.0) GO TO 10

      RETURN
*-----------------------------------------------------------------------
*     GET EXTERNAL PARAMETER FROM 'DCLRC' FILE (INTEGER)
*-----------------------------------------------------------------------
      ENTRY RTIXFL(CPFIX, CP, IPARA)

      CPX = CPFIX(1:LENC(CPFIX))//CP

      DO 20 N = 1, NN
         IF (LCHREQ(CPX, CPARA(N))) THEN
            CADJ = CX(N)
            CALL CLADJ(CADJ)
            IPARA = IFROMC(CADJ)
            RETURN
         END IF
 20   CONTINUE

      RETURN
*-----------------------------------------------------------------------
*     GET EXTERNAL PARAMETER FROM 'DCLRC' FILE (LOGICAL)
*-----------------------------------------------------------------------
      ENTRY RTLXFL(CPFIX, CP, LPARA)

      CPX = CPFIX(1:LENC(CPFIX))//CP

      DO 30 N = 1, NN
         IF (LCHREQ(CPX, CPARA(N))) THEN
            CADJ = CX(N)
            CALL CLADJ(CADJ)
            LPARA = LFROMC(CADJ)
            RETURN
         END IF
 30   CONTINUE

      RETURN
*-----------------------------------------------------------------------
*     GET EXTERNAL PARAMETER FROM 'DCLRC' FILE (REAL)
*-----------------------------------------------------------------------
      ENTRY RTRXFL(CPFIX, CP, RPARA)

      CPX = CPFIX(1:LENC(CPFIX))//CP

      DO 40 N = 1, NN
         IF (LCHREQ(CPX, CPARA(N))) THEN
            CADJ = CX(N)
            CALL CLADJ(CADJ)
            RPARA = RFROMC(CADJ)
            RETURN
         END IF
 40   CONTINUE

      RETURN
*-----------------------------------------------------------------------
*     GET EXTERNAL PARAMETER FROM 'DCLRC' FILE (CHARACTER)
*-----------------------------------------------------------------------
      ENTRY RTCXFL(CPFIX, CP, CVAL)

      CPX=CPFIX(1:LENC(CPFIX))//CP

      DO 50 N = 1, NN
        IF (LCHREQ(CPX, CPARA(N))) THEN
          CVAL = CX(N)
          RETURN
        END IF
   50 CONTINUE

*-----------------------------------------------------------------------
* GET EXTERNAL PARAMETER FROM 'DCLRC' FILE (INTEGER)
*-----------------------------------------------------------------------
      ENTRY RLIXFL(CP, IPARA)

      NP = INDEX(CP, ' ')  - 1

      DO 60 N = 1,NN
         IF (LCHREQ(CP(1:NP), CPARA(N))) THEN
            CADJ = CX(N)
            CALL CLADJ(CADJ)
            IPARA = IFROMC(CADJ)
            RETURN
         END IF
 60   CONTINUE
      RETURN
*-----------------------------------------------------------------------
* GET EXTERNAL PARAMETER FROM 'DCLRC' FILE (LOGICAL)
*-----------------------------------------------------------------------
      ENTRY RLLXFL(CP, LPARA)

      NP = INDEX(CP, ' ')  - 1

      DO 70 N = 1, NN
         IF (LCHREQ(CP(1:NP),CPARA(N))) THEN
            CADJ = CX(N)
            CALL CLADJ(CADJ)
            LPARA = LFROMC(CADJ)
            RETURN
         END IF
 70   CONTINUE

      RETURN
*-----------------------------------------------------------------------
* GET EXTERNAL PARAMETER FROM 'DCLRC' FILE (REAL)
*-----------------------------------------------------------------------
      ENTRY RLRXFL(CP, RPARA)

      NP = INDEX(CP, ' ')  - 1

      DO 80 N = 1, NN
         IF (LCHREQ(CP(1:NP),CPARA(N))) THEN
            CADJ=CX(N)
            CALL CLADJ(CADJ)
            RPARA = RFROMC(CADJ)
            RETURN
         END IF
 80   CONTINUE

      RETURN
*-----------------------------------------------------------------------
* GET EXTERNAL PARAMETER FROM 'DCLRC' FILE (CHARACTER)
*-----------------------------------------------------------------------
      ENTRY RLCXFL(CP, CVAL)

      DO 90 N = 1, NN
        IF (LCHREQ(CP, CPARA(N))) THEN
          CVAL = CX(N)
          RETURN
        END IF
   90 CONTINUE

      END
