      SUBROUTINE TALLY(LIST, END)
C
C*********************************************************************
C
C   NAME- TALLY
C
C   LANGUAGE- FORTRAN 77      TYPE- SUBROUTINE      COMPUTER- CRAY  
C
C   VERSION- 1.0    DATE-11/16/93    PROGRAMMER- ARTHUR B. YANG, SMSRC
C   VERSION- 3.0    DATE-01/11/96    PROGRAMMER- ALEX POZDNYAK, FDC  
C      MODIFIED TO RUN ON THE CRAY.  REPLACED I*4 WITH INT.
C 
C   FUNCTION-  TALLY SUMS THE ELEMENTS OF AN ARRAY HAVING
C              A NUMBER OF ELEMENTS RANGING FROM ONE TO END,
C              THEN PLACES THE TOTAL IN THE LAST ELEMENT (END).
C
C
C   CALLING SEQUENCE PARAMETERS-
C
C     ARGUMENT  TYPE  I/O                   DESCRIPTION
C     --------  ----  ---   ------------------------------------------
C     LIST      INT   I/O   VARIABLE-LENGTH ARRAY CONTAINING INTEGER
C                           VALUES.
C
C     END       INT   I/O   INTEGER VALUE CONTAINING THE DIMENSION
C                           OF LIST.
C
C   LOCAL PARAMETERS-
C
C     ARGUMENT  TYPE  I/O                   DESCRIPTION
C     --------  ----  ---   ------------------------------------------
C     I         INT   N/A   DO-LOOP VARIABLE.
C
C     SUM       INT   N/A   SUM OF THE INTEGER ARRAY ELEMENTS.
C
C
C   EXIT STATES- NONE.
C
C**********************************************************************
C
      INTEGER   END, LIST(END), I, SUM
C
      SUM = 0
C
      DO 10 I= 1, END
         SUM = SUM + LIST(I)
   10 CONTINUE
C
      LIST(END) = SUM
C
      RETURN
      END
