30 REAL(KIND=8) :: ss,func,b
34 CALL qromb(func,0.d0,b,ss)
43 SUBROUTINE qromb(func,a,b,ss)
44 INTEGER :: JMAX,JMAXP,K,KM
45 REAL(KIND=8) :: a,b,func,ss,EPS
47 parameter(eps=1.d-6, jmax=20, jmaxp=jmax+1, k=5, km=k-1)
49 REAL(KIND=8) :: dss,h(jmaxp),s(jmaxp)
52 CALL trapzd(func,a,b,s(j),j)
54 CALL polint(h(j-km),s(j-km),k,0.d0,ss,dss)
55 IF (abs(dss).le.eps*abs(ss))
RETURN 60 stop
'too many steps in qromb' 69 SUBROUTINE qromo(func,a,b,ss,choose)
70 INTEGER :: JMAX,JMAXP,K,KM
71 REAL(KIND=8) :: a,b,func,ss,EPS
73 parameter(eps=1.e-6, jmax=14, jmaxp=jmax+1, k=5, km=k-1)
75 REAL(KIND=8) :: dss,h(jmaxp),s(jmaxp)
78 CALL choose(func,a,b,s(j),j)
80 call polint(h(j-km),s(j-km),k,0.d0,ss,dss)
81 if (abs(dss).le.eps*abs(ss))
return 86 stop
'too many steps in qromo' 90 SUBROUTINE polint(xa,ya,n,x,y,dy)
92 REAL(KIND=8) :: dy,x,y,xa(n),ya(n)
95 REAL(KIND=8) :: den,dif,dift,ho,hp,w,c(nmax),d(nmax)
100 if (dift.lt.dif)
then 115 if(den.eq.0.)stop
'failure in polint' 137 SUBROUTINE trapzd(func,a,b,s,n)
139 REAL(KIND=8) :: a,b,s,func
142 REAL(KIND=8) :: del,sum,tnm,x
144 s=0.5*(b-a)*(func(a)+func(b))
155 s=0.5*(s+(b-a)*sum/tnm)
166 SUBROUTINE midpnt(func,a,b,s,n)
168 REAL(KIND=8) :: a,b,s,func
171 REAL(KIND=8) :: ddel,del,sum,tnm,x
173 s=(b-a)*func(0.5*(a+b))
187 s=(s+(b-a)*sum/tnm)/3.
199 SUBROUTINE midexp(funk,aa,bb,s,n)
201 REAL(KIND=8) :: aa,bb,s,funk
204 REAL(KIND=8) :: ddel,del,sum,tnm,x,func,a,b
205 func(x)=funk(-log(x))/x
209 s=(b-a)*func(0.5*(a+b))
223 s=(s+(b-a)*sum/tnm)/3.
The stochastic models parameters module.
subroutine qromo(func, a, b, ss, choose)
Romberg integration routine on an open interval.
Utility module containing the routines to perform the integration of functions.
subroutine midpnt(func, a, b, s, n)
Midpoint rule integration routine.
subroutine polint(xa, ya, n, x, y, dy)
Polynomial interpolation routine.
subroutine trapzd(func, a, b, s, n)
Trapezoidal rule integration routine.
subroutine, public integrate(func, ss)
Routine to compute integrals of function from O to #maxint.
real(kind=8) maxint
Upper integration limit of the correlations.
subroutine qromb(func, a, b, ss)
Romberg integration routine.
subroutine midexp(funk, aa, bb, s, n)
Midpoint routine for bb infinite with funk decreasing infinitely rapidly at infinity.