ccpp-framework icon indicating copy to clipboard operation
ccpp-framework copied to clipboard

Framework needs to support restart capability

Open gold2718 opened this issue 5 years ago • 1 comments

Physics schemes and suites which contain internal state need a way to save and restore this state via host-model restart files. Following is a proposal for creating this functionality. Two new optional CCPP scheme interfaces will be supported:

  • <scheme>_restart_save(field_name, field_buffer): Given field_name, fill field_buffer with the appropriate data.
  • <scheme>_restart_restore(field_name, field_buffer): Given field_name and field_buffer, restore the state of the appropriate internal buffer.

If these interfaces are present, they will be called from the host model cap via these new host cap interfaces:

  • <host_name>_ccpp_physics_restart_save(suite_name, field_name, field_buffer): Call the appropriate <scheme>_restart_save routine.
  • <host_name>_ccpp_physics_restart_restore(suite_name, field_name, field_buffer): Call the appropriate <scheme>_restart_restore routine.

In order for the host model to know which fields need to be written to and read from its restart files, any field which needs to be saved needs to set the (new) restart_required attribute to True. capgen will return a list of these fields and associated metadata to the host model build system.

It is an error for a physics scheme to have a field marked as restart_required = True and not provide <scheme>_restart_save and <scheme>_restart_restore interfaces.

gold2718 avatar Jan 18 '20 19:01 gold2718

We discussed this issue at today's CCPP Framework meeting and decided it is a low-priority feature that is not needed at this time.

mkavulich avatar Jul 10 '25 16:07 mkavulich