fengyanshi / FUNWAVE-TVD

45 stars 51 forks source link

Adding Fortran standard compliant random number generator #9

Closed floquet closed 6 years ago

floquet commented 8 years ago

Want to provide an example of a standard compliant random number generator.

malej commented 8 years ago

@fengyanshi ... Dan Topa is going to add some features on his forked repository. Later on we can discuss these and see if we want to merge (via pull request as I was doing so far). He forked FUNWAVE-TVD into his account @floquet. I've encouraged his to get on our repo and start communicating. We will eventually setup Wiki on this repo (see above) and set Milestone tables and be able to assign tasks to team members.

floquet commented 8 years ago

random_number_tester.tar.gz (opens in a folder named beta)

Fortran standards-compliant module for random numbers. Includes make file and sample screen session. The file random_number_tester.f08 demonstrates basic features.

  1. Allows for random number seeds to be stored which provides the capability to make full precision comparisons between code versions, compiler versions, and machine versions.
  2. Allows for control of random number seeds across multiple processes.
  3. Problem: when the difference between seeds is small, the differences between random numbers is small. Solution: swap byte order. For example, the wall time varies slowly. The byte flipped version of the time changes dramatically.
  4. Unix systems offer a random number seed through dev/random. This package allows access to that feature.
  5. Trapped errors like allocation failures feature a message which identifies the module and subroutine where the error occurred.
  6. There is a routine which provides random integers \in [1, UpperBound].

compiler version: GCC version 7.0.0 20161030 (experimental) compiler options: -fPIC -feliminate-unused-debug-symbols -mmacosx-version-min=10.12.1 -mtune=core2 -auxbase-strip random_number_tester.o -g -Og -Wall -Waliasing -Wconversion-extra -Wextra -Wsurprising -Wimplicit-procedure -Wintrinsics-std -Wuse-without-only -Wpedantic -fcheck=bounds -fmax-errors=5 -ffpe-trap=denormal -fbacktrace

fengyanshi commented 7 years ago

@malej I think it's a good idea to let Dan to do the work in his folk. thanks