8 real(
dp) :: alpha, beta
9 real(
dp),
dimension(:),
allocatable :: x, w
10 character(len=128) :: arg
11 character(len=:),
allocatable :: method
14 if (command_argument_count() /= 4)
then
15 print*,
"Usage: ./gjp_quad <n_points> <alpha> <beta> <method>"
16 print*,
" n_points: Number of quadrature points (integer)"
17 print*,
" alpha: Parameter alpha for Gauss-Jacobi quadrature (must be > -1)"
18 print*,
" beta: Parameter beta for Gauss-Jacobi quadrature (must be > -1)"
19 print*,
" method: Method to use for computation (supported: 'rec', 'gw', 'algo665')"
21 print*,
"For Gauss-Jacobi quadrature, the weight function is (b-x)^alpha*(x-a)^beta."
22 error stop
"Must supply 4 arguments"
24 call get_command_argument(1, arg)
25 read (arg,
'(i4)') n_points
26 allocate (x(n_points), w(n_points))
28 call get_command_argument(2, arg)
29 if (index(arg,
'.') == 0)
then
30 print*,
"alpha must include a decimal point"
35 call get_command_argument(3, arg)
36 if (index(arg,
'.') == 0)
then
37 print*,
"beta must include a decimal point"
42 call get_command_argument(4, arg)
48 print
'(1X, A, 1P, E24.17, 2X, A, 1P, E23.17)',
'Root: ', x(idx),
'Weight: ', w(idx)
Overall driver for Gauss-Jacobi quadrature.
subroutine gauss_jacobi(npts, alpha, beta, x, wts, method)
Compute the Gauss-Jacobi quadrature nodes and weights.
Module for defining types and precision levels for Gauss-Jacobi Polynomial (GJP) calculations.
integer, parameter, public dp
Define various kinds for real numbers.