qsort Subroutine

public recursive subroutine qsort(a)

Subroutine to sort (inplace) using the quick sort algorithm. Adapted from http://www.fortran.com/qsort_c.f95.

Arguments

Type IntentOptional AttributesName
real(kind=pfqp), intent(inout) :: a(:)

Called by

proc~~qsort~~CalledByGraph proc~qsort qsort proc~poly_roots poly_roots proc~poly_roots->proc~qsort proc~sdc_qnodes sdc_qnodes proc~sdc_qnodes->proc~poly_roots proc~pf_quadrature pf_quadrature proc~pf_quadrature->proc~sdc_qnodes proc~pf_init_sdcmats pf_init_sdcmats proc~pf_init_sdcmats->proc~pf_quadrature proc~pf_level_setup pf_level_setup proc~pf_level_setup->proc~pf_init_sdcmats proc~pf_pfasst_setup pf_pfasst_setup proc~pf_pfasst_setup->proc~pf_level_setup

Contents

Source Code


Source Code

  recursive subroutine qsort(a)
    real(pfqp), intent(inout) :: a(:)
    integer :: iq

    if (size(a) > 1) then
       call qsort_partition(a, iq)
       call qsort(a(:iq-1))
       call qsort(a(iq:))
    end if
  end subroutine qsort