bem_output_writer Module

実行サマリ・最終CSV・履歴CSVの出力を担当するモジュール。


Uses

  • module~~bem_output_writer~~UsesGraph module~bem_output_writer bem_output_writer module~bem_app_config_types bem_app_config_types module~bem_output_writer->module~bem_app_config_types module~bem_charge_ledger bem_charge_ledger module~bem_output_writer->module~bem_charge_ledger module~bem_checkpoint_contract bem_checkpoint_contract module~bem_output_writer->module~bem_checkpoint_contract module~bem_electrostatic_snapshot bem_electrostatic_snapshot module~bem_output_writer->module~bem_electrostatic_snapshot module~bem_filesystem bem_filesystem module~bem_output_writer->module~bem_filesystem module~bem_kinds bem_kinds module~bem_output_writer->module~bem_kinds module~bem_surface_current_model bem_surface_current_model module~bem_output_writer->module~bem_surface_current_model module~bem_types bem_types module~bem_output_writer->module~bem_types module~bem_app_config_types->module~bem_filesystem module~bem_app_config_types->module~bem_kinds module~bem_app_config_types->module~bem_types module~bem_external_boundary_contract bem_external_boundary_contract module~bem_app_config_types->module~bem_external_boundary_contract module~bem_physics_config_types bem_physics_config_types module~bem_app_config_types->module~bem_physics_config_types module~bem_charge_ledger->module~bem_kinds ieee_arithmetic ieee_arithmetic module~bem_charge_ledger->ieee_arithmetic module~bem_checkpoint_contract->module~bem_filesystem module~bem_checkpoint_contract->module~bem_kinds module~bem_electrostatic_snapshot->module~bem_kinds module~bem_electrostatic_snapshot->module~bem_types module~bem_electrostatic_snapshot->ieee_arithmetic module~bem_constants bem_constants module~bem_electrostatic_snapshot->module~bem_constants module~bem_coulomb_fmm_periodic_nonzero_reference bem_coulomb_fmm_periodic_nonzero_reference module~bem_electrostatic_snapshot->module~bem_coulomb_fmm_periodic_nonzero_reference module~bem_coulomb_fmm_periodic_nonzero_upper_vacuum bem_coulomb_fmm_periodic_nonzero_upper_vacuum module~bem_electrostatic_snapshot->module~bem_coulomb_fmm_periodic_nonzero_upper_vacuum module~bem_field_solver bem_field_solver module~bem_electrostatic_snapshot->module~bem_field_solver module~bem_mpi bem_mpi module~bem_electrostatic_snapshot->module~bem_mpi module~bem_panel_geometry bem_panel_geometry module~bem_electrostatic_snapshot->module~bem_panel_geometry module~bem_panel_kernel bem_panel_kernel module~bem_electrostatic_snapshot->module~bem_panel_kernel module~bem_periodic_zero_mode_eval bem_periodic_zero_mode_eval module~bem_electrostatic_snapshot->module~bem_periodic_zero_mode_eval module~bem_periodic_zero_mode_plan bem_periodic_zero_mode_plan module~bem_electrostatic_snapshot->module~bem_periodic_zero_mode_plan module~bem_electrostatic_snapshot->module~bem_physics_config_types module~bem_runtime_modes bem_runtime_modes module~bem_electrostatic_snapshot->module~bem_runtime_modes module~bem_string_utils bem_string_utils module~bem_electrostatic_snapshot->module~bem_string_utils iso_c_binding iso_c_binding module~bem_filesystem->iso_c_binding iso_fortran_env iso_fortran_env module~bem_kinds->iso_fortran_env module~bem_surface_current_model->module~bem_app_config_types module~bem_surface_current_model->module~bem_kinds module~bem_surface_current_model->ieee_arithmetic module~bem_config_helpers bem_config_helpers module~bem_surface_current_model->module~bem_config_helpers module~bem_surface_current_model->module~bem_constants module~bem_irradiation_cell_contract bem_irradiation_cell_contract module~bem_surface_current_model->module~bem_irradiation_cell_contract module~bem_outflow_spectrum bem_outflow_spectrum module~bem_surface_current_model->module~bem_outflow_spectrum module~bem_surface_current_model->module~bem_string_utils module~bem_surface_closure_contract bem_surface_closure_contract module~bem_surface_current_model->module~bem_surface_closure_contract sheath_model sheath_model module~bem_surface_current_model->sheath_model module~bem_types->module~bem_kinds module~bem_types->module~bem_outflow_spectrum module~bem_config_helpers->module~bem_app_config_types module~bem_config_helpers->module~bem_kinds module~bem_config_helpers->module~bem_types module~bem_config_helpers->module~bem_string_utils module~bem_constants->module~bem_kinds module~bem_coulomb_fmm_periodic_nonzero_reference->module~bem_kinds module~bem_coulomb_fmm_periodic_nonzero_reference->module~bem_types module~bem_coulomb_fmm_periodic_nonzero_reference->ieee_arithmetic module~bem_coulomb_fmm_periodic_nonzero_reference->module~bem_constants module~bem_coulomb_fmm_periodic_nonzero_reference->module~bem_panel_geometry module~bem_triangle_quadrature bem_triangle_quadrature module~bem_coulomb_fmm_periodic_nonzero_reference->module~bem_triangle_quadrature module~bem_coulomb_fmm_periodic_nonzero_upper_vacuum->module~bem_kinds module~bem_coulomb_fmm_periodic_nonzero_upper_vacuum->module~bem_types module~bem_coulomb_fmm_periodic_nonzero_upper_vacuum->ieee_arithmetic module~bem_coulomb_fmm_periodic_nonzero_upper_vacuum->module~bem_constants module~bem_external_boundary_contract->module~bem_kinds module~bem_external_boundary_contract->module~bem_string_utils module~bem_field_solver->module~bem_kinds module~bem_field_solver->module~bem_types module~bem_field_solver->ieee_arithmetic module~bem_field_solver->module~bem_constants module~bem_field_solver->module~bem_mpi module~bem_field_solver->module~bem_physics_config_types module~bem_field_solver->module~bem_runtime_modes module~bem_field_solver->module~bem_string_utils module~bem_coulomb_fmm_core bem_coulomb_fmm_core module~bem_field_solver->module~bem_coulomb_fmm_core module~bem_irradiation_cell_contract->module~bem_app_config_types module~bem_irradiation_cell_contract->module~bem_kinds module~bem_irradiation_cell_contract->module~bem_types module~bem_irradiation_cell_contract->module~bem_string_utils module~bem_mpi->module~bem_kinds module~bem_outflow_spectrum->module~bem_kinds module~bem_outflow_spectrum->sheath_model module~bem_panel_geometry->module~bem_kinds module~bem_panel_geometry->ieee_arithmetic module~bem_panel_kernel->module~bem_kinds module~bem_panel_kernel->module~bem_constants module~bem_panel_kernel->module~bem_panel_geometry module~bem_panel_self_terms bem_panel_self_terms module~bem_panel_kernel->module~bem_panel_self_terms module~bem_periodic_zero_mode_eval->module~bem_kinds module~bem_periodic_zero_mode_eval->module~bem_constants module~bem_periodic_zero_mode_eval->module~bem_periodic_zero_mode_plan module~bem_periodic_zero_mode_plan->module~bem_kinds module~bem_periodic_zero_mode_plan->module~bem_types module~bem_periodic_zero_mode_plan->ieee_arithmetic module~bem_periodic_zero_mode_plan->module~bem_constants module~bem_sorting bem_sorting module~bem_periodic_zero_mode_plan->module~bem_sorting module~bem_physics_config_types->module~bem_kinds module~bem_physics_config_types->module~bem_types module~bem_physics_config_types->ieee_arithmetic module~bem_physics_config_types->module~bem_string_utils module~bem_runtime_modes->module~bem_kinds module~bem_runtime_modes->module~bem_string_utils module~bem_surface_closure_contract->module~bem_kinds module~bem_surface_closure_contract->module~bem_runtime_modes module~bem_coulomb_fmm_core->module~bem_kinds module~bem_coulomb_fmm_core->module~bem_mpi module~bem_coulomb_fmm_types bem_coulomb_fmm_types module~bem_coulomb_fmm_core->module~bem_coulomb_fmm_types module~bem_panel_self_terms->module~bem_kinds module~bem_panel_self_terms->module~bem_panel_geometry module~bem_sorting->module~bem_kinds module~bem_triangle_quadrature->module~bem_kinds module~bem_triangle_quadrature->module~bem_constants module~bem_triangle_quadrature->module~bem_panel_geometry module~bem_coulomb_fmm_types->module~bem_kinds module~bem_coulomb_fmm_types->module~bem_mpi module~bem_coulomb_fmm_types->module~bem_panel_geometry module~bem_coulomb_fmm_types->module~bem_periodic_zero_mode_plan module~bem_periodic_shell_mean bem_periodic_shell_mean module~bem_coulomb_fmm_types->module~bem_periodic_shell_mean module~bem_periodic_shell_mean->module~bem_kinds

