!+ Function to perform linear interpolation.
!
! Method:
!	The point of valuation, X_0, has already been determined
!	to lie between X(I1) and X(I2) in the data. The subsequent
!	evaluation is 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 INTERPOLATE(N, X, Y, I1, I2, X_0)
!
!
      IMPLICIT NONE
!
!
!     DUMMY ARGUMENTS.
      INTEGER 	!, INTENT(IN)
     &     N
!             NUMBER OF DATA POINTS
     &   , I1
!             INDEX OF LOWER POINT
     &   , I2
!             INDEX OF UPPER POINT
      REAL*8	!, INTENT(IN)
     &     X(N)
!             POSITIONS OF DATA POINTS
     &   , Y(N)
!             VALUES AT DATA POINTS
     &   , X_0
!             POINT OF EVALUATION
      REAL*8	!, INTENT(OUT)
     &     INTERPOLATE
!             OUT  FUNCTION NAME
!
!     DUMMY ARGUMENTS
      REAL*8
     &     FRACTION
!             FRACTION OF INTERVAL COVERED
!
!
      FRACTION=(X_0-X(I1))/(X(I2)-X(I1))
      INTERPOLATE=FRACTION*Y(I2)+(1.0D+00-FRACTION)*Y(I1)
!
!
      RETURN
      END
