[sim] セクションのキーを sim_config へ適用する。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(app_config), | intent(inout) | :: | cfg |
更新対象のアプリ設定。 |
||
| character(len=*), | intent(in) | :: | line |
|
subroutine apply_sim_kv(cfg, line) type(app_config), intent(inout) :: cfg 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 ('dt') call parse_real(v, cfg%sim%dt) case ('rng_seed') call parse_int(v, cfg%sim%rng_seed) case ('batch_count') call parse_int(v, cfg%sim%batch_count) case ('batch_duration') call parse_real(v, cfg%sim%batch_duration) cfg%sim%has_batch_duration = .true. case ('batch_duration_step') call parse_real(v, cfg%sim%batch_duration_step) cfg%sim%has_batch_duration_step = .true. case ('max_step') call parse_int(v, cfg%sim%max_step) case ('tol_rel') call parse_real(v, cfg%sim%tol_rel) case ('q_floor') call parse_real(v, cfg%sim%q_floor) case ('softening') call parse_real(v, cfg%sim%softening) case ('field_solver') call parse_string(v, cfg%sim%field_solver) cfg%sim%field_solver = lower_ascii(trim(cfg%sim%field_solver)) case ('field_bc_mode') call parse_string(v, cfg%sim%field_bc_mode) cfg%sim%field_bc_mode = lower_ascii(trim(cfg%sim%field_bc_mode)) case ('field_periodic_image_layers') call parse_int(v, cfg%sim%field_periodic_image_layers) case ('field_periodic_far_correction') call parse_string(v, cfg%sim%field_periodic_far_correction) cfg%sim%field_periodic_far_correction = lower_ascii(trim(cfg%sim%field_periodic_far_correction)) case ('field_periodic_ewald_alpha') call parse_real(v, cfg%sim%field_periodic_ewald_alpha) case ('field_periodic_ewald_layers') call parse_int(v, cfg%sim%field_periodic_ewald_layers) case ('tree_theta') call parse_real(v, cfg%sim%tree_theta) cfg%sim%has_tree_theta = .true. case ('tree_leaf_max') call parse_int(v, cfg%sim%tree_leaf_max) cfg%sim%has_tree_leaf_max = .true. case ('tree_min_nelem') call parse_int(v, cfg%sim%tree_min_nelem) case ('b0') call parse_real3(v, cfg%sim%b0) case ('reservoir_potential_model') call parse_string(v, cfg%sim%reservoir_potential_model) cfg%sim%reservoir_potential_model = lower_ascii(trim(cfg%sim%reservoir_potential_model)) case ('phi_infty') call parse_real(v, cfg%sim%phi_infty) case ('injection_face_phi_grid_n') call parse_int(v, cfg%sim%injection_face_phi_grid_n) case ('raycast_max_bounce') call parse_int(v, cfg%sim%raycast_max_bounce) case ('sheath_injection_model') call parse_string(v, cfg%sim%sheath_injection_model) cfg%sim%sheath_injection_model = lower_ascii(trim(cfg%sim%sheath_injection_model)) case ('sheath_alpha_deg') call parse_real(v, cfg%sim%sheath_alpha_deg) case ('sheath_photoelectron_ref_density_cm3') call parse_real(v, cfg%sim%sheath_photoelectron_ref_density_cm3) case ('sheath_reference_coordinate') call parse_real(v, cfg%sim%sheath_reference_coordinate) cfg%sim%has_sheath_reference_coordinate = .true. case ('sheath_electron_drift_mode') call parse_string(v, cfg%sim%sheath_electron_drift_mode) cfg%sim%sheath_electron_drift_mode = lower_ascii(trim(cfg%sim%sheath_electron_drift_mode)) case ('sheath_ion_drift_mode') call parse_string(v, cfg%sim%sheath_ion_drift_mode) cfg%sim%sheath_ion_drift_mode = lower_ascii(trim(cfg%sim%sheath_ion_drift_mode)) case ('use_box') call parse_logical(v, cfg%sim%use_box) case ('box_min') call parse_real3(v, cfg%sim%box_min) case ('box_max') call parse_real3(v, cfg%sim%box_max) case ('bc_x_low') call parse_boundary_mode(v, cfg%sim%bc_low(1)) case ('bc_x_high') call parse_boundary_mode(v, cfg%sim%bc_high(1)) case ('bc_y_low') call parse_boundary_mode(v, cfg%sim%bc_low(2)) case ('bc_y_high') call parse_boundary_mode(v, cfg%sim%bc_high(2)) case ('bc_z_low') call parse_boundary_mode(v, cfg%sim%bc_low(3)) case ('bc_z_high') call parse_boundary_mode(v, cfg%sim%bc_high(3)) case default error stop 'Unknown key in [sim]: '//trim(k) end select end subroutine apply_sim_kv