SUBROUTINE Glegen (npt, xpt, wht, a, b) USE Numeric_Kinds_Module USE Precision_Module USE FileUnits_Module IMPLICIT NONE INTEGER(KIND=IW_Kind) :: i, npt REAL(KIND=WP_Kind) :: xpt(npt), wht(npt), pol(0:200), a, b, t1, t2 !--------------------------------------------------------------------- ! ! purpose ! supplies the gauss Gauss Legendre abscissas and weights ! ! description of parameters ! npt-number of points desired ! xpt-resultant array containing the gauss legenedre abscissas. ! wht-resultant array containing the gauss legenedre weights !--------------------------------------------------------------------- IF(npt.gt.200) THEN WRITE(Out_Unit,*)'npt.gt.200', npt WRITE(Msg_Unit,*)'npt.gt.200', npt STOP 'Stopped in Glegen: NPT Error' ENDIF CALL GlgnZro (npt, xpt) DO i = 1, (npt+1)/2 CALL Pn(xpt(i), npt, pol) wht(i) = Two*(One-xpt(i)**2)/(npt*(-xpt(i)*pol(npt)+pol(npt-1)) )**2 ENDDO DO i = 1, (npt+1)/2 xpt(npt-i+1) = xpt((npt+1)/2-i+1) wht(npt-i+1) = wht((npt+1)/2-i+1) ENDDO DO i = 1, npt/2 xpt(i) = -xpt(npt+1-i) wht(i) = wht(npt+1-i) ENDDO IF(ABS(SUM(wht)-TWO).gt.ten*REpsilon)THEN WRITE(Out_Unit,*)'Error in Legendre Weights' STOP 'Glegen' ENDIF t1=(b-a)/Two t2=(b+a)/Two DO i=1,npt xpt(i)=xpt(i)*t1+t2 wht(i)=wht(i)*t1 ENDDO RETURN END SUBROUTINE Glegen