C+ C NAME: C nrQRomb C PURPOSE: C CATEGORY: C CALLING SEQUENCE: real function nrQRomb(Func,A,B) C INPUTS: C OUTPUTS: C CALLS: C Say, Choose, nrPolInt C EXTERNAL: C INCLUDE: C COMMON BLOCKS: C SIDE EFFECTS: C RESTRICTIONS: C PROCEDURE: C See Numerical Recipes C MODIFICATION HISTORY: C JUN-1993, Paul Hick (UCSD) C- real Func external Func real A real B parameter (EPS = 1.E-6) parameter (JMAX = 20) parameter (JMAXP = JMAX+1) parameter (K = 5) parameter (KM = K-1) real S(JMAXP) real H(JMAXP) nrQRomb = 0. if (A .eq. B) return H(1) = 1. do J=1,JMAX call nrTrapZD(Func,A,B,S(J),J) if (J .ge. K) then call nrPolInt(K,H(J-KM),S(J-KM),0.,nrQRomb,DSS) if ((DSS .eq. 0. .and. nrQRomb .eq. 0.) .or. abs(DSS) .lt. EPS*abs(nrQRomb)) return end if S(J+1) = S(J) H(J+1) = 0.25*H(J) end do call Say('nrQRomb','W','No convergence','too many steps') return end