[[mesh.templates]] のキーをテンプレート設定へ適用する。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(template_spec), | intent(inout) | :: | spec |
更新対象のテンプレート設定。 |
||
| character(len=*), | intent(in) | :: | line |
|
subroutine apply_template_kv(spec, line) type(template_spec), intent(inout) :: spec character(len=*), intent(in) :: line character(len=64) :: k character(len=256) :: v call split_key_value(line, k, v) select case (trim(k)) case ('enabled') call parse_logical(v, spec%enabled) case ('kind') call parse_string(v, spec%kind) case ('center') call parse_real3(v, spec%center) case ('size_x') call parse_real(v, spec%size_x) case ('size_y') call parse_real(v, spec%size_y) case ('size') call parse_real3(v, spec%size) case ('nx') call parse_int(v, spec%nx) case ('ny') call parse_int(v, spec%ny) case ('nz') call parse_int(v, spec%nz) case ('radius') call parse_real(v, spec%radius) case ('inner_radius') call parse_real(v, spec%inner_radius) case ('height') call parse_real(v, spec%height) case ('n_theta') call parse_int(v, spec%n_theta) case ('n_r') call parse_int(v, spec%n_r) case ('n_z') call parse_int(v, spec%n_z) case ('cap') call parse_logical(v, spec%cap) case ('cap_top') call parse_logical(v, spec%cap_top) spec%has_cap_top = .true. case ('cap_bottom') call parse_logical(v, spec%cap_bottom) spec%has_cap_bottom = .true. case ('n_lon') call parse_int(v, spec%n_lon) case ('n_lat') call parse_int(v, spec%n_lat) case default error stop 'Unknown key in [[mesh.templates]]: '//trim(k) end select end subroutine apply_template_kv