apply_toml_document Subroutine

public subroutine apply_toml_document(cfg, document, authoring)

toml-f のルートテーブルから既知セクションを読み込む。

Arguments

Type IntentOptional Attributes Name
type(app_config), intent(inout) :: cfg
type(toml_table), intent(inout) :: document
type(app_config_authoring), intent(inout) :: authoring

Calls

proc~~apply_toml_document~~CallsGraph proc~apply_toml_document apply_toml_document get_keys get_keys proc~apply_toml_document->get_keys get_value get_value proc~apply_toml_document->get_value proc~apply_mesh_toml_table apply_mesh_toml_table proc~apply_toml_document->proc~apply_mesh_toml_table proc~apply_output_toml_table apply_output_toml_table proc~apply_toml_document->proc~apply_output_toml_table proc~apply_particles_toml_table apply_particles_toml_table proc~apply_toml_document->proc~apply_particles_toml_table proc~apply_sim_toml_table apply_sim_toml_table proc~apply_toml_document->proc~apply_sim_toml_table proc~lower_ascii lower_ascii proc~apply_toml_document->proc~lower_ascii proc~require_toml_success require_toml_success proc~apply_toml_document->proc~require_toml_success proc~apply_mesh_toml_table->get_keys proc~apply_mesh_toml_table->proc~lower_ascii proc~get_toml_real get_toml_real proc~apply_mesh_toml_table->proc~get_toml_real proc~get_toml_real3 get_toml_real3 proc~apply_mesh_toml_table->proc~get_toml_real3 proc~get_toml_string get_toml_string proc~apply_mesh_toml_table->proc~get_toml_string proc~read_mesh_groups_table read_mesh_groups_table proc~apply_mesh_toml_table->proc~read_mesh_groups_table proc~read_template_array read_template_array proc~apply_mesh_toml_table->proc~read_template_array proc~apply_output_toml_table->get_keys proc~apply_output_toml_table->proc~lower_ascii proc~get_toml_int get_toml_int proc~apply_output_toml_table->proc~get_toml_int proc~get_toml_logical get_toml_logical proc~apply_output_toml_table->proc~get_toml_logical proc~apply_output_toml_table->proc~get_toml_string proc~apply_particles_toml_table->get_keys proc~apply_particles_toml_table->proc~lower_ascii proc~read_particle_species_array read_particle_species_array proc~apply_particles_toml_table->proc~read_particle_species_array proc~apply_sim_toml_table->get_keys proc~apply_sim_toml_table->proc~lower_ascii proc~get_toml_boundary_mode get_toml_boundary_mode proc~apply_sim_toml_table->proc~get_toml_boundary_mode proc~apply_sim_toml_table->proc~get_toml_int proc~apply_sim_toml_table->proc~get_toml_logical proc~apply_sim_toml_table->proc~get_toml_real proc~apply_sim_toml_table->proc~get_toml_real3 proc~apply_sim_toml_table->proc~get_toml_string proc~get_toml_boundary_mode->proc~lower_ascii proc~get_toml_boundary_mode->proc~get_toml_string 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_real3->get_value proc~get_toml_real3->proc~require_toml_success toml_len toml_len proc~get_toml_real3->toml_len proc~get_toml_string->get_value proc~get_toml_string->proc~require_toml_success proc~read_mesh_groups_table->get_keys proc~read_mesh_groups_table->get_value proc~read_mesh_groups_table->proc~require_toml_success proc~apply_mesh_group_toml_table apply_mesh_group_toml_table proc~read_mesh_groups_table->proc~apply_mesh_group_toml_table proc~ensure_authoring_group_capacity ensure_authoring_group_capacity proc~read_mesh_groups_table->proc~ensure_authoring_group_capacity proc~read_particle_species_array->get_value proc~read_particle_species_array->proc~require_toml_success 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~species_from_defaults species_from_defaults proc~read_particle_species_array->proc~species_from_defaults proc~read_particle_species_array->toml_len proc~read_template_array->get_value proc~read_template_array->proc~require_toml_success proc~apply_template_toml_table apply_template_toml_table proc~read_template_array->proc~apply_template_toml_table proc~ensure_authoring_template_capacity ensure_authoring_template_capacity proc~read_template_array->proc~ensure_authoring_template_capacity proc~ensure_template_capacity ensure_template_capacity proc~read_template_array->proc~ensure_template_capacity proc~read_template_array->toml_len proc~apply_mesh_group_toml_table->get_keys proc~apply_mesh_group_toml_table->proc~lower_ascii proc~apply_mesh_group_toml_table->proc~get_toml_real proc~apply_mesh_group_toml_table->proc~get_toml_real3 proc~apply_mesh_group_toml_table->proc~get_toml_string proc~apply_particles_species_toml_table->get_keys proc~apply_particles_species_toml_table->proc~lower_ascii proc~apply_particles_species_toml_table->proc~get_toml_int proc~apply_particles_species_toml_table->proc~get_toml_logical proc~apply_particles_species_toml_table->proc~get_toml_real proc~apply_particles_species_toml_table->proc~get_toml_real3 proc~apply_particles_species_toml_table->proc~get_toml_string proc~get_toml_real2 get_toml_real2 proc~apply_particles_species_toml_table->proc~get_toml_real2 proc~apply_template_toml_table->get_keys proc~apply_template_toml_table->proc~lower_ascii proc~apply_template_toml_table->proc~get_toml_int proc~apply_template_toml_table->proc~get_toml_logical proc~apply_template_toml_table->proc~get_toml_real proc~apply_template_toml_table->proc~get_toml_real3 proc~apply_template_toml_table->proc~get_toml_string proc~get_toml_real_scalar_or_array3 get_toml_real_scalar_or_array3 proc~apply_template_toml_table->proc~get_toml_real_scalar_or_array3 proc~get_toml_real2->get_value proc~get_toml_real2->proc~require_toml_success proc~get_toml_real2->toml_len proc~get_toml_real_scalar_or_array3->get_value proc~get_toml_real_scalar_or_array3->proc~require_toml_success proc~get_toml_real_scalar_or_array3->toml_len

Called by

proc~~apply_toml_document~~CalledByGraph proc~apply_toml_document apply_toml_document 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 apply_toml_document(cfg, document, authoring)
    type(app_config), intent(inout) :: cfg
    type(toml_table), intent(inout) :: document
    type(app_config_authoring), intent(inout) :: authoring
    type(toml_key), allocatable :: keys(:)
    type(toml_table), pointer :: section
    integer :: ikey, stat
    character(len=:), allocatable :: key_name

    call document%get_keys(keys)
    do ikey = 1, size(keys)
      key_name = lower_ascii(trim(keys(ikey)%key))
      nullify (section)
      call get_value(document, keys(ikey), section, requested=.false., stat=stat)
      call require_toml_success(stat, '['//trim(keys(ikey)%key)//']')
      select case (trim(key_name))
      case ('sim')
        if (.not. associated(section)) error stop 'TOML section [sim] must be a table.'
        call apply_sim_toml_table(cfg, section, authoring%sim)
      case ('particles')
        if (.not. associated(section)) error stop 'TOML section [particles] must be a table.'
        call apply_particles_toml_table(cfg, section, authoring)
      case ('mesh')
        if (.not. associated(section)) error stop 'TOML section [mesh] must be a table.'
        call apply_mesh_toml_table(cfg, section, authoring)
      case ('output')
        if (.not. associated(section)) error stop 'TOML section [output] must be a table.'
        call apply_output_toml_table(cfg, section)
      case default
        error stop 'Unknown TOML section or top-level key: '//trim(keys(ikey)%key)
      end select
    end do
  end subroutine apply_toml_document