[ncl-talk] qsort

Dennis Shea shea at ucar.edu
Mon Feb 25 09:31:04 MST 2019


Jonathan:

For a sort variation, you might try *dim_pqsort_n*
<https://www.ncl.ucar.edu/Document/Functions/Built-in/dim_pqsort_n.shtml>
which is from the fortran *SLATEC * <https://www.netlib.org/slatec/guide>
library.

NCL's *dim_pqsort_n *should be able to handle any dimension size.

Under-the-hood:   To my knowledge, fortran's default integer type is
32-bits [ 4 bytes ] => 2,147,483,647
NCL's C-interface checks the size of the dimension being sorted. I it
exceeds the 32-bit size, NCL uses a special version that allows [64-bit;
8-byte; INTEGER*8] indexing.

Cheers
D


On Mon, Feb 25, 2019 at 8:17 AM Buzan, Jonathan <jbuzan at purdue.edu> wrote:

> Hi Rick,
>
> I am running into an issue where I have some repeat values.  Is there a
> way to add a precision level adjustment during the qsort algorithm?
>
> -Jonathan
>
>
>
>
> On Feb 25, 2019, at 16:06, Rick Brownrigg <brownrig at ucar.edu> wrote:
>
> Hi Jonathan -- yes, qsort() takes a double, or more generally a "numeric"
> type.
>
> RB
>
> On Mon, Feb 25, 2019 at 7:20 AM Buzan, Jonathan <jbuzan at purdue.edu> wrote:
>
>> Hello NCL-Talk,
>>
>> Does qsort operate at double precision?
>> I am trying to resolve my stat_dispersion issue by isolating the
>> problem...
>>
>> -Jonathan
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190225/7de4c63c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dpsort.f
Type: application/octet-stream
Size: 8903 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190225/7de4c63c/attachment.obj>


More information about the ncl-talk mailing list