LegendreQuadrature Subroutine

public subroutine LegendreQuadrature(N, nodes, weights, QuadType)

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: N
real(kind=prec), intent(out) :: nodes(0:N)
real(kind=prec), intent(out) :: weights(0:N)
integer, intent(in) :: QuadType

Calls

proc~~legendrequadrature~~CallsGraph proc~legendrequadrature LegendreQuadrature proc~legendregausslobatto LegendreGaussLobatto proc~legendrequadrature->proc~legendregausslobatto proc~legendregauss LegendreGauss proc~legendrequadrature->proc~legendregauss proc~legendreqandl LegendreQandL proc~legendregausslobatto->proc~legendreqandl proc~legendrepolynomial LegendrePolynomial proc~legendregauss->proc~legendrepolynomial

Called by

proc~~legendrequadrature~~CalledByGraph proc~legendrequadrature LegendreQuadrature proc~init_lagrange_t Init_Lagrange_t proc~init_lagrange_t->proc~legendrequadrature proc~init_lagrange~2 Init_Lagrange proc~init_lagrange~2->proc~legendrequadrature proc~init_lagrange Init_Lagrange proc~init_lagrange->proc~legendrequadrature

Contents

Source Code


Source Code

  subroutine LegendreQuadrature(N,nodes,weights,QuadType)
    implicit none
    integer,intent(in)     :: N
    real(prec),intent(out) :: nodes(0:N)
    real(prec),intent(out) :: weights(0:N)
    integer,intent(in)     :: QuadType
    ! Local
    real(real64) :: nodesLocal(0:N)
    real(real64) :: weightsLocal(0:N)
    integer :: i

    if(QuadType == GAUSS_LOBATTO) then

      call LegendreGaussLobatto(N,nodesLocal,weightsLocal)

    elseif(QuadType == GAUSS) then

      call LegendreGauss(N,nodesLocal,weightsLocal)

    endif

    do i = 0,N
      nodes(i) = real(nodesLocal(i),prec)
      weights(i) = real(weightsLocal(i),prec)
    enddo

  endsubroutine LegendreQuadrature