<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div class="">Hi Dennis, </div>
<div class=""><br class="">
</div>
<div class="">I will work on coding up the suggested algorithm…</div>
<div class="">However, it might be easier to rephrase the question:</div>
<div class=""><br class="">
</div>
<div class="">I have an array of HI(time), T(time), and RH(time).</div>
<div class="">I want to qsort(HI), then reorder T and RH to match qsort(HI).</div>
<div class=""><br class="">
</div>
<div class="">Is there a way to do that?  </div>
<div class="">Because I can simply use index numbers, and get around this issue.</div>
<div class=""><br class="">
</div>
<div class="">-Jonathan</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Feb 25, 2019, at 5:31 PM, Dennis Shea <<a href="mailto:shea@ucar.edu" class="">shea@ucar.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="">Jonathan:</div>
<div class=""><br class="">
</div>
<div class="">For a sort variation, you might try <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/dim_pqsort_n.shtml" target="_blank" class="">
<b class="">dim_pqsort_n</b></a>  which is from the fortran <a href="https://www.netlib.org/slatec/guide" target="_blank" class="">
<b class="">SLATEC </b></a>library.</div>
<div class=""><br class="">
</div>
<div class="">NCL's <b class="">dim_pqsort_n </b>should be able to handle any dimension size.</div>
<div class=""><br class="">
</div>
<div class="">Under-the-hood:   To my knowledge, fortran's default integer type is 32-bits [ 4 bytes ] =>
<span class="gmail-ILfuVd">2,147,483,647 <br class="">
</span></div>
<div class=""><span class="gmail-ILfuVd">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.<br class="">
</span></div>
<div class=""><br class="">
</div>
<div class="">Cheers</div>
<div class="">D<br class="">
</div>
<div class=""><br class="">
</div>
</div>
<br class="">
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Mon, Feb 25, 2019 at 8:17 AM Buzan, Jonathan <<a href="mailto:jbuzan@purdue.edu" target="_blank" class="">jbuzan@purdue.edu</a>> wrote:<br class="">
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="auto" class="">
<div class=""></div>
<div class="">Hi Rick,</div>
<div class=""><br class="">
</div>
<div class="">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? </div>
<div class=""><br class="">
</div>
<div class="">-Jonathan</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
On Feb 25, 2019, at 16:06, Rick Brownrigg <<a href="mailto:brownrig@ucar.edu" target="_blank" class="">brownrig@ucar.edu</a>> wrote:<br class="">
<br class="">
</div>
<blockquote type="cite" class="">
<div class="">
<div dir="ltr" class="">
<div class="">Hi Jonathan -- yes, qsort() takes a double, or more generally a "numeric" type.</div>
<div class=""><br class="">
</div>
<div class="">RB<br class="">
</div>
</div>
<br class="">
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Mon, Feb 25, 2019 at 7:20 AM Buzan, Jonathan <<a href="mailto:jbuzan@purdue.edu" target="_blank" class="">jbuzan@purdue.edu</a>> wrote:<br class="">
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hello NCL-Talk,<br class="">
<br class="">
Does qsort operate at double precision?<br class="">
I am trying to resolve my stat_dispersion issue by isolating the problem...<br class="">
<br class="">
-Jonathan<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
ncl-talk mailing list<br class="">
<a href="mailto:ncl-talk@ucar.edu" target="_blank" class="">ncl-talk@ucar.edu</a><br class="">
List instructions, subscriber options, unsubscribe:<br class="">
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank" class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br class="">
</blockquote>
</div>
</div>
</blockquote>
</div>
_______________________________________________<br class="">
ncl-talk mailing list<br class="">
<a href="mailto:ncl-talk@ucar.edu" target="_blank" class="">ncl-talk@ucar.edu</a><br class="">
List instructions, subscriber options, unsubscribe:<br class="">
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank" class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br class="">
</blockquote>
</div>
<span id="cid:f_jskjg82e0"><dpsort.f></span></div>
</blockquote>
</div>
<br class="">
</body>
</html>