バッチ生成前に乱数シードだけを初期化する。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(app_config), | intent(in) | :: | cfg |
乱数シード値 |
||
| integer(kind=i32), | intent(in), | optional | :: | mpi_rank | ||
| integer(kind=i32), | intent(in), | optional | :: | mpi_size | ||
| type(mpi_context), | intent(in), | optional | :: | mpi |
subroutine seed_particles_from_config(cfg, mpi_rank, mpi_size, mpi) type(app_config), intent(in) :: cfg integer(i32), intent(in), optional :: mpi_rank, mpi_size type(mpi_context), intent(in), optional :: mpi integer(i32) :: local_rank, n_ranks, seed_value integer(kind=8) :: seed_tmp call resolve_parallel_rank_size(local_rank, n_ranks, mpi_rank, mpi_size, mpi, 'seed_particles_from_config') seed_tmp = int(cfg%sim%rng_seed, kind=8) + 104729_8*int(local_rank, kind=8) seed_value = int(modulo(seed_tmp, int(huge(0_i32), kind=8)), kind=i32) call seed_rng([seed_value]) end subroutine seed_particles_from_config