<div dir="ltr"><div>Hi,<br><br>I'm not sure if this is your question or not, but rand will always produce the same sequence with a given seed -- in your case since none is specified, its some default value. If you want different sequences across successive runs, you might set the seed based upon the clock; e.g., this on a linux system:<br> <br></div> ; call this before any calls to rand()<br><div> srand(stringtoint(systemfunc("date +%s")))<br><br><br></div><div>Hope that helps...please write back to this list if not.<br></div><div>Rick<br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Nov 9, 2014 at 3:03 AM, <span dir="ltr"><<a href="mailto:legven@gmail.com" target="_blank">legven@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Dear NCL users,<br></div>I have been trying to <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/csvoro.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Functions/Built-in/csvoro.shtml</a>:<br><pre>begin
;
; Create input arrays.
;
ndata = 100
rlati = new(ndata,float)
rloni = new(ndata,float)
;
do i=0,ndata-1
rlati(i) = -90. + 180.*<a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/rand.shtml" target="_blank"><strong>rand</strong></a>()/32767.
rloni(i) = -180. + 360.*<a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/rand.shtml" target="_blank"><strong>rand</strong></a>()/32767.
end do
;
; Obtain the Voronoi polygon for the first point in the input
; dataset. nv(0:numv-1) will contain integers to be used as
; indices for rlato and rlono to determine the polygonal vertices.
;
rlato = new(2*ndata,float)
rlono = new(2*ndata,float)
alen = new(2*ndata,float)
nca = new(1,integer)
numv = new(1,integer)
nv = new(ndata,integer)
<strong>csvoro</strong>(rlati,rloni,0,1,rlato,rlono,alen,nca,numv,nv)
end<br><br></pre><pre>I run this sample many times, but always numv will be <= 15 for ndata = 100 or ndata = 1000.<br>Values of alen will be positive only for first numv index's.<br><br></pre><pre>What's wrong?<br><br></pre><pre>Many thanks. <br></pre><br></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>