バッチ数と1バッチ粒子数から総粒子数を返す。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(app_config), | intent(in) | :: | cfg |
バッチ数と粒子種設定を含むアプリ設定。 |
integer(i32) function total_particles_from_config(cfg) result(total_n) type(app_config), intent(in) :: cfg integer(i64) :: total_n_i64 if (cfg%sim%batch_count <= 0_i32) then error stop 'sim.batch_count must be > 0.' end if total_n_i64 = int(cfg%sim%batch_count, i64)*int(particles_per_batch_from_config(cfg), i64) if (total_n_i64 > int(huge(0_i32), i64)) then error stop 'total particle count overflows 32-bit integer. Reduce batch_count or npcls_per_step.' end if total_n = int(total_n_i64, i32) end function total_particles_from_config