About random number for particle dispersion
Posted: October 31st, 2017, 11:28 pm
Hi, everyone.
I'm looking through the code of concentration program.
I notice that there are two ways to generate the random number for particle dispersion:
1. If Krand=1, will use the pre-calculated random number array.
2. If Krand=2, will use the "parvar" subroutine inside the dispersion subroutine to generate the random number.
I find that if the user not specify the krand in the Namelist file, the program will use 2 when particle smaller than 5000, otherwise the first method.
I try both, finding that the result are very similar with a little different.
I just curious if both random number method's result are acceptable. Because I'm trying to parallelize the inner loop through the particles. And the first random number method (pre-calculated) is good for parallelization while the second one cannot preserve the same result as the original sequential program. So I try to only use the first random number method for my parallel version if that is acceptable.
Thank you.
I'm looking through the code of concentration program.
I notice that there are two ways to generate the random number for particle dispersion:
1. If Krand=1, will use the pre-calculated random number array.
2. If Krand=2, will use the "parvar" subroutine inside the dispersion subroutine to generate the random number.
I find that if the user not specify the krand in the Namelist file, the program will use 2 when particle smaller than 5000, otherwise the first method.
I try both, finding that the result are very similar with a little different.
I just curious if both random number method's result are acceptable. Because I'm trying to parallelize the inner loop through the particles. And the first random number method (pre-calculated) is good for parallelization while the second one cannot preserve the same result as the original sequential program. So I try to only use the first random number method for my parallel version if that is acceptable.
Thank you.