[Dart-dev] [5612] DART/branches/development/random_seq/random_seq_mod.f90: give lastg an initial value so it doesn't just have random mem junk.

nancy at ucar.edu nancy at ucar.edu
Wed Mar 21 09:56:25 MDT 2012


Revision: 5612
Author:   nancy
Date:     2012-03-21 09:56:24 -0600 (Wed, 21 Mar 2012)
Log Message:
-----------
give lastg an initial value so it doesn't just have random mem junk.
it is never used before set, but this is just cleaner.  also i looked
up the range of the random numbers for uniform.  it's [0,1) so i changed
the comments to say so.  no real functional changes in this checkin.

Modified Paths:
--------------
    DART/branches/development/random_seq/random_seq_mod.f90

-------------- next part --------------
Modified: DART/branches/development/random_seq/random_seq_mod.f90
===================================================================
--- DART/branches/development/random_seq/random_seq_mod.f90	2012-03-19 16:38:52 UTC (rev 5611)
+++ DART/branches/development/random_seq/random_seq_mod.f90	2012-03-21 15:56:24 UTC (rev 5612)
@@ -207,6 +207,7 @@
 end do
 
 s%mti = N
+s%lastg = 0.0_r8
 s%gset = .false.
 
 end subroutine init_ran
@@ -294,9 +295,8 @@
 s%mti = s%mti + 1
 
 ! at this point we have an integer value for k
-! this routine wants a real between 0 and 1.0, 
-! so divide here.  i do not know if the expected
-! range is [0,1) (0,1] (0,1) or [0,1].  will search docs.
+! this routine returns 0.0 <= real < 1.0, so do
+! the divide here.  return range:  [0,1).
 
 ran_unif = real(real(k, digits12) / 4294967296.0_digits12, r8)
 


More information about the Dart-dev mailing list