Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change random number generator to RANLUX from MT19937
1) Default behaviour of SIMC is still to use the same starting random seed for every time SIMC is run. 2) In input file one can set the random seed with parameter 'random_seed' i) random_seed= -1 then in dbase.f the random_seed will be set to time() which is standard gfortran function which returns an integer representing the current time. ii) random_seed= any positive integer value to be seed 3) In input file one can set parameter "random_state_file" i) This is a file with the 24 member integer array that will be used to start the random sequence Changes: 1) Deleted mt19937.f 2) Add code ranlux.f which calls functions in the CERNLIB RANLUX library. 3) changed Makefile a) use ranlux.f instead of mt19937.f b) add jetset74 to CERNLIBS which has RANLUX library 4) Add documents/ranlux.pdf for RANLUX write-up 5) ranlux.f has subroutines: a) subroutine sgrnd(seed) i) call RLUXGO to initialize at highest level=3 ii) if seed=0 then uses default seed INT=314159265 b) function grnd() i) every 1000 grnd() calls in simc it executes call RANLUX(RVEC,LEN) ii) RVEC is real*4 array of 1000 dimensions with random numbers from 0 to 1 not including the endpoints excluded. c) subroutine save_random_state(fname) i) called in simc.f ii) call RLUXUT(IVEC), IVEC is 24 dimension integer sequence iii) saves a integer sequence to a file called: "outfiles/sname_start_random_state.dat" where sname is the input file name d) subroutine start_file_random_state(fname) i) called in simc.f ii) reads 24 integers in the file random_state_file which is set in the input file ii)call RLUXIN(IVEC) which initiates the random number sequence 6) simc.f a) eliminate calls restorerndstate and saverndstate b) If random_state_file is not set in input file then call sgrnd(random_seed) c) If random_state_file is set in input file then call start_file_random_state(random_state_file) d) always call save_random_state(start_random_state_file) 7) dbase.f a) always set start_random_state_file to "outfiles/sname_start_random_state.dat" where sname is the input file name b) if in input file the random_seed parameter .eq. -1 then random_seed=time() 8) simulate.inc a) add start_random_state_file to common /gnrl/
- Loading branch information