      FUNCTION SUM_FUN(N,X) ! Bernd Berg Aug 15 2007.
C Sums the array elements of X(N).
      include '../../Libs/Fortran/implicit.sta'
      include '../../Libs/Fortran/constants.par'
      DIMENSION X(N)
      SUM_FUN=ZERO
      DO I=1,N
        SUM_FUN=SUM_FUN+X(I)
      END DO
      RETURN
      END
