37 use json_utils,
only: json_get_or_default
39 use utils,
only: neko_error
48 module subroutine state_recover_factory(recover, neko_case, params)
49 class(state_recover_t),
allocatable,
intent(inout) :: recover
50 class(case_t),
target,
intent(inout) :: neko_case
51 type(json_file),
intent(inout) :: params
52 character(len=:),
allocatable :: recover_type
54 call json_get_or_default(params,
"type", recover_type,
"checkpoint")
55 call state_recover_allocator(recover, recover_type)
56 call recover%init(neko_case, params)
57 end subroutine state_recover_factory
62 subroutine state_recover_allocator(recover, recover_type)
63 class(state_recover_t),
allocatable,
intent(inout) :: recover
64 character(len=*),
intent(in) :: recover_type
66 if (
allocated(recover))
then
71 select case (trim(recover_type))
72 case (
"checkpoint",
"simulation_checkpoint")
75 call neko_error(
"Unknown state recover type: " // trim(recover_type))
78 end subroutine state_recover_allocator
80end submodule state_recover_fctry
Checkpoint-based state recovery for adjoint runs.
Abstract interface for state recovery strategies.