# RNG for MC simulations

**URL:** <https://fortran-lang.discourse.group/t/rng-for-mc-simulations/4964>\
**Category:** Help\
**Created:** [January 1, 2023, 2:28am UTC](https://fortran-lang.discourse.group/t/rng-for-mc-simulations/4964 "2023-01-01T02:28:02Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![CRquantum](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/crquantum/32/730_2.png) [@CRquantum](https://fortran-lang.discourse.group/u/CRquantum)\
**Post date:** [January 1, 2023, 7:54am UTC](https://fortran-lang.discourse.group/t/rng-for-mc-simulations/4964/2 "2023-01-01T07:54:17Z")

</div>

I personally do not use the default RNG for large scale simulations.  
There is a relevant post below,

> [@What random number generator is the best/fastest or do you use?](https://fortran-lang.discourse.group/t/what-random-number-generator-is-the-best-fastest-or-do-you-use/1848):
>
> Dear all, A quick question, based on your experience, which random number generator is the best? Could you also include the source code or github/gitlab repo? I mean combination of speed and robustness. It should be able to generator uniform and gaussian random number and array, to say the least. Thank you very much in advance!

I think the biggest issue is that it is not clear that, given the same seed, if the random numbers generated by the default RNG are repeatable. I mean, perhaps different gfortran versions and on different platform the default RNG may give different random numbers.  
Also gfortran and intel fortran are likely give different random numbers using their default RNG.  
So the same code will generate a little bit different results for gfortran and intel fortran.

The other thing is the period of the default RNG may not be long enough. But perhaps in many simulations this is not a problem.

If repeatable results and the length of the period of the RNG are not important to you, perhaps you could just the default RNG.

---

_[View the full topic](https://fortran-lang.discourse.group/t/rng-for-mc-simulations/4964)._