Used by

  • module~~bem_output_writer~~UsedByGraph module~bem_output_writer bem_output_writer module~bem_output_writer_files bem_output_writer_files module~bem_output_writer_files->module~bem_output_writer module~bem_output_writer_history bem_output_writer_history module~bem_output_writer_history->module~bem_output_writer module~bem_output_writer_summary bem_output_writer_summary module~bem_output_writer_summary->module~bem_output_writer module~bem_periodic_checkpoint bem_periodic_checkpoint module~bem_periodic_checkpoint->module~bem_output_writer module~bem_run_outputs bem_run_outputs module~bem_run_outputs->module~bem_output_writer module~bem_run_outputs->module~bem_periodic_checkpoint module~bem_simulator bem_simulator module~bem_simulator->module~bem_output_writer module~bem_simulator->module~bem_run_outputs module~bem_simulator_io bem_simulator_io module~bem_simulator_io->module~bem_output_writer module~bem_simulator_io->module~bem_simulator module~bem_simulator_loop bem_simulator_loop module~bem_simulator_loop->module~bem_output_writer module~bem_simulator_loop->module~bem_periodic_checkpoint module~bem_simulator_loop->module~bem_run_outputs module~bem_simulator_loop->module~bem_simulator program~main main program~main->module~bem_output_writer program~main->module~bem_periodic_checkpoint program~main->module~bem_run_outputs program~main->module~bem_simulator module~bem_simulator_charge bem_simulator_charge module~bem_simulator_charge->module~bem_simulator module~bem_simulator_particles bem_simulator_particles module~bem_simulator_particles->module~bem_simulator module~bem_simulator_stats bem_simulator_stats module~bem_simulator_stats->module~bem_simulator

