[[mesh.templates]] の1要素をテンプレート設定へ適用する。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(template_spec), | intent(inout) | :: | spec | |||
| type(toml_table), | intent(inout) | :: | table | |||
| type(template_authoring_spec), | intent(inout) | :: | auth |
subroutine apply_template_toml_table(spec, table, auth) type(template_spec), intent(inout) :: spec type(toml_table), intent(inout) :: table type(template_authoring_spec), intent(inout) :: auth type(toml_key), allocatable :: keys(:) integer :: ikey character(len=:), allocatable :: k call table%get_keys(keys) do ikey = 1, size(keys) k = lower_ascii(trim(keys(ikey)%key)) select case (trim(k)) case ('enabled') call get_toml_logical(table, keys(ikey), spec%enabled, 'mesh.templates.enabled') case ('kind') call get_toml_string(table, keys(ikey), spec%kind, 'mesh.templates.kind') case ('surface_model') call get_toml_string(table, keys(ikey), spec%surface_model, 'mesh.templates.surface_model') spec%surface_model = lower_ascii(trim(spec%surface_model)) case ('epsilon_r') call get_toml_real(table, keys(ikey), spec%epsilon_r, 'mesh.templates.epsilon_r') case ('center') call get_toml_real3(table, keys(ikey), spec%center, 'mesh.templates.center') auth%has_center = .true. case ('size_x') call get_toml_real(table, keys(ikey), spec%size_x, 'mesh.templates.size_x') auth%has_size_x = .true. case ('size_y') call get_toml_real(table, keys(ikey), spec%size_y, 'mesh.templates.size_y') auth%has_size_y = .true. case ('size') call get_toml_real3(table, keys(ikey), spec%size, 'mesh.templates.size') auth%has_size = .true. case ('nx') call get_toml_int(table, keys(ikey), spec%nx, 'mesh.templates.nx') case ('ny') call get_toml_int(table, keys(ikey), spec%ny, 'mesh.templates.ny') case ('nz') call get_toml_int(table, keys(ikey), spec%nz, 'mesh.templates.nz') case ('radius') call get_toml_real(table, keys(ikey), spec%radius, 'mesh.templates.radius') auth%has_radius = .true. case ('inner_radius') call get_toml_real(table, keys(ikey), spec%inner_radius, 'mesh.templates.inner_radius') auth%has_inner_radius = .true. case ('height') call get_toml_real(table, keys(ikey), spec%height, 'mesh.templates.height') auth%has_height = .true. case ('n_theta') call get_toml_int(table, keys(ikey), spec%n_theta, 'mesh.templates.n_theta') case ('n_r') call get_toml_int(table, keys(ikey), spec%n_r, 'mesh.templates.n_r') case ('n_z') call get_toml_int(table, keys(ikey), spec%n_z, 'mesh.templates.n_z') case ('cap') call get_toml_logical(table, keys(ikey), spec%cap, 'mesh.templates.cap') case ('cap_top') call get_toml_logical(table, keys(ikey), spec%cap_top, 'mesh.templates.cap_top') spec%has_cap_top = .true. case ('cap_bottom') call get_toml_logical(table, keys(ikey), spec%cap_bottom, 'mesh.templates.cap_bottom') spec%has_cap_bottom = .true. case ('n_lon') call get_toml_int(table, keys(ikey), spec%n_lon, 'mesh.templates.n_lon') case ('n_lat') call get_toml_int(table, keys(ikey), spec%n_lat, 'mesh.templates.n_lat') case ('group') call get_toml_string(table, keys(ikey), auth%group, 'mesh.templates.group') auth%has_group = .true. case ('center_local') call get_toml_real3(table, keys(ikey), auth%center_local, 'mesh.templates.center_local') auth%has_center_local = .true. case ('placement_mode') call get_toml_string(table, keys(ikey), auth%placement_mode, 'mesh.templates.placement_mode') auth%placement_mode = lower_ascii(trim(auth%placement_mode)) auth%has_placement_mode = .true. case ('anchor') call get_toml_string(table, keys(ikey), auth%anchor, 'mesh.templates.anchor') auth%anchor = lower_ascii(trim(auth%anchor)) auth%has_anchor = .true. case ('offset') call get_toml_real3(table, keys(ikey), auth%offset, 'mesh.templates.offset') auth%has_offset = .true. case ('offset_frac') call get_toml_real3(table, keys(ikey), auth%offset_frac, 'mesh.templates.offset_frac') auth%has_offset_frac = .true. case ('size_mode') call get_toml_string(table, keys(ikey), auth%size_mode, 'mesh.templates.size_mode') auth%size_mode = lower_ascii(trim(auth%size_mode)) auth%has_size_mode = .true. case ('size_frac') call get_toml_real_scalar_or_array3( & table, keys(ikey), auth%size_frac, auth%size_frac_len, 'mesh.templates.size_frac' & ) auth%has_size_frac = .true. case default error stop 'Unknown key in [[mesh.templates]]: '//trim(keys(ikey)%key) end select end do end subroutine apply_template_toml_table