17 December 2012 11:54:17.414 AM RANDOM_TEST FORTRAN90 version. Examine the RANDOM_NUMBER routine for the generation or random numbers. TEST01: To generate 10 random real numbers, you could call RANDOM_NUMBER ( X )... 10 times, with a scalar X: 0.99755955 0.56682467 0.96591532 0.74792767 0.36739087 0.48063689 7.37542510E-02 5.35517931E-03 0.34708124 0.34224379 5 times with a vector X of length 2: 0.21795171 0.13316035 0.90052450 0.38676596 0.44548225 0.66193217 1.61082745E-02 0.65085483 0.64640880 0.32298726 or once with a 5 by 2 X array: 0.85569239 0.67298073 0.40128690 0.45688230 0.20687431 0.33001512 0.96853942 0.10038292 0.59839952 0.75545329 TEST02: To generate 10 random double precision numbers, you could call RANDOM_NUMBER ( X )... 10 times, with a scalar X: 0.60569326702015391 0.71904791350364250 0.89733460393255027 0.65822912051174221 0.15071683704682348 0.61231490490083462 0.97866023803328295 0.99914226951320195 0.25679798616059513 0.55086540321145805 5 times with a vector X of length 2: 0.65904751786274873 0.55400513534681350 0.97776009856916690 0.90192330445138325 0.65792468443233876 0.72885850819703213 0.40245526506178897 0.92862766317784851 0.14783519001184064 0.67452929904994652 or once with a 5 by 2 X array: 0.76961430926531416 0.94709465585466612 0.33932255231313635 0.73112865175616082 0.11581885497469879 0.49760390653578634 0.61436918440639476 0.37480174084278362 0.82061713953456328 0.42150585600131840 TEST03: The RANDOM_SEED routine can be used to restart the random number generator. We will repeat the previous test, and manipulate the seed so that we compute the same 10 numbers each time. The size of the seed array is N = 8 The current seed is 437395160 1404128605 572505362 -1187264075 454383258 525702629 973594203 1758310677 We're going to save this seed and reuse it. 10 times, with a scalar X: 0.99756 0.56682 0.96592 0.74793 0.36739 0.48064 0.07375 0.00536 0.34708 0.34224 The current seed is 442179288 1407667503 574668090 -1186150060 454842102 529765811 982703737 1758441867 We reset the seed to 437395160 1404128605 572505362 -1187264075 454383258 525702629 973594203 1758310677 five times with a vector X of length 2: 0.99756 0.56682 0.96592 0.74793 0.36739 0.48064 0.07375 0.00536 0.34708 0.34224 The current seed is 442179288 1407667503 574668090 -1186150060 454842102 529765811 982703737 1758441867 We reset the seed to 437395160 1404128605 572505362 -1187264075 454383258 525702629 973594203 1758310677 or once with a 5 by 2 X array: 0.99756 0.48064 0.56682 0.07375 0.96592 0.00536 0.74793 0.34708 0.36739 0.34224 The current seed is 442179288 1407667503 574668090 -1186150060 454842102 529765811 982703737 1758441867 RANDOM_TEST Normal end of execution. 17 December 2012 11:54:17.414 AM