Interfaces

interface

  • public module subroutine open_history_writer(app, resumed, history_opened, history_unit)

    Arguments

    Type IntentOptional Attributes Name
    type(app_config), intent(in) :: app
    logical, intent(in) :: resumed
    logical, intent(out) :: history_opened
    integer, intent(out) :: history_unit

interface

  • public module subroutine open_potential_history_writer(app, resumed, potential_history_opened, potential_history_unit)

    Arguments

    Type IntentOptional Attributes Name
    type(app_config), intent(in) :: app
    logical, intent(in) :: resumed
    logical, intent(out) :: potential_history_opened
    integer, intent(out) :: potential_history_unit

interface

  • public module subroutine open_top_reference_history_writer(app, resumed, history_opened, history_unit)

    Arguments

    Type IntentOptional Attributes Name
    type(app_config), intent(in) :: app
    logical, intent(in) :: resumed
    logical, intent(out) :: history_opened
    integer, intent(out) :: history_unit

interface

  • public module subroutine remove_previous_run_outputs(out_dir)

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: out_dir

interface

  • public module subroutine trim_history_files(out_dir, last_batch)

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: out_dir
    integer(kind=i32), intent(in) :: last_batch

interface

  • public module subroutine write_top_reference_history_snapshot(unit_id, batch_idx, simulated_time_s, z_high_m, sample_n, potential_mean_v, potential_std_v, potential_min_v, potential_max_v, switch_phi_rms, switch_ez_rms)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit_id
    integer(kind=i32), intent(in) :: batch_idx
    real(kind=dp), intent(in) :: simulated_time_s
    real(kind=dp), intent(in) :: z_high_m
    integer(kind=i32), intent(in) :: sample_n
    real(kind=dp), intent(in) :: potential_mean_v
    real(kind=dp), intent(in) :: potential_std_v
    real(kind=dp), intent(in) :: potential_min_v
    real(kind=dp), intent(in) :: potential_max_v
    real(kind=dp), intent(in), optional :: switch_phi_rms
    real(kind=dp), intent(in), optional :: switch_ez_rms

interface

  • public module subroutine open_matching_plane_history_writer(app, resumed, history_opened, history_unit)

    Arguments

    Type IntentOptional Attributes Name
    type(app_config), intent(in) :: app
    logical, intent(in) :: resumed
    logical, intent(out) :: history_opened
    integer, intent(out) :: history_unit

interface

  • public module subroutine write_matching_plane_history_snapshot(unit_id, batch_idx, simulated_time_s, stats)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit_id
    integer(kind=i32), intent(in) :: batch_idx
    real(kind=dp), intent(in) :: simulated_time_s
    type(sim_stats), intent(in) :: stats

interface

  • public module subroutine open_matching_plane_spectrum_history_writer(app, resumed, history_opened, history_unit)

    Arguments

    Type IntentOptional Attributes Name
    type(app_config), intent(in) :: app
    logical, intent(in) :: resumed
    logical, intent(out) :: history_opened
    integer, intent(out) :: history_unit

