write_result_files Subroutine

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

解析結果を 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(:)

Calls

proc~~write_result_files~~CallsGraph proc~write_result_files write_result_files proc~ensure_output_dir ensure_output_dir proc~write_result_files->proc~ensure_output_dir proc~lower_ascii lower_ascii proc~write_result_files->proc~lower_ascii

Called by

proc~~write_result_files~~CalledByGraph proc~write_result_files write_result_files program~main main program~main->proc~write_result_files

Source Code

  subroutine write_result_files(out_dir, mesh, stats, cfg, mpi_world_size, mesh_potential_v)
    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(i32), intent(in), optional :: mpi_world_size
    real(dp), intent(in), optional :: mesh_potential_v(:)

    call ensure_output_dir(out_dir)
    call write_summary_file(out_dir, mesh, stats, mpi_world_size=mpi_world_size)
    call write_charges_file(out_dir, mesh)
    if (cfg%write_mesh_potential) then
      if (.not. present(mesh_potential_v)) then
        error stop 'write_result_files: mesh_potential_v is required when write_mesh_potential is enabled.'
      end if
      call write_mesh_potential_file(out_dir, mesh, mesh_potential_v)
    end if
    call write_mesh_file(out_dir, mesh)
    call write_mesh_sources_file(out_dir, mesh, cfg)
  end subroutine write_result_files