Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29235 Discussions

Random number generation using ranlib

danielpollmann
Beginner
576 Views
Hi,

for an application, I am generating random variates from a standard exponential distribution using the function sexpo() included in the popular ranlib.f (e.g., http://people.sc.fsu.edu/~jburkardt/f77_src/ranlib/ranlib.html).

It works perfectly fine using the compiler version 11.1.072. However, if I use version 12.3.174 (with MKL included), the function returns very large integer values instead which are definitely not drawn from a standard exponential distribution. Unfortunately, I need to use the newer version because it has better support for allocatable arrays.

I was wondering whether anyone had come across either this or a similar problem, or has an idea what might go wrong in the newer version given its new features or any particularities of MKL.

Thanks!
0 Kudos
1 Reply
Steven_L_Intel1
Employee
576 Views
I wonder if you have declared the procedure properly in the caller. It should be returning reals, not integers. Since you have the source code, you should be able to step through it with the debugger and see what is going wrong.
0 Kudos
Reply