interface

  • public module subroutine write_matching_plane_spectrum_history_rows(unit_id, batch_idx, simulated_time_s, stats)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit_id
    integer(kind=i32), intent(in) :: batch_idx
    real(kind=dp), intent(in) :: simulated_time_s
    type(sim_stats), intent(in) :: stats

interface

  • public module subroutine open_secondary_emission_history_writer(app, resumed, history_opened, history_unit)

    Arguments

    Type IntentOptional Attributes Name
    type(app_config), intent(in) :: app
    logical, intent(in) :: resumed
    logical, intent(out) :: history_opened
    integer, intent(out) :: history_unit

interface

  • public module subroutine write_secondary_emission_history_rows(unit_id, batch_idx, app, counts, values)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit_id
    integer(kind=i32), intent(in) :: batch_idx
    type(app_config), intent(in) :: app
    integer(kind=i64), intent(in) :: counts(:,:)
    real(kind=dp), intent(in) :: values(:,:)

interface

  • public module subroutine open_fixed_current_history_writer(app, resumed, history_opened, history_unit)

    Arguments

    Type IntentOptional Attributes Name
    type(app_config), intent(in) :: app
    logical, intent(in) :: resumed
    logical, intent(out) :: history_opened
    integer, intent(out) :: history_unit

interface

  • public module subroutine write_fixed_current_history_rows(unit_id, batch_idx, simulated_time_s, window_batches, channel_active, tracked_charge_c, target_charge_c, surface_charge_c)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit_id
    integer(kind=i32), intent(in) :: batch_idx
    real(kind=dp), intent(in) :: simulated_time_s
    integer(kind=i32), intent(in) :: window_batches
    logical, intent(in) :: channel_active(:,:)

    (channel, species)。channel は 1=吸収、2=放出、3=脱出。

    real(kind=dp), intent(in) :: tracked_charge_c(:,:)
    real(kind=dp), intent(in) :: target_charge_c(:,:)
    real(kind=dp), intent(in) :: surface_charge_c(2)

    全 species の表面正味電荷の窓合計。1=raw、2=closure 後。


Derived Types

type, public ::  summary_identity_type

summary.txt に書く run 内不変量: mesh の幾何・材質の識別子と、設定から解いた初期 surface-current model。 どちらも電荷・統計・動的 closure に依存しないので、run の開始時に一度作り、checkpoint と最終出力で使い回す。 mesh の幾何・材質か設定を変えたら作り直す。ready でなければ writer がその場で計算する。 model を allocatable にして、この型を含む構造体を構成子で既定値のまま作れるようにする。

Components

Type Visibility Attributes Name Initial
logical, public :: ready = .false.
character(len=16), public :: mesh_fingerprint = ''
type(surface_current_model_result_type), public, allocatable :: initial_model

Subroutines

public subroutine print_run_summary(mesh, stats)

実行結果の主要統計を標準出力へ表示する。

Arguments

Type IntentOptional Attributes Name
type(mesh_type), intent(in) :: mesh

実行後のメッシュ情報。

type(sim_stats), intent(in) :: stats

実行後の統計値。

public subroutine write_result_files(out_dir, mesh, stats, cfg, mpi_world_size, mesh_potential_v, charge_ledger, electrostatic_diagnostics, identity)

解析結果を summary.txt / charges.csv / mesh_triangles.csv などとして保存する。

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: out_dir

出力先ディレクトリ。

type(mesh_type), intent(in) :: mesh

書き出し対象のメッシュ。

type(sim_stats), intent(in) :: stats

書き出し対象の統計値。

type(app_config), intent(in) :: cfg

出力設定を含むアプリ設定。

integer(kind=i32), intent(in), optional :: mpi_world_size
real(kind=dp), intent(in), optional :: mesh_potential_v(:)
type(charge_ledger_type), intent(in), optional :: charge_ledger
type(electrostatic_diagnostics_type), intent(in), optional :: electrostatic_diagnostics
type(summary_identity_type), intent(in), optional :: identity

public subroutine write_checkpoint_state_files(out_dir, mesh, stats, cfg, mpi_world_size, charge_ledger, identity)

再開に必要な root-rank 共通状態だけをチェックポイントへ保存する。

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: out_dir
type(mesh_type), intent(in) :: mesh
type(sim_stats), intent(in) :: stats
type(app_config), intent(in) :: cfg
integer(kind=i32), intent(in), optional :: mpi_world_size
type(charge_ledger_type), intent(in), optional :: charge_ledger
type(summary_identity_type), intent(in), optional :: identity

public subroutine ensure_output_dir(out_dir)

出力ディレクトリを作成する。

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: out_dir

作成対象ディレクトリのパス。