restart_registry_t Derived Type

type, public :: restart_registry_t

Append-only registry of checkpoint fields. Slots call register_2d / register_3d from their (or the state’s) init.


Inherits

type~~restart_registry_t~~InheritsGraph type~restart_registry_t restart_registry_t type~restart_entry_t restart_entry_t type~restart_registry_t->type~restart_entry_t entries

Components

Type Visibility Attributes Name Initial
type(restart_entry_t), public :: entries(MAX_RESTART_ENTRIES)
integer, public :: n = 0

Type-Bound Procedures

procedure, public, non_overridable :: clear => registry_clear

procedure, public, non_overridable :: entry_found => registry_entry_found

  • private pure function registry_entry_found(this, tag) result(found)

    Was tag actually present in the file the last time this registry was passed to ocean_restart_read_local? .false. before any read, and .false. for an unknown tag (a caller typo is a silent cold-seed, not a crash — callers that care should assert the tag exists via a successful register_* first). See restart_entry_t%found’s docstring for why this is not the same question as optional.

    Arguments

    Type IntentOptional Attributes Name
    class(restart_registry_t), intent(in) :: this
    character(len=*), intent(in) :: tag

    Return Value logical

procedure, public, non_overridable :: register_2d => registry_register_2d

  • private subroutine registry_register_2d(this, tag, arr, ng, nx_phys, ny_phys, optional, device_mapped)

    Register a rank-2 owned field. arr is the full (ghosted) host array; the owned slice is (ng+1:ng+nx_phys, ng+1:ng+ny_phys).

    Arguments

    Type IntentOptional Attributes Name
    class(restart_registry_t), intent(inout) :: this
    character(len=*), intent(in) :: tag
    real(kind=wp), intent(in), target :: arr(:,:)
    integer, intent(in) :: ng
    integer, intent(in) :: nx_phys
    integer, intent(in) :: ny_phys
    logical, intent(in), optional :: optional
    logical, intent(in), optional :: device_mapped

procedure, public, non_overridable :: register_3d => registry_register_3d

  • private subroutine registry_register_3d(this, tag, arr, ng, nx_phys, ny_phys, optional, device_mapped)

    Register a rank-3 owned field. The vertical extent is taken from size(arr,3) (layers or interfaces — both fully owned).

    Arguments

    Type IntentOptional Attributes Name
    class(restart_registry_t), intent(inout) :: this
    character(len=*), intent(in) :: tag
    real(kind=wp), intent(in), target :: arr(:,:,:)
    integer, intent(in) :: ng
    integer, intent(in) :: nx_phys
    integer, intent(in) :: ny_phys
    logical, intent(in), optional :: optional
    logical, intent(in), optional :: device_mapped

procedure, public, non_overridable :: register_scalar => registry_register_scalar

  • private subroutine registry_register_scalar(this, tag, scal, optional)

    Register a host scalar (rank-0 persistent state, e.g. the Chapman eta_old_chapman_* corner values). Host-only — never device- mapped, so the write path skips update self for it.

    Arguments

    Type IntentOptional Attributes Name
    class(restart_registry_t), intent(inout) :: this
    character(len=*), intent(in) :: tag
    real(kind=wp), intent(in), target :: scal
    logical, intent(in), optional :: optional

Source Code

   type :: restart_registry_t
      !! Append-only registry of checkpoint fields.  Slots call
      !! `register_2d` / `register_3d` from their (or the state's) init.
      integer :: n = 0
      type(restart_entry_t) :: entries(MAX_RESTART_ENTRIES)
   contains
      procedure, non_overridable :: register_scalar => registry_register_scalar
      procedure, non_overridable :: register_2d => registry_register_2d
      procedure, non_overridable :: register_3d => registry_register_3d
      procedure, non_overridable :: clear => registry_clear
      procedure, non_overridable :: entry_found => registry_entry_found
   end type restart_registry_t