On Fri, Jan 17, 2020 at 2:56 PM وليد خلف معوض المطيرى <wkmtie...@qu.edu.sa> wrote: > This might be because the RNG method used in random_number function is > different between the used version GCC 6 or less and the new ones GCC 8 or > greater.
This is quite likely correct. The current gfortran docs  list xoshiro256** as the RNG used for RANDOM_NUMBER. This is a relatively recent RNG , so older versions of gfortran must have used something else, leading to different results even for identical seed values. This explains the WRE excerpt quoted by Ivan: If you want reproducible results, you must not use an external RNG which might change without warning. The obvious solution would be to use R's RNG as suggested before. If that is to slow for your application, you can use faster RNGs that are provided by some packages. For example, my dqrng package  includes xoshiro256+, though I have not tried to use this from Fortran code. Greetings Ralf  https://gcc.gnu.org/onlinedocs/gfortran/RANDOM_005fNUMBER.html  https://arxiv.org/abs/1805.01407  https://www.daqana.org/dqrng/ ______________________________________________ Remail@example.com mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel