read_particle_species_array Subroutine

public subroutine read_particle_species_array(cfg, table, key, authoring)

[[particles.species]] の配列テーブルを読み込む。

Arguments

Type IntentOptional Attributes Name
type(app_config), intent(inout) :: cfg
type(toml_table), intent(inout) :: table
type(toml_key), intent(in) :: key
type(app_config_authoring), intent(inout) :: authoring

Calls

proc~~read_particle_species_array~~CallsGraph proc~read_particle_species_array read_particle_species_array get_value get_value proc~read_particle_species_array->get_value proc~apply_particles_species_toml_table apply_particles_species_toml_table proc~read_particle_species_array->proc~apply_particles_species_toml_table proc~ensure_authoring_particle_capacity ensure_authoring_particle_capacity proc~read_particle_species_array->proc~ensure_authoring_particle_capacity proc~ensure_particle_species_capacity ensure_particle_species_capacity proc~read_particle_species_array->proc~ensure_particle_species_capacity proc~require_toml_success require_toml_success proc~read_particle_species_array->proc~require_toml_success proc~species_from_defaults species_from_defaults proc~read_particle_species_array->proc~species_from_defaults toml_len toml_len proc~read_particle_species_array->toml_len get_keys get_keys proc~apply_particles_species_toml_table->get_keys proc~get_toml_int get_toml_int proc~apply_particles_species_toml_table->proc~get_toml_int proc~get_toml_logical get_toml_logical proc~apply_particles_species_toml_table->proc~get_toml_logical proc~get_toml_real get_toml_real proc~apply_particles_species_toml_table->proc~get_toml_real proc~get_toml_real2 get_toml_real2 proc~apply_particles_species_toml_table->proc~get_toml_real2 proc~get_toml_real3 get_toml_real3 proc~apply_particles_species_toml_table->proc~get_toml_real3 proc~get_toml_string get_toml_string proc~apply_particles_species_toml_table->proc~get_toml_string proc~lower_ascii lower_ascii proc~apply_particles_species_toml_table->proc~lower_ascii proc~get_toml_int->get_value proc~get_toml_int->proc~require_toml_success proc~get_toml_logical->get_value proc~get_toml_logical->proc~require_toml_success proc~get_toml_real->get_value proc~get_toml_real->proc~require_toml_success proc~get_toml_real2->get_value proc~get_toml_real2->proc~require_toml_success proc~get_toml_real2->toml_len proc~get_toml_real3->get_value proc~get_toml_real3->proc~require_toml_success proc~get_toml_real3->toml_len proc~get_toml_string->get_value proc~get_toml_string->proc~require_toml_success

Called by

proc~~read_particle_species_array~~CalledByGraph proc~read_particle_species_array read_particle_species_array proc~apply_particles_toml_table apply_particles_toml_table proc~apply_particles_toml_table->proc~read_particle_species_array proc~apply_toml_document apply_toml_document proc~apply_toml_document->proc~apply_particles_toml_table proc~load_toml_config load_toml_config proc~load_toml_config->proc~apply_toml_document proc~load_app_config load_app_config proc~load_app_config->proc~load_toml_config proc~load_or_init_run_state load_or_init_run_state proc~load_or_init_run_state->proc~load_app_config program~main main program~main->proc~load_or_init_run_state

Source Code

  subroutine read_particle_species_array(cfg, table, key, authoring)
    type(app_config), intent(inout) :: cfg
    type(toml_table), intent(inout) :: table
    type(toml_key), intent(in) :: key
    type(app_config_authoring), intent(inout) :: authoring
    type(toml_array), pointer :: array
    type(toml_table), pointer :: child
    integer :: ispec, n, stat

    nullify (array)
    call get_value(table, key, array, stat=stat)
    call require_toml_success(stat, 'particles.species')
    if (.not. associated(array)) error stop 'particles.species must be an array of tables.'

    n = toml_len(array)
    call ensure_particle_species_capacity(cfg, n)
    call ensure_authoring_particle_capacity(authoring, n)
    if (n > 0) cfg%particle_species(1:n) = particle_species_spec()
    if (n > 0) authoring%particle_species(1:n) = particle_authoring_spec()
    do ispec = 1, n
      nullify (child)
      call get_value(array, ispec, child, stat=stat)
      call require_toml_success(stat, 'particles.species entry')
      if (.not. associated(child)) error stop 'particles.species entries must be tables.'
      cfg%particle_species(ispec) = species_from_defaults()
      cfg%particle_species(ispec)%enabled = .true.
      call apply_particles_species_toml_table(cfg%particle_species(ispec), child, authoring%particle_species(ispec))
    end do
    cfg%n_particle_species = int(n, i32)
  end subroutine read_particle_species_array