        subroutine SKALE2(FMN,FMX,RN,VALMIN,STEP,VALMAX,IFAULT)
        real FMAX,FMIN,FMN,FMX,RANGE,RJ,RN,S,STEP,VALMAX,VALMIN,X
        real BIAS, half, ONE, TEN, TOL, unit(11), ZERO
        integer I, IFAULT, NUNIT
        data NUNIT /11/
        data unit /1.0,1.2,1.6,2.0,2.5,3.0,4.0,5.0,6.0,8.0,10.0/
        data ZERO,half,ONE,TEN / 0.0, 0.5, 1.0, 10.0 /
        data BIAS, TOL / 1.0E-04, 5.0E-05 /
      FMAX = FMX
      FMIN = FMN
      IFAULT = 1
      if (FMAX.lt.FMIN.or.RN.le.1.) return
      IFAULT = 0
      RN = aint(RN-1.0)
      X = abs(FMAX)
      if (X.eq.ZERO) X = ONE
      if ((FMAX-FMIN)/X.gt.TOL) go to 130
      if (FMAX) 100, 110, 120
100   continue
      FMAX = ZERO
      go to 130
110   continue
      FMAX = ONE
      go to 130
120   continue
      FMIN = ZERO
130   continue
      STEP = (FMAX-FMIN)/RN
      S = STEP
140   continue
      if (S.ge.ONE) go to 150
      S = TEN*S
      go to 140
150   continue
      if (S.lt.TEN) go to 160
      S = S/TEN
      go to 150
160   continue
      X = S-BIAS
      do 170 I = 1, NUNIT
         if (X.le.unit(I)) go to 180
170   continue
180   continue
      STEP = STEP*unit(I)/S
      RANGE = STEP*RN
      X = half*(ONE+(FMIN+FMAX-RANGE)/STEP)
      RJ = aint(X-BIAS)
      if (X.lt.ZERO) RJ = RJ-1.0
      VALMIN = STEP*RJ
      if (FMIN.ge.ZERO.and.RANGE.ge.FMAX) VALMIN = ZERO
      VALMAX = VALMIN+RANGE
      if (FMAX.gt.ZERO.or.RANGE.lt.-FMIN) return
      VALMAX = ZERO
      VALMIN = -RANGE
      return
      end
