Framework needs to support restart capability
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): Givenfield_name, fillfield_bufferwith the appropriate data.<scheme>_restart_restore(field_name, field_buffer): Givenfield_nameandfield_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_saveroutine.<host_name>_ccpp_physics_restart_restore(suite_name, field_name, field_buffer): Call the appropriate<scheme>_restart_restoreroutine.
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.
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.