SUBROUTINE Laguer (npt, xpt, wht, kase) USE FileUnits_Module USE Precision_Module IMPLICIT NONE REAL(KIND=WP_Kind) :: xpt(*), wht(*), fac, hpol(0:200), sum, abs INTEGER(KIND=IW_Kind) :: i, npt, kase !--------------------------------------------------------------------- ! ! purpose ! supplies the gauss Laguere abscissas and weights ! ! description of PARAMETERs ! npt-number of points desired ! xpt-resultant array containing the gauss Laguere abscissas. ! wht-resultant array containing the gauss Laguere weights ! kase=0 IF integrating exp(-x)*f(x)*dx ! kase=1 IF integrating f(x)*dx ! ! SUBROUTINE and functions used ! NONE ! !--------------------------------------------------------------------- IF(npt.gt.200) THEN WRITE(Out_Unit,*)'npt.gt.200', npt WRITE(Msg_Unit,*)'npt.gt.200', npt STOP 'Stopped in Laguer: npt error' ENDIF CALL lagzro (npt, xpt) fac = One/npt DO i = 1, npt CALL Laguer_Fun(xpt(i), npt, hpol, npt+1) wht(i) = xpt(i)*(fac/(hpol(npt)-hpol(npt-1)))**2 ENDDO ! ! Check for Accuracy ! sum = Zero DO i=1,npt sum = sum + wht(i) ENDDO IF( ABS(sum-One).gt.Ten*Ten*REpsilon) THEN WRITE(Out_Unit,*)'Error in weights' STOP 'Stopped in Laguer: error in weights' ENDIF sum =Zero DO i =1,npt sum = sum +wht(i)*xpt(i) ENDDO IF( ABS(sum-One).gt.Ten*Ten*REpsilon) THEN WRITE(Out_Unit,*)'Error in abscissas' STOP 'Stopped in Laguer: Error in abscissas' ENDIF DO i=1,npt xpt(i)=xpt(i) wht(i)=wht(i) IF(kase.eq.1)wht(i)=wht(i)*exp(xpt(i)) ENDDO RETURN END