設定読込・メッシュ構築・再開判定・乱数初期化をまとめて行う。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(app_config), | intent(out) | :: | app |
読み込み・既定値適用後のアプリ設定。 |
||
| type(mesh_type), | intent(out) | :: | mesh |
構築した三角形メッシュ。 |
||
| type(sim_stats), | intent(out) | :: | initial_stats |
再開時に引き継ぐ初期統計(新規実行時はゼロ)。 |
||
| type(injection_state), | intent(out) | :: | inject_state |
種別ごとの注入残差状態。 |
||
| logical, | intent(out) | :: | resumed |
チェックポイントから再開した場合に |
||
| type(mpi_context), | intent(in) | :: | mpi |
subroutine load_or_init_run_state(app, mesh, initial_stats, inject_state, resumed, mpi) type(app_config), intent(out) :: app type(mesh_type), intent(out) :: mesh type(sim_stats), intent(out) :: initial_stats type(injection_state), intent(out) :: inject_state logical, intent(out) :: resumed type(mpi_context), intent(in) :: mpi character(len=256) :: cfg_path logical :: has_config call default_app_config(app) call resolve_config_path(cfg_path, has_config) if (has_config) then call load_app_config(trim(cfg_path), app) end if call build_mesh_from_config(app, mesh) call prepare_periodic2_collision_mesh(mesh, app%sim) call initialize_injection_state(inject_state, app%n_particle_species) initial_stats = sim_stats() resumed = .false. if (app%resume_output) then if (.not. app%write_output) error stop 'output.resume requires output.write_files = true.' call load_restart_checkpoint( & trim(app%output_dir), mesh, initial_stats, resumed, inject_state, mpi=mpi & ) end if if (resumed) then if (mpi_is_root(mpi)) then print '(a,i0)', 'resuming_from_batches=', initial_stats%batches print '(a,i0)', 'resuming_from_processed_particles=', initial_stats%processed_particles end if else call seed_particles_from_config(app, mpi=mpi) end if end subroutine load_or_init_run_state