C====INTEGRATION BY SIMPSON FORMULA=====
      REAL FUNCTION SIMPS1(NN,H,F,K)

      REAL*8 S,S1,H,F(*)
      INTEGER I

C      WRITE(6,2)NN,H,F
C 2    FORMAT(' NN,H ',I3,F10.8/
C    *        ' F '/33F10.8)
      S=0.0D 00
      S1=S
      DO 10 I=K+1,NN-1,2
      S=S+F(I)
      S1=S1+F(I+1)
 10   CONTINUE
      S=F(K)+4.*S+2.*S1-F(NN)
      IF (IPARI(NN).GT.0) S=S+(9.*F(NN)-
     * F(NN-2))/4.+F(NN-1)
       SIMPS1=S*H/3.
      RETURN
      END
