C******************** START FILE UPPASS.FOR ; GROUP USPARM ******************
C----------------------------------------------------------------
C&  UPPASS      PASS SPECIFIED LOCAL PARAMETERS TO LOWER LEVEL
C              INDIRECT INPUT FILE
C
C   ZLINE-- INPUT LINE CONTAINING SPECIFICATIONS OF PARAMETERS TO
C           BE PASSED
C   ISTART- INDEX LOCATION IN ZLINE AT WHICH TO START SCAN
C   LLINE-- LENGTH OF INPUT LINE
C
      SUBROUTINE UPPASS(ZLINE,ISTART,LLINE)
      INCLUDE 'USERIO'
C
      PARAMETER (INOPS=4)
      CHARACTER*1 ZLINE(LLINE),ZTEMP(96),ZBLANK,ZOPS(INOPS)
      CHARACTER*16 ZNAM
      CHARACTER*96 ZVAL
C
      DATA ZBLANK/' '/
      DATA ZOPS/'+','-','*','|'/
C
      IST2=ISTART
C
C  LOOP:
 10   CONTINUE
      IST=IST2
C  EXIT:
      IF((IST.LE.0).OR.(IST.GE.LLINE)) GO TO 500
      IST2=IST+1
 12   CALL UFCHAR(ZLINE,MSLASH,IST2,LLINE)
      INIT=IST+1
      IFIN=LLINE
      IF(IST2.NE.0) IFIN=IPNBLK(ZLINE,LLINE,IST2)
C  CHECK FOR "/" USED AS ARITHMETIC DIVISOR
CX	IF((IST2.NE.0).AND.(ZLINE(IFIN).EQ.'=')) THEN
CX	  IST2=IST2+1
CX	  GO TO 12
CX	ENDIF
      IFND=INIT
      CALL UFCHAR(ZLINE,MEQS,IFND,IFIN)
C  CHECK FOR "=" ASSIGNMENT FORMAT
      IOP=0
      IF(IFND.EQ.0) GO TO 16
C  ARITHMETIC OPTION TRANSFERRED TO LOWER LEVEL ALLOWED
      IFNDP1=INNBLK(ZLINE,LLINE,IFND)
      IF(IFNDP1.GT.(LLINE-1)) GO TO 10
      DO 15 IOP=1,INOPS
      IF((ZLINE(IFNDP1).EQ.'.').AND.(ZLINE(IFNDP1+1).EQ.ZOPS(IOP)))
     >    GO TO 16
 15   CONTINUE
C  ASSIGNMENT WITHOUT ARITHMETIC HANDLED IN UPMASG-- GO ON
      GO TO 10
C  CHECK AND PACK NAME SPECIFICATION
 16   CONTINUE
      INIT2=INIT
      IFIN2=IFIN
      IF(IOP.GT.0) IFIN2=IFND-1
      CALL USPLNM(ZLINE,LLINE,INIT2,IFIN2,ZNAM,IER)
      IF(IER.EQ.0) GO TO 20
C  ILLEGAL NAME
      WRITE(LUNTRM,9001) (ZLINE(I),I=1,MIN(128,LLINE)),INIT,IFIN
 9001 FORMAT(/' % ILLEGAL PARAMETER NAME IN LINE:'/
     >  1X,128A1/'   IGNORED.  CHARACTERS ',I2,' TO ',I2,1H./)
      CALL UCLEAR
      GO TO 100
C  LEGAL NAME.  RECOGNIZED FROM PREVIOUS LEVEL?
 20   CONTINUE
      INLUNI=NLUNIN
      INLUNO=NLUNIO
      NLUNIO=1
      NLUNIN=MAX0(INLUNI,INLUNO)-1
      CALL USPGET(ZNAM,ZVAL,IER)
      IF(IER.EQ.0) THEN
        NLUNIN=INLUNI
        NLUNIO=INLUNO
        GO TO 50
      ELSE IF(IOP.GT.0) THEN
C  NOT RECOGNIZED:  QUERY USER-- UNLESS ARITHMETIC ASSIGNMENT FORMAT
C  IS USED IN WHICH CASE A DEFAULT ARITHMETIC VALUE IS ASSIGNED
        GO TO 50
      ENDIF
      CALL UPQUER(ZNAM,ZTEMP,96,ZVAL)
      NLUNIN=INLUNI
      NLUNIO=INLUNO
      GO TO 50
C  IS RECOGNIZED PARAMETER LOCAL ?
 50   CONTINUE
      CALL USPLOC(ZNAM,ITYPE,INUM)
CT	IF(ITYPE.EQ.2) GO TO 100
C  PASS PARAMETER TO NEXT LOWER LEVEL
 70   CONTINUE
      CALL UPSADL(ZNAM,ZVAL)
C  DELETE PARAMETER REFERENCE AND "/" FROM ZLINE
 100  CONTINUE
      IF(IOP.GT.0) GO TO 10
      INM1=INIT-1
      DO 110 I=INM1,IFIN
      ZLINE(I)=ZBLANK
 110  CONTINUE
C  GO ON TO NEXT PARAMETER
      GO TO 10
C---
C EXIT:
 500  CONTINUE
      RETURN
      	END
C******************** END FILE UPPASS.FOR ; GROUP USPARM ******************
