      SUBROUTINE RANGE( IEL, ELDIM, INTDIM, W1, W2, MODE )
      INTEGER           IEL, ELDIM, INTDIM, MODE
      DOUBLE PRECISION  W1(1), W2(1)
      IF( MODE.EQ.0 ) THEN
        IF( IEL.EQ.1 ) THEN
          INTDIM = 2
        ELSE IF( IEL.EQ.2 ) THEN
          INTDIM = ELDIM
        ELSE
          INTDIM = 1
        ENDIF
        RETURN
      ENDIF
      GOTO( 1, 2, 3 ) MODE
C
C     R*w1=w2
C
    1 CONTINUE
      IF( IEL.EQ.1 ) THEN
        W2(1) = W1(1) + W1(3)  
        W2(2) = W1(2)
      ELSE
        W2(1) = W1(1) - W1(2)  
      ENDIF
      RETURN
C      
C     R'*w1 = w2
C
    2 CONTINUE
      IF( IEL.EQ.1 ) THEN
        W2(1) = W1(1) 
        W2(2) = W1(2)
        W2(3) = W1(1)
      ELSE
        W2(1) = W1(1)
        W2(1) = -W1(1)
      ENDIF
      RETURN
C
C     R*w2=w1
C
    3 CONTINUE
      IF( IEL.EQ.1 ) THEN
        W2(1) = 0.5D0 * W1(1)
        W2(2) = W1(2)
        W2(3) = 0.5D0 * W1(1)
      ELSE
        W2(1) = 0.5D0 * W1(1)
        W2(2) = - W2(1)
      ENDIF
      RETURN
C
      END
