      integer function MODIFY(IT)
      include 'SIZE.INC'
      include 'GLOBAL.INC'
      include 'LOCAL.INC'
      include 'INPAR.INC'
      include 'MODNAM.INC'
      include 'UNITS.INC'
      include 'TRANS.INC'
      real ARGS(10), VAL
      integer INUNIT, LOW1, LOW2, LOW3, UP1, UP2, UP3, NULL, EOF
     &,       LOWUP(6), NARGS, IT, K, I, INDX, MATCH, ITM1, ITDTD
      character DELIM(3), TEMP*1, REQFMT(2)*36
      logical NOTNUM
      data REQFMT(1)/'(1X,''Enter value-> ''               )'/
      data REQFMT(2)/'(1X,''Enter name=value command-> ''  )'/
      data DELIM /' ','(','='/
      NARGS = 0
      INUNIT = TTYIN(MACHNO)
      call READSP
      NULL = 0
      IT = 0
      START = STOPIT+1
100   continue
      K = index(INPUT(START:),' TO ')
      if (K.eq.0) K = index(INPUT(START:),' to ')
      if (K.eq.0) K = index(INPUT(START:),' To ')
      if (K.eq.0) K = index(INPUT(START:),' tO ')
      I = START+K-1
      if (K.ne.0) INPUT(I:I+3) = '=   '
      K = START-1
      do 110 I = START, 80
         TEMP = INPUT(I:I)
         if (TEMP.eq.' '.or.TEMP.eq.'	') go to 110
         K = K+1
         INPUT(K:K) = INPUT(I:I)
110   continue
      if (K.eq.80) go to 130
      if (K.eq.START-1) go to 120
      K = K+1
      INPUT(K:) = ' '
      go to 130
120   continue
      NULL = NULL+1
      IT = 1
      if (NULL.gt.1) go to 240
      write (TTYOUT(MACHNO),5000)
5000  format (/' Sytax is "CHANGE <name of variable> TO <new value>"',/'
     &       or    "SET <name of variable>  = <new value>"')
      REQFMT(2)(34:35) = CRSTOP(MACHNO)
      write (TTYOUT(MACHNO),REQFMT(2))
      call INREC (EOF,INUNIT,INPUT)
      IT = -1
      if (EOF.eq.1) go to 240
      START = 1
      go to 100
130   continue
      call SKAN (INPUT,START,STOPIT,TYPE,DELIM,3)
      IT = 2
      if (TYPE.eq.1) go to 240
      INDX = MATCH(NOMOD,LNMODS,MODLEN,MODS,MODMIN)
      IT = -2
      if (INDX.eq.0) go to 240
      IT = 6
      if (TD(INDX).eq.0) go to 240
      if (TYPE.eq.3) go to 140
      IT = 7
      if (TS(INDX).eq.1) go to 240
      ITM1 = TS(INDX)-1
      call GETARG (NARGS,ARGS,IT,ITM1)
      if (IT.ne.0) go to 240
      START = STOPIT+1
      IT = 9
      if (INPUT(START:START).ne.DELIM(3)) go to 240
      STOPIT = START
140   continue
      IT = 4
      if (TS(INDX)-1.ne.NARGS) go to 240
      START = STOPIT+1
150   continue
      IT = 0
      call SKAN (INPUT,START,STOPIT,TYPE,DELIM,1)
      if (TYPE.eq.100) STOPIT = 81
      if (START.ne.STOPIT) go to 160
      REQFMT(1)(21:22) = CRSTOP(MACHNO)
      write (TTYOUT(MACHNO),REQFMT(1))
      call INREC (EOF,INUNIT,INPUT)
      IT = -1
      if (EOF.eq.1) go to 240
      START = 1
      go to 150
160   continue
      VAL = 0.0
      if(TD(INDX).ne.5) then
        call XVALUE(INPUT(START:START),STOPIT-START,VAL,NOTNUM)
      endif
      IT = 10
      if (NOTNUM) go to 240
      call CHKSUB (ARGS,INDX,LOWUP,IT)
      if (IT.ne.0) go to 240
      LOW1 = LOWUP(1)
      LOW2 = LOWUP(2)
      LOW3 = LOWUP(3)
      UP1 = LOWUP(4)
      UP2 = LOWUP(5)
      UP3 = LOWUP(6)
      RDWR = 0
      ITDTD = TD(INDX)
      do 230 ICL1 = LOW1, UP1
         do 230 ICL2 = LOW2, UP2
            do 230 ICL3 = LOW3, UP3
               go to (170,180,190,200,210), ITDTD
170            continue
               write (TTYOUT(MACHNO),5010)
5010           format (/' Complex data indicated. Not implemented.')
               go to 240
180            continue
               R8 = VAL
               go to 220
190            continue
               R4 = VAL
               go to 220
200            continue
               I2 = VAL
               go to 220
210            continue
               L1 = INPUT(START:START)
220            continue
               call PUTVAR
230   continue
240   continue
      MODIFY = IT
      return
      end
