function overint(n,h,f1) c function to calculate the integral of one vectors f1 c using simpsons rule, assuming f1(0)=f1(n+1)=0 c assumes f1, f2 tabulated at points r=i*h implicit real*8 (a-h,o-z) dimension f1(n) if (n.lt.4) then overint=0 do i=1,n overint=overint+h*f1(i) enddo return endif fac=h/3 overint=4*f1(1)+f1(2) do i=4,n,2 overint=overint+f1(i-2)+4*f1(i-1)+f1(i) enddo overint=fac*overint return end