%N ariexec %F $MIR/src/subs/ari.for
%D Evalute an expression, previously parsed by AriComp.
%P pjt
%: mathematics
%B
        subroutine ariExec(vaction,N,Buf,BufLen,RBuf,RBufLen,Index)

        implicit none
        integer N,BufLen,RBufLen,Index
        integer Buf(BufLen)
        real RBuf(RBufLen)
        external vaction

  AriExec evaluates a FORTRAN-like expression, which has been parsed
  by AriComp.

  AriExec takes the reverse polish list of tokens in Buf, and proceeds
  to evaluate the expression. VACTION is called to get the values of
  any scalars or vectors. The result of the expression is returned to
  the caller starting at RBUF(INDEX).

  Inputs:
    VACTION    Action routine called to get the vaslue of scalars or vectors.
    N          Vector length. Any value can be used here if there is
               no vector processing.
    BUF        List of tokens, determined by ariComp.
    BUFLEN     Total length of BUF. Its not really used.
    RBUFLEN    Total length of RBUF.

  Input/Output/Scratch:
    RBUF       RBUF contains some constants at the head of the
               array, used by AriExec. These are unchanged on exit.
               The result of the evaluation is returned to the caller
               starting at RBUF(INDEX). Otherwise RBUF is used to hold
               intermediate results.

  Output:
    INDEX      Index into RBUF of the result of the expression.
