write_checkpoint Subroutine

public subroutine write_checkpoint(state, base, t, iter, is_ok, message)

Write a checkpoint file for the current solver state.

The file is written as an unformatted stream binary. After a successful write, the plain text file latest_checkpoint is updated to the new file's path.

Arguments

Type IntentOptional Attributes Name
type(solver_state_t), intent(in) :: state

Current solver state (must have ub allocated).

character(len=*), intent(in) :: base

Base name (e.g. 'checkpoint'); file = base_NNNNNN.bin.

real(kind=wp), intent(in) :: t

Current simulation time [s].

integer, intent(in) :: iter

Current iteration number.

logical, intent(out), optional :: is_ok
character(len=*), intent(out), optional :: message