Re: Random Numbers
- From: Ken Fairfield <my.full.name@xxxxxxxxx>
- Date: Thu, 29 Jun 2006 12:33:05 -0700
On 6/29/2006 12:19 PM, Pierre Asselin wrote:
Steven G. Kargl <kargl@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
[ wants random numbers reproducible from run to run ]
OTOH, I do use code of the form
call random_seed(size=n)
allocate(put(n))
put = nrand + 37 * (/ (i - 1, i = 1, n) /) ! nrand is user input.
call random_seed(put=put)
deallocate(put)
Does the standard specify what you can or cannot pass to
random_seed(put=) ? I mean the content, not just the size. I was
bitten once by an implementation that was very picky about the
contents of its seed vectors. I did as you show, asking random_seed()
for the size and filling the array with some sequence salted by a
small user input. The resulting sequence was anything but random !
My reading of the vendor docs for my compiler (presumably echoing
the standard), is that the input to random_seed with the "put" option
is a rank-1 array of default integer (as is the output with the "get"
option). Long experience with various PRNGs would suggest *large* *odd*
values are best as seeds. Small integers are very poor choices. I am
not the least bit surprised by your result if that was your choice...
-Ken
--
I don't speak for Intel, Intel doesn't speak for me...
Ken Fairfield
D1C Automation VMS System Support
who: kenneth dot h dot fairfield
where: intel dot com
.
- References:
- Random Numbers
- From: CTallant
- Re: Random Numbers
- From: dpb
- Re: Random Numbers
- From: Richard E Maine
- Re: Random Numbers
- From: Steven G. Kargl
- Re: Random Numbers
- From: Pierre Asselin
- Random Numbers
- Prev by Date: Re: Random Numbers
- Next by Date: Re: How to Find Memory Used (IVF 9.1, WinXP)
- Previous by thread: Re: Random Numbers
- Next by thread: Re: Random Numbers
- Index(es):
Relevant Pages
|