*-----------------------------------------------------------------------
*     GET EXTERNAL PARAMETER FROM ENVIRONMENTAL VARIABLE
*-----------------------------------------------------------------------
      SUBROUTINE RPNENV
      CHARACTER CPFIX*(*), CP*(*)
      CHARACTER CARG*32, CPX*16
      INTEGER   IPARA, IFROMC, LENC
      LOGICAL   LPARA, LFROMC, LCHREQ
      REAL      RPARA, RFROMC
      CHARACTER CPARA*(*)
      EXTERNAL  LCHREQ,LENC,IFROMC,LFROMC,RFROMC

      RETURN
*-----------------------------------------------------------------------
*     GET EXTERNAL PARAMETER FROM ENVIRONMENTAL VARIABLE (INTEGER)
*-----------------------------------------------------------------------
      ENTRY RTIENV(CPFIX, CP, IPARA)

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

      CALL OSGENV(CPX, CARG)
      IF (CARG .NE. ' ') THEN
         IPARA = IFROMC(CARG)
      END IF

      RETURN
*-----------------------------------------------------------------------
*     GET EXTERNAL PARAMETER FROM ENVIRONMENTAL VARIABLE (LOGICAL)
*-----------------------------------------------------------------------
      ENTRY RTLENV(CPFIX, CP, LPARA)

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

      CALL OSGENV(CPX, CARG)
      IF (CARG .NE. ' ') THEN
         LPARA = LFROMC(CARG)
      END IF

      RETURN
*-----------------------------------------------------------------------
*     GET EXTERNAL PARAMETER FROM ENVIRONMENTAL VARIABLE (REAL)
*-----------------------------------------------------------------------
      ENTRY RTRENV(CPFIX, CP, RPARA)

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

      CALL OSGENV(CPX, CARG)
      IF (CARG .NE. ' ') THEN
         RPARA = RFROMC(CARG)
      END IF

      RETURN
*-----------------------------------------------------------------------
*     GET EXTERNAL PARAMETER FROM ENVIRONMENTAL VARIABLE (CHARACTER)
*-----------------------------------------------------------------------
      ENTRY RTCENV(CPFIX, CP, CPARA)

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

      CALL OSGENV(CPX, CARG)
      IF (CARG .NE. ' ') THEN
         CPARA = CARG
      END IF

      RETURN
*-----------------------------------------------------------------------
*     GET EXTERNAL PARAMETER FROM ENVIRONMENTAL VARIABLE (INTEGER)
*-----------------------------------------------------------------------
      ENTRY RLIENV(CP, IPARA)

      CALL OSGENV(CP, CARG)
      IF (CARG .NE. ' ') THEN
         IPARA = IFROMC(CARG)
      END IF

      RETURN
*-----------------------------------------------------------------------
*     GET EXTERNAL PARAMETER FROM ENVIRONMENTAL VARIABLE (REAL)
*-----------------------------------------------------------------------
      ENTRY RLRENV(CP, RPARA)

      CALL OSGENV(CP, CARG)
      IF (CARG .NE. ' ') THEN
         RPARA = RFROMC(CARG)
      END IF

      RETURN
*-----------------------------------------------------------------------
*     GET EXTERNAL PARAMETER FROM ENVIRONMENTAL VARIABLE (LOGICAL)
*-----------------------------------------------------------------------
      ENTRY RLLENV(CP, LPARA)

      CALL OSGENV(CP, CARG)
      IF (CARG .NE. ' ') THEN
         LPARA = LFROMC(CARG)
      END IF

      RETURN
*-----------------------------------------------------------------------
*     GET EXTERNAL PARAMETER FROM ENVIRONMENTAL VARIABLE (CHARACTER)
*-----------------------------------------------------------------------
      ENTRY RLCENV(CP, CPARA)

      CALL OSGENV(CP, CARG)

      IF (CARG .NE. ' ') THEN
         CPARA = CARG
      END IF

      RETURN
      END
