[MITgcm-devel] portable random number generator
Ed Hill
ed at eh3.com
Sun Jul 18 18:50:35 EDT 2004
On Sun, 2004-07-18 at 16:48, Andrea Molod wrote:
> hi all,
>
> i would like to make a (slight) change in the portable number generator,
> port_rand, that is in model/src. i would like to add an argument to the
> call which would set the seed for the random number generator (at the
> start of each run). without this, reproducibility of the random numbers
> between runs with pickups at different times is not possible.
>
> i see that port_rand is used in the flt package and appears in ini_theta
> for the held-suarez verification experiments, but is not active. so i will
> change the code in both of those places to add an argument to the port_rand
> call, and will change port_rand to assign the seed from the dummy argument.
>
> NOTE: the change to the flt package code will duplicate the current behavior
> and re-set the seed to the same value it has now for the start of each run.
> to make a run reproducible with flt the choice of seed in that code should
> be revisited (ie, set it from myiter, or something like that).
>
> any objections/comments? speak up soon!
Hi Andrea,
Would it make sense to add full check-pointing so that both the
"identical initial conditions" and the "pickup" cases can be handled
gracefully? And perhaps we could make it a new package named "random"?
Of course, by making these suggestions I'm also volunteering to help
write it. :-)
One of the best (fast, well-documented, etc.) publicly available
pseudo-random-number generators (the "Mersenne Twister") has Fortran
versions:
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/VERSIONS/FORTRAN/fortran.html
http://www.math.sci.hiroshima-u.ac.jp/%7Em-mat/MT/emt.html
and one of those implementations has the ability to save and re-load the
state of the generator for check-pointing and restarts. So it can be
done and it doesn't look too difficult.
Ed
--
Edward H. Hill III, PhD
office: MIT Dept. of EAPS; Rm 54-1424; 77 Massachusetts Ave.
Cambridge, MA 02139-4307
emails: eh3 at mit.edu ed at eh3.com
URLs: http://web.mit.edu/eh3/ http://eh3.com/
phone: 617-253-0098
fax: 617-253-4464
More information about the MITgcm-devel
mailing list