[ncl-talk] Questions about random number generators

Liang Chen lchen15 at gmu.edu
Mon Dec 4 14:37:16 MST 2017


Hi NCL Talk,

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…

For instance, I am using NCL 6.4.0 on Yellowstone. I use generate_unique_indices twice to get two sets of random indices:

ncl 0> print(generate_unique_indices(10))
(0)	5
(1)	3
(2)	0
(3)	1
(4)	8
(5)	9
(6)	4
(7)	2
(8)	6
(9)	7
ncl 1> print(generate_unique_indices(10))
(0)	5
(1)	6
(2)	8
(3)	2
(4)	7
(5)	1
(6)	3
(7)	9
(8)	4
(9)	0

If I exit and re-enter NCL, generate_unique_indices will give the exactly same two sets of indices as above.

Thank you in advance!

~Liang

 


More information about the ncl-talk mailing list