Hi,
The old random number function rand() always gives the same
number under all the intel fortran compilers I tested
(7.1, 8.0, 8.1). See the simple test code below.
Is this a known ifc bug? Thanks.
Xiaogang
====================
c compiled with
c ifort test.f -Vaxlib
program main
implicit double precision (a-h,o-z)
dimension a(4)
write(*,*)'Strange : random numbers are the same'
iseed=11
call srand(iseed)
do i=1,4
a(i)=rand()
c if the following line is added, it works again.
c write(*,*)a(i)
end do
write(*,'(f15.10)')a(1:4)
end
===========
Output:
Strange : random numbers are the same
0.0002472573
0.0002472573
0.0002472573
0.0002472573
--
------------------------------------------------
Dr Xiaogang Wang
Departement de chimie
Universite de Montreal
C.P. 6128, succursale Centre-ville
Montreal (Quebec) H3C 3J7
Tel. (514) 3436111 ext 3947 (office)
FAX (514) 3437586 (office)
e-mail: [log in to unmask]
homepage: http://www.esi.umontreal.ca/~wangx
------------------------------------------------
|