!+ Function to perform trapezoidal integration.
!
! Method:
!	Straightforward.
!
! Current Owner of Code: J. M. Edwards
!
! History:
!	 Version 	   Date	  		Comment
!   
!	 1.0		   12-04-95		First Version under RCS
!						(J. M. Edwards)
!
! Description of Code:
!   FORTRAN 77 with extensions listed in documentation. 
!
!- ---------------------------------------------------------------------
      FUNCTION TRAPEZOID(N_POINTS, X, Y)
!
!
      IMPLICIT NONE
!
!
!     DUMMY ARGUMENTS
      REAL*8	!, INTENT(OUT)
     &     TRAPEZOID
!             VALUE OF INTEGRAL
      INTEGER 	!, INTENT(IN)
     &     N_POINTS
!             NUMBER OF POINTS
      REAL*8	!, INTENT(IN)
     &     X(N_POINTS)
!             ABSCISSAE
     &   , Y(N_POINTS)
!             ORDINATES
!
!     LOCAL ARGUMENTS
      INTEGER
     &     I
!             LOOP VARIABLE
!
!     ENTER THE INTEGRATING LOOP.
      TRAPEZOID=0.0D+00
      DO I=1, N_POINTS-1
         TRAPEZOID=TRAPEZOID+(X(I+1)-X(I))*(Y(I+1)+Y(I))
      ENDDO
      TRAPEZOID=0.5D+00*TRAPEZOID
!
!
      RETURN
      END
