0.6.2-dev0
FORCES
FORtran lib for Comp. Env. Sys.
Loading...
Searching...
No Matches
mo_orderpack::fndnth Interface Reference

Find N-th value in array from insertion sort. More...

Public Member Functions

real(kind=dp) function d_fndnth (xdont, nord)
 
real(kind=sp) function r_fndnth (xdont, nord)
 
integer(kind=i4) function i_fndnth (xdont, nord)
 

Detailed Description

Find N-th value in array from insertion sort.

Finds out and returns the NORDth value in XVALT (ascending order). This subroutine uses insertion sort, limiting insertion to the first NORD values, and even less when one can know that the value that is considered will not be the NORDth. It uses only a work array of size NORD and is faster when NORD is very small (2-5), but worst case behavior can happen fairly probably (initially inverse sorted). In many cases, the refined quicksort method implemented by VALNTH / INDNTH is faster, though much more difficult to read and understand.

Parameters
[in]integer(i4)/real(sp,dp), dimension(:) :: XVALTArray to be ranked.
[in]integer(i4) :: NORDNumber of ranked elements.
Return values
integer(i4)/real(sp,dp) :: FNDNTHValue of NORDth rank.

Definition at line 370 of file mo_orderpack.f90.

Member Function/Subroutine Documentation

◆ d_fndnth()

real(kind = dp) function mo_orderpack::fndnth::d_fndnth ( real(kind = dp), dimension (:), intent(in)  xdont,
integer(kind = i4), intent(in)  nord 
)

Definition at line 876 of file mo_orderpack.f90.

◆ i_fndnth()

integer(kind = i4) function mo_orderpack::fndnth::i_fndnth ( integer(kind = i4), dimension (:), intent(in)  xdont,
integer(kind = i4), intent(in)  nord 
)

Definition at line 978 of file mo_orderpack.f90.

◆ r_fndnth()

real(kind = sp) function mo_orderpack::fndnth::r_fndnth ( real(kind = sp), dimension (:), intent(in)  xdont,
integer(kind = i4), intent(in)  nord 
)

Definition at line 927 of file mo_orderpack.f90.


The documentation for this interface was generated from the following file: