read_template_array Subroutine

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

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

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_template_array~~CallsGraph proc~read_template_array read_template_array get_value get_value proc~read_template_array->get_value 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~require_toml_success require_toml_success proc~read_template_array->proc~require_toml_success toml_len toml_len proc~read_template_array->toml_len get_keys get_keys proc~apply_template_toml_table->get_keys proc~get_toml_int get_toml_int proc~apply_template_toml_table->proc~get_toml_int proc~get_toml_logical get_toml_logical proc~apply_template_toml_table->proc~get_toml_logical proc~get_toml_real get_toml_real proc~apply_template_toml_table->proc~get_toml_real proc~get_toml_real3 get_toml_real3 proc~apply_template_toml_table->proc~get_toml_real3 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_string get_toml_string proc~apply_template_toml_table->proc~get_toml_string proc~lower_ascii lower_ascii proc~apply_template_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_real3->get_value proc~get_toml_real3->proc~require_toml_success proc~get_toml_real3->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 proc~get_toml_string->get_value proc~get_toml_string->proc~require_toml_success

Called by

proc~~read_template_array~~CalledByGraph proc~read_template_array read_template_array proc~apply_mesh_toml_table apply_mesh_toml_table proc~apply_mesh_toml_table->proc~read_template_array proc~apply_toml_document apply_toml_document proc~apply_toml_document->proc~apply_mesh_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_template_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 :: itemplate, n, stat

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

    n = toml_len(array)
    call ensure_template_capacity(cfg, n)
    call ensure_authoring_template_capacity(authoring, n)
    if (n > 0) cfg%templates(1:n) = template_spec()
    if (n > 0) authoring%templates(1:n) = template_authoring_spec()
    do itemplate = 1, n
      nullify (child)
      call get_value(array, itemplate, child, stat=stat)
      call require_toml_success(stat, 'mesh.templates entry')
      if (.not. associated(child)) error stop 'mesh.templates entries must be tables.'
      cfg%templates(itemplate)%enabled = .true.
      call apply_template_toml_table(cfg%templates(itemplate), child, authoring%templates(itemplate))
    end do
    cfg%n_templates = int(n, i32)
  end subroutine read_template_array