io_manager.f90 Source File


This file depends on

sourcefile~~io_manager.f90~~EfferentGraph sourcefile~io_manager.f90 io_manager.f90 sourcefile~checkpoint_manager.f90 checkpoint_manager.f90 sourcefile~io_manager.f90->sourcefile~checkpoint_manager.f90 sourcefile~snapshot_manager.f90 snapshot_manager.f90 sourcefile~io_manager.f90->sourcefile~snapshot_manager.f90 sourcefile~solver.f90 solver.f90 sourcefile~io_manager.f90->sourcefile~solver.f90 sourcefile~checkpoint_manager.f90->sourcefile~solver.f90 sourcefile~common.f90 common.f90 sourcefile~checkpoint_manager.f90->sourcefile~common.f90 sourcefile~config.f90 config.f90 sourcefile~checkpoint_manager.f90->sourcefile~config.f90 sourcefile~field.f90 field.f90 sourcefile~checkpoint_manager.f90->sourcefile~field.f90 sourcefile~io.f90 io.f90 sourcefile~checkpoint_manager.f90->sourcefile~io.f90 sourcefile~io_field_utils.f90 io_field_utils.f90 sourcefile~checkpoint_manager.f90->sourcefile~io_field_utils.f90 sourcefile~io_session.f90 io_session.f90 sourcefile~checkpoint_manager.f90->sourcefile~io_session.f90 sourcefile~snapshot_manager.f90->sourcefile~solver.f90 sourcefile~snapshot_manager.f90->sourcefile~common.f90 sourcefile~snapshot_manager.f90->sourcefile~config.f90 sourcefile~snapshot_manager.f90->sourcefile~field.f90 sourcefile~snapshot_manager.f90->sourcefile~io.f90 sourcefile~snapshot_manager.f90->sourcefile~io_field_utils.f90 sourcefile~snapshot_manager.f90->sourcefile~io_session.f90 sourcefile~allocator.f90 allocator.f90 sourcefile~solver.f90->sourcefile~allocator.f90 sourcefile~backend.f90~2 backend.f90 sourcefile~solver.f90->sourcefile~backend.f90~2 sourcefile~solver.f90->sourcefile~common.f90 sourcefile~solver.f90->sourcefile~config.f90 sourcefile~solver.f90->sourcefile~field.f90 sourcefile~ibm.f90 ibm.f90 sourcefile~solver.f90->sourcefile~ibm.f90 sourcefile~mesh.f90 mesh.f90 sourcefile~solver.f90->sourcefile~mesh.f90 sourcefile~tdsops.f90~2 tdsops.f90 sourcefile~solver.f90->sourcefile~tdsops.f90~2 sourcefile~time_integrator.f90 time_integrator.f90 sourcefile~solver.f90->sourcefile~time_integrator.f90 sourcefile~vector_calculus.f90 vector_calculus.f90 sourcefile~solver.f90->sourcefile~vector_calculus.f90 sourcefile~allocator.f90->sourcefile~common.f90 sourcefile~allocator.f90->sourcefile~field.f90 sourcefile~backend.f90~2->sourcefile~allocator.f90 sourcefile~backend.f90~2->sourcefile~common.f90 sourcefile~backend.f90~2->sourcefile~field.f90 sourcefile~backend.f90~2->sourcefile~mesh.f90 sourcefile~backend.f90~2->sourcefile~tdsops.f90~2 sourcefile~poisson_fft.f90~2 poisson_fft.f90 sourcefile~backend.f90~2->sourcefile~poisson_fft.f90~2 sourcefile~config.f90->sourcefile~common.f90 sourcefile~field.f90->sourcefile~common.f90 sourcefile~ibm.f90->sourcefile~allocator.f90 sourcefile~ibm.f90->sourcefile~backend.f90~2 sourcefile~ibm.f90->sourcefile~common.f90 sourcefile~ibm.f90->sourcefile~field.f90 sourcefile~ibm.f90->sourcefile~io_session.f90 sourcefile~ibm.f90->sourcefile~mesh.f90 sourcefile~io.f90->sourcefile~common.f90 sourcefile~io_base.f90 io_base.f90 sourcefile~io.f90->sourcefile~io_base.f90 sourcefile~io_field_utils.f90->sourcefile~solver.f90 sourcefile~io_field_utils.f90->sourcefile~common.f90 sourcefile~io_field_utils.f90->sourcefile~field.f90 sourcefile~io_field_utils.f90->sourcefile~io_base.f90 sourcefile~io_session.f90->sourcefile~common.f90 sourcefile~io_session.f90->sourcefile~io.f90 sourcefile~io_session.f90->sourcefile~io_base.f90 sourcefile~mesh.f90->sourcefile~common.f90 sourcefile~mesh.f90->sourcefile~field.f90 sourcefile~decomp_2decompfft.f90 decomp_2decompfft.f90 sourcefile~mesh.f90->sourcefile~decomp_2decompfft.f90 sourcefile~mesh_content.f90 mesh_content.f90 sourcefile~mesh.f90->sourcefile~mesh_content.f90 sourcefile~tdsops.f90~2->sourcefile~common.f90 sourcefile~time_integrator.f90->sourcefile~allocator.f90 sourcefile~time_integrator.f90->sourcefile~backend.f90~2 sourcefile~time_integrator.f90->sourcefile~common.f90 sourcefile~time_integrator.f90->sourcefile~field.f90 sourcefile~vector_calculus.f90->sourcefile~allocator.f90 sourcefile~vector_calculus.f90->sourcefile~backend.f90~2 sourcefile~vector_calculus.f90->sourcefile~common.f90 sourcefile~vector_calculus.f90->sourcefile~field.f90 sourcefile~vector_calculus.f90->sourcefile~tdsops.f90~2 sourcefile~decomp_2decompfft.f90->sourcefile~mesh_content.f90 sourcefile~io_base.f90->sourcefile~common.f90 sourcefile~mesh_content.f90->sourcefile~common.f90 sourcefile~poisson_fft.f90~2->sourcefile~common.f90 sourcefile~poisson_fft.f90~2->sourcefile~field.f90 sourcefile~poisson_fft.f90~2->sourcefile~mesh.f90 sourcefile~poisson_fft.f90~2->sourcefile~tdsops.f90~2

Files dependent on this one

sourcefile~~io_manager.f90~~AfferentGraph sourcefile~io_manager.f90 io_manager.f90 sourcefile~base_case.f90 base_case.f90 sourcefile~base_case.f90->sourcefile~io_manager.f90 sourcefile~channel.f90 channel.f90 sourcefile~channel.f90->sourcefile~base_case.f90 sourcefile~generic.f90 generic.f90 sourcefile~generic.f90->sourcefile~base_case.f90 sourcefile~tgv.f90 tgv.f90 sourcefile~tgv.f90->sourcefile~base_case.f90 sourcefile~xcompact.f90 xcompact.f90 sourcefile~xcompact.f90->sourcefile~base_case.f90 sourcefile~xcompact.f90->sourcefile~channel.f90 sourcefile~xcompact.f90->sourcefile~generic.f90 sourcefile~xcompact.f90->sourcefile~tgv.f90

Source Code

module m_io_manager
!! @brief Provides a high-level manager that orchestrates all checkpoint and
!! snapshot operations.
!!
!! @details This module acts as a facade to the I/O subsystem.
!! Its purpose is to simplify the main simulation loop by providing
!! a single point of contact for all I/O-related actions. The mainprogram only
!! needs to interact with the `io_manager_t` type, which then delegates tasks
!! to the specialised checkpoint and snapshot managers.
  use m_checkpoint_manager, only: checkpoint_manager_t
  use m_snapshot_manager, only: snapshot_manager_t
  use m_solver, only: solver_t

  implicit none

  private
  public :: io_manager_t

  type :: io_manager_t
    type(checkpoint_manager_t) :: checkpoint_mgr
    type(snapshot_manager_t) :: snapshot_mgr
  contains
    procedure :: init => io_init
    procedure :: handle_restart => io_handle_restart
    procedure :: handle_io_step => io_handle_step
    procedure :: finalise => io_finalise
    procedure :: is_restart => io_is_restart
  end type io_manager_t

contains

  subroutine io_init(self, comm)
    class(io_manager_t), intent(inout) :: self
    integer, intent(in) :: comm

    call self%checkpoint_mgr%init(comm)
    call self%snapshot_mgr%init(comm)
  end subroutine io_init

  subroutine io_handle_restart(self, solver, comm)
    class(io_manager_t), intent(inout) :: self
    class(solver_t), intent(inout) :: solver
    integer, intent(in), optional :: comm

    call self%checkpoint_mgr%handle_restart(solver, comm)
  end subroutine io_handle_restart

  subroutine io_handle_step(self, solver, timestep, comm)
    class(io_manager_t), intent(inout) :: self
    class(solver_t), intent(in) :: solver
    integer, intent(in) :: timestep
    integer, intent(in), optional :: comm

    call self%checkpoint_mgr%handle_checkpoint_step(solver, timestep, comm)
    call self%snapshot_mgr%handle_snapshot_step(solver, timestep, comm)
  end subroutine io_handle_step

  function io_is_restart(self) result(is_restart)
    class(io_manager_t), intent(in) :: self
    logical :: is_restart

    is_restart = self%checkpoint_mgr%is_restart()
  end function io_is_restart

  subroutine io_finalise(self)
    class(io_manager_t), intent(inout) :: self

    call self%checkpoint_mgr%finalise()
    call self%snapshot_mgr%finalise()
  end subroutine io_finalise

end module m_io_manager