
                           ifc-random-seed
                          -----------------

$Id$

0. NOTE:

  This is most probably _not_ a bug, just surprising behaviour.


1. Symptoms:

  The attached file seed.f90 prints the random number generator's seed,
  which should be nontrivial. But initially there are only zeros,which are
  replaced by other numbers only as random_number() is producing numbers:

   ---------------------------------------------
   Seed = 
             0           0           0           0           0           0
             0           0           0           0           0           0
             0           0           0           0           0           0
             0           0           0           0           0           0
             0           0           0           0           0           0
             0           0           0           0           0           0
             0           0           0           0           0           0
             0           0           0           0           0
   ---------------------------------------------
   X =   0.7732671      0.8232512      0.1481206      0.6567149    
   ---------------------------------------------
   Seed = 
             0           0           0           0           0           0
             0           0           0           0           0           0
             0           0           0           0           0           0
             0           0           0           0           0           0
             0           0           0           0           0           0
             0           0           0           0           0           0
             0           0           0 -1334651909  -774030393  1299365796
    2082507851          -4          -4           1 -1449744276
   ---------------------------------------------
   X =   0.8420556      0.6285801      0.3304787      0.7688151    
   ---------------------------------------------
   Seed = 
             0           0           0           0           0           0
             0           0           0           0           0           0
             0           0           0           0           0           0
             0           0           0           0           0           0
             0           0           0           0           0           0
             0           0           0           0           0  2000795129
    -338859605  1234459146  1665195641 -1334651909  -774030393  1299365796
    2082507851          -8          -8           1  1395478744
   ---------------------------------------------

   Notes:
   (a) What is disturbing here are the zeros where practically all other
       random number generators would give some "radnom" integers
   (b) The shifting in of non-zero values shows that the random number
       generator does apparently _not_ use the full seed vector as entropy
       pool, i.e. if you change seed(1), you'll probably get the same first
       46 numbers (not tried, though).
       ifc 7.0 does the same -- apart from the values (which are non-zero).

2. Command sequence:

  unix>  make FC=ifc test
or
  fe4>  make FC=ifort80 NLSPATH=/usr/local/lib/intel/intel_fc_80/lib/ifcore_msg.cat test
(or similar)

3. Platforms:
   32-bit:

   Gentoo, Kernel 2.4.24, Intel Xeon, 2.4GHz
       ifc 7.1   Build 20040713Z

4. Other compilers tested (OK means problem could not be reproduced):
   - Intel ifc 6.0                 (x86 Linux)  OK
   - Intel ifc 7.0 Build 20021028Z (x8 Linux)   OK
   - Intel ifort 8.0 Build 20040616Z Package ID: l_fc_pc_8.0.046_pe049.1
                                                OK

5. Workaround:
   - Call random_number to produce at least 47 random numbers before
     working with seed
   - Don't multiply seed with processor number, replace it or add it

6. Comment:
   I am not sure this is a real bug; but it is definitively annoying.
   Doesn't seem to be a problem for the Pencil Code as far as I see.

7. Original date:

   Wed 26 Aug 2004

