20 January 2025 8:06:28.236 AM f90_random_test(): FORTRAN90 version. Test random_number(), which generates random values. TEST01: To generate 10 random real numbers, you could call RANDOM_NUMBER ( X )... 10 times, with a scalar X: 0.101196587 6.02713823E-02 0.573756397 0.736556947 0.570928395 0.308043718 0.696581721 0.179677844 0.991941214 9.38692093E-02 5 times with a vector X of length 2: 0.417313159 0.302327693 0.752135873 0.928592920 1.69954896E-02 4.70475554E-02 0.568311572 0.492198527 0.902329266 0.453940153 or once with a 5 by 2 X array: 8.23444128E-02 0.407506168 0.228208899 0.219295144 0.200380564 0.543072999 0.797026455 0.998483062 0.789438903 0.958337903 TEST02: To generate 10 random double precision numbers, you could call RANDOM_NUMBER ( X )... 10 times, with a scalar X: 0.11399960774786722 0.25743824484489053 5.8454506211288670E-002 0.99347828831589990 0.53645883031510000 3.9801386149249662E-002 0.18366853879002976 7.9510839265008126E-002 0.17836346083212906 0.54598144971925289 5 times with a vector X of length 2: 0.18410205442589167 0.69399307637311924 0.42373353443746320 0.21394359786753725 0.29594829978304693 0.33238332626324152 0.26188079279786802 0.78374153284593784 0.83296196637841913 5.3256232259890735E-002 or once with a 5 by 2 X array: 0.32331012016897631 0.61000218292715502 0.84573457025753052 0.76118381779059341 0.60837328258901846 0.44746188880209103 0.17722711226026344 0.71921204127737748 0.67235076303181707 0.99209213578764421 TEST03: To generate 10 random complex numbers, you must request real and imaginary parts separately. You could call RANDOM_NUMBER ( X )... 10 times, with a scalar X: (0.805608571,0.240125000) (0.544888794,0.519294620) (0.698628664,0.895503163) (0.559576094,0.744009137) (0.490356088,0.207982302) (0.999224663,0.633357108) (0.484846532,0.429028869) (0.602619886,0.862307012) (2.356016636E-02,0.915908396) (0.813972116,0.332107127) 5 times with a vector X of length 2: (0.208980322,0.653072655) (0.777666867,0.624647856) (0.205760300,1.184475422E-02) (9.761869907E-03,0.663907349) (0.680882037,0.704264462) (0.789790511,0.600668907) (0.915562093,0.893044710) (0.926269114,7.746767998E-02) (0.278014302,0.804028451) (0.834846854,0.391602218) or once with a 5 by 2 X array: (0.912285388,0.443448603) (0.424581885,0.761752844) (0.507659078,0.634912550) (0.904581606,0.176366270) (0.855082452,0.390271842) (0.957265198,0.498275697) (0.441894531,0.373654068) (8.934271336E-02,0.987893164) (3.522098064E-03,0.294416249) (0.597329319,0.238078415) TEST05: 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 643595354 -937280356 1643569775 1612567692 -1468356227 1587931426 -1168113908 -159888606 We're going to save this seed and reuse it. 10 times, with a scalar X: 0.35406 0.66102 0.81257 0.41596 0.78326 0.05568 0.99887 0.42166 0.89818 0.90473 The current seed is -1751354599 482260381 479645858 932620628 1430373207 -919112664 -624504016 -549112948 We reset the seed to 643595354 -937280356 1643569775 1612567692 -1468356227 1587931426 -1168113908 -159888606 five times with a vector X of length 2: 0.35406 0.66102 0.81257 0.41596 0.78326 0.05568 0.99887 0.42166 0.89818 0.90473 The current seed is -1751354599 482260381 479645858 932620628 1430373207 -919112664 -624504016 -549112948 We reset the seed to 643595354 -937280356 1643569775 1612567692 -1468356227 1587931426 -1168113908 -159888606 or once with a 5 by 2 X array: 0.35406 0.05568 0.66102 0.99887 0.81257 0.42166 0.41596 0.89818 0.78326 0.90473 The current seed is -1751354599 482260381 479645858 932620628 1430373207 -919112664 -624504016 -549112948 f90_random_test(): Normal end of execution. 20 January 2025 8:06:28.236 AM