Re: Random number generator

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Fri May 31 2013 - 12:24:53 MDT

Hi Longtao,
You need to set random_setallseed if you want to have different values
generated. See the random_uniform page here:
http://www.ncl.ucar.edu/Document/Functions/Built-in/random_uniform.shtml
and the random_setallseed page here:
http://www.ncl.ucar.edu/Document/Functions/Built-in/random_setallseed.shtml
Hope that helps. If you have further questions please reply to ncl-talk.
Adam

On 05/31/2013 12:10 PM, WuLongtao wrote:
> Hello,
>
> I am trying to use 'random_uniform' function to generate some random
> numbers. I write a simple test program
>
> =====================
> begin
>
> test =random_uniform(-1,1,5)
>
> end
> =====================
>
> However, the code will generate the same numbers every time. How can I
> get different random numbers for each run?
>
> Thanks,
>
> -Longtao
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
______________________________________________________________
Adam Phillips                                asphilli@ucar.edu
NCAR/Climate and Global Dynamics Division       (303) 497-1726
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/cas/asphilli

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri May 31 12:24:59 2013

This archive was generated by hypermail 2.1.8 : Tue Jun 04 2013 - 09:50:17 MDT