[[particles.species]] の配列テーブルを読み込む。
| Type | Intent | Optional | 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 |
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