mus_particle_prob_module contains some helper routines for creating randomly distributed initial positions of particles. These routines were taken from William Cody's code with reference:
William Cody, Rational Chebyshev approximations for the error function, Mathematics of Computation, 1969, pages 631-637.
William Cody, Algorithm 715: SPECFUN - A Portable FORTRAN Package of Special Function Routines and Test Drivers, ACM Transactions on Mathematical Software, Volume 19, Number 1, 1993, pages 22-32.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=rk), | public | :: | mu | ||||
| real(kind=rk), | public | :: | sigma |
This function evaluates the normal distribution function:
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=rk), | intent(in) | :: | x |
Input: argument x to compute P(X <= x) |
||
| real(kind=rk), | intent(in) | :: | mu |
Input: mean of the gaussian |
||
| real(kind=rk), | intent(in) | :: | sigma |
Input: standard deviation (sqrt of variance) |
||
| real(kind=rk), | intent(out) | :: | cum |
Output: P(X <= x) |
||
| real(kind=rk), | intent(out) | :: | ccum |
************80
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=rk) | :: | arg | ||||
| real(kind=rk) | :: | cum | ||||
| real(kind=rk) | :: | ccum |
Swap two reals of kind rk
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=rk), | intent(inout) | :: | left | |||
| real(kind=rk), | intent(inout) | :: | right |