11 March 2010 11:23:55.489 PM RANDLC_PRB FORTRAN90 version: Test the routines in the RANDLC library. TEST01 RANDLC computes pseudorandom values in the interval [0,1]. The initial seed is 123456789. I RANDLC 1 0.633901 2 0.557158 3 0.503282 4 0.586596 5 0.884073 6 0.165209 7 0.806692 8 0.701847 9 0.516941 10 0.610290 TEST02 RANDLC computes a sequence of uniformly distributed pseudorandom numbers. Initial SEED = 123456789. First 10 values: I Input Output RANDLC SEED SEED 1 123456789. 44606850387001. 0.633901 2 44606850387001. 39206478837805. 0.557158 3 39206478837805. 35415334725937. 0.503282 4 35415334725937. 41277992533125. 0.586596 5 41277992533125. 62211098720361. 0.884073 6 62211098720361. 11625570795549. 0.165209 7 11625570795549. 56765914126305. 0.806692 8 56765914126305. 49388124469493. 0.701847 9 49388124469493. 36376488146329. 0.516941 10 36376488146329. 42945314893069. 0.610290 Now call RANDLC 1000 times. Average value = 0.499192 Expecting 0.500000 Variance = 0.858645E-01 Expecting 0.833333E-01 TEST03 RANDLC computes a sequence of pseudorandom numbers but all computations depend on the seed value. In this test, we show how a sequence of "random" values can be manipulated by accessing the seed. Set SEED to 1066. Now call RANDLC 10 times, and watch SEED. I Input Output RANDLC SEED SEED 1 1066. 1301269531250. 0.018492 2 1301269531250. 3119242644058. 0.044327 3 3119242644058. 29495326667874. 0.419154 4 29495326667874. 1664784089866. 0.023658 5 1664784089866. 30345277309650. 0.431232 6 30345277309650. 23978980768314. 0.340762 7 23978980768314. 48407130943938. 0.687907 8 48407130943938. 37388733848554. 0.531326 9 37388733848554. 31057455701298. 0.441353 10 31057455701298. 6439705293850. 0.091514 Reset SEED to its value at step 5, = 1664784089866. Now call RANDLC 10 times, and watch how SEED and RANDLC restart themselves. I Input Output RANDLC SEED SEED 1 1664784089866. 30345277309650. 0.431232 2 30345277309650. 23978980768314. 0.340762 3 23978980768314. 48407130943938. 0.687907 4 48407130943938. 37388733848554. 0.531326 5 37388733848554. 31057455701298. 0.441353 6 31057455701298. 6439705293850. 0.091514 7 6439705293850. 36319925141794. 0.516137 8 36319925141794. 62762105269962. 0.891903 9 62762105269962. 9521428314514. 0.135308 10 9521428314514. 15493591472122. 0.220177 What happens with an initial zero SEED? I Input Output RANDLC SEED SEED 1 0. 55909509111989. 0.794522 2 55909509111989. 61155031930969. 0.869065 3 61155031930969. 45573031421645. 0.647632 4 45573031421645. 55279057169489. 0.785563 5 55279057169489. 1250169187877. 0.017766 6 1250169187877. 27551538756233. 0.391531 7 27551538756233. 56099529399485. 0.797222 8 56099529399485. 28525870915841. 0.405377 9 28525870915841. 35461206354069. 0.503934 10 35461206354069. 34383163428281. 0.488614 What happens with an initial negative SEED? I Input Output RANDLC SEED SEED 1 -123456789. 44606850387001. 0.633901 2 44606850387001. 39206478837805. 0.557158 3 39206478837805. 35415334725937. 0.503282 4 35415334725937. 41277992533125. 0.586596 5 41277992533125. 62211098720361. 0.884073 6 62211098720361. 11625570795549. 0.165209 7 11625570795549. 56765914126305. 0.806692 8 56765914126305. 49388124469493. 0.701847 9 49388124469493. 36376488146329. 0.516941 10 36376488146329. 42945314893069. 0.610290 RANDLC_TEST04 RANDLC_JUMP jumps directly to the K-th value returned by RANDLC. K X(hard way) X(jump) 1 0.633901 0.633901 2 0.557158 0.557158 4 0.586596 0.586596 8 0.701847 0.701847 16 0.702661 0.702661 32 0.030668 0.030668 64 0.033047 0.033047 128 0.513648 0.513648 256 0.094226 0.094226 512 0.015067 0.015067 RANDLC_PRB Normal end of execution. 11 March 2010 11:23:55.490 PM