- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have noticed that there is a difference between the random number generator function rand() on Fortran 90 compiler version 7.1 and 9.1. I really need to be consistent in a code I am running and so would be very grateful if you could point me in the direction of where to obtain the older random number generator.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't think you can use the 7.1 RAND with 9.1. If you have such a need, your best bet is to not use the compiler's generator and add source for a generator of your choice to your application.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your reply. However, I have all ready tried this. I saw that the old RAND uses the `Marsaglia' algorithm, whilst the new one uses the `Park and Miller' algorithm (this is only true on Linux; on Windows, all versions seem to use the `Park and Miller' algorithm). The problem I am having is finding source code for this algorithm, for my application to be consistent with older runs, I need to be able to generate exactly the same random number sequence as the older Marseglia algorithm. Therefore I need the exact source code of the old algorithm. I have looked at several random number functions (netlib, randlib, numerical recipes in C) but can't seem to find a match. The problem is that, unsurprisingly, Marseglia has written a few algorithms for the generation of random numbers, which makes finding the correct one difficult. My thoughts are that perhaps you may have source or know where to find source code for the old RAND?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually, after much searching on the web, I eventually found the source code for the old algorithm. At least, it gives me the same answer as the old algorithm. It is at:
http://www.cisl.ucar.edu/zine/96/spring/articles/3.random-6.html#2
Thanks anyway!
Paul
http://www.cisl.ucar.edu/zine/96/spring/articles/3.random-6.html#2
Thanks anyway!
Paul

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page