total_particles_from_config Function

public function total_particles_from_config(cfg) result(total_n)

バッチ数と1バッチ粒子数から総粒子数を返す。

Arguments

Type IntentOptional Attributes Name
type(app_config), intent(in) :: cfg

バッチ数と粒子種設定を含むアプリ設定。

Return Value integer(kind=i32)


Calls

proc~~total_particles_from_config~~CallsGraph proc~total_particles_from_config total_particles_from_config proc~particles_per_batch_from_config particles_per_batch_from_config proc~total_particles_from_config->proc~particles_per_batch_from_config

Called by

proc~~total_particles_from_config~~CalledByGraph proc~total_particles_from_config total_particles_from_config proc~init_particles_from_config init_particles_from_config proc~init_particles_from_config->proc~total_particles_from_config

Source Code

  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