<div dir="ltr">Hi Liang,<div>If you want different results, you will need to set random_setallseed:</div><div><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/random_setallseed.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/random_setallseed.shtml</a><br></div><div><br></div><div>random_setallseed is mentioned on a number of random number generator functions but surprisingly not on the two you mentioned. See:</div><div><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/random_uniform.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/random_uniform.shtml</a><br></div><div>for use-case examples.</div><div>Adam</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 4, 2017 at 2:37 PM, Liang Chen <span dir="ltr"><<a href="mailto:lchen15@gmu.edu" target="_blank">lchen15@gmu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi NCL Talk,<br>
<br>
Does anyone know how the “pseudo-random" numbers are generated in NCL random number functions (such as rand and generate_unique_indices)? It seems that these functions give the exactly same values every time when you re-run NCL…<br>
<br>
For instance, I am using NCL 6.4.0 on Yellowstone. I use generate_unique_indices twice to get two sets of random indices:<br>
<br>
ncl 0> print(generate_unique_indices(<wbr>10))<br>
(0)     5<br>
(1)     3<br>
(2)     0<br>
(3)     1<br>
(4)     8<br>
(5)     9<br>
(6)     4<br>
(7)     2<br>
(8)     6<br>
(9)     7<br>
ncl 1> print(generate_unique_indices(<wbr>10))<br>
(0)     5<br>
(1)     6<br>
(2)     8<br>
(3)     2<br>
(4)     7<br>
(5)     1<br>
(6)     3<br>
(7)     9<br>
(8)     4<br>
(9)     0<br>
<br>
If I exit and re-enter NCL, generate_unique_indices will give the exactly same two sets of indices as above.<br>
<br>
Thank you in advance!<br>
<br>
~Liang<br>
<br>
<br>
______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist,  </font></span><span><font color="#888888">Climate and Global Dynamics Laboratory, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a>   </font></span><span><font color="#888888">303-497-1726 </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>
</div>