Skip to content

DLESyMOcean

GlobalS2S202540 GBNVIDIAPyTorch

Import path: earth2studio.models.px.DLESyMOcean

View source on GitHub View install commands

Documentation

Bases: _DLESyMComponent

Ocean component of DLESyM, as a standalone prognostic model.

Takes the ocean's history on the native HEALPix grid and, as forcing, the means of the atmosphere's coupling variables over the atmosphere frames of each ocean window, declared as qualified labels such as z1000:mean:48h valid at the ocean's own output lead times. The fused DLESyM averages the atmosphere's output frames of the same cycle, so under [CoupledRunner][earth2studio.coupling.CoupledRunner] an exact connector from DLESyMAtmos reduces its frames onto this slot.

The model loads only the ocean core from the package shared with DLESyM, so running the ocean alone does not load the atmosphere.

Parameters:

  • core (Module) –

    Ocean network core

  • hpx_lat (ndarray) –

    HEALPix latitude coordinates, shape (12, nside, nside)

  • hpx_lon (ndarray) –

    HEALPix longitude coordinates, shape (12, nside, nside)

  • nside (int) –

    HEALPix nside

  • center (ndarray) –

    Means of the output variables (prognostics then diagnostics), shape (num_output_variables,)

  • scale (ndarray) –

    Standard deviations of the output variables, same shape as center

  • coupling_center (ndarray) –

    Means of the atmosphere variables received as forcing: the atmosphere's own output constants, shape (num_coupling_variables,)

  • coupling_scale (ndarray) –

    Standard deviations of the atmosphere variables received as forcing, same shape as coupling_center

  • constants (ndarray) –

    Constant fields, shape (12, num_constants, nside, nside)

  • input_times (ndarray) –

    Input lead times, shape (num_input_times,)

  • output_times (ndarray) –

    Output lead times, shape (num_output_times,)

  • atmos_output_times (ndarray) –

    Output lead times of the atmosphere, whose frames each ocean window averages, shape (num_atmos_output_times,)

  • variables (list[str]) –

    Prognostic variables

  • coupling_variables (list[str]) –

    Atmosphere variables whose window means are received as forcing

  • diagnostic_variables (list[str], default: None ) –

    Diagnostic output variables, which are not fed back as input, by default []

  • use_cln (bool, default: False ) –

    Whether the core uses conditional layer norm, by default False

  • condition_shape (int, default: None ) –

    Dimension of the conditional layer norm noise vector. Required if use_cln is True, by default None

Note

See DLESyM for more information about the model and DLESyMAtmos for a coupled example.

__call__

__call__(x: DataArray, forcing: DataArray) -> DataArray

Advance one coupled cycle without hooks.

Parameters:

  • x (DataArray) –

    Ocean history matching input_coords().

  • forcing (DataArray) –

    Atmosphere window means matching forcing_coords().

Returns:

  • DataArray –

    Ocean at the cycle's output lead times.

create_iterator

create_iterator(
    x: DataArray, forcing: DataArray
) -> Iterator[DataArray]

Yield cycles with hooks, taking each step's forcing through send.

Parameters:

  • x (DataArray) –

    Ocean history matching input_coords().

  • forcing (DataArray) –

    Atmosphere window means matching forcing_coords().

Yields:

  • DataArray –

    Cycles, starting with initialization's prediction.

load_default_package classmethod

load_default_package() -> Package

Default DLESyM model package, shared with the fused DLESyM.

load_model classmethod

load_model(
    package: Package,
    ocean_model_idx: int = 0,
    version: Literal["v1.0", "v1.1"] = "v1.1",
) -> PrognosticModel

Load the ocean component from package

Besides the ocean's own constants, this loads the normalization of the atmosphere variables the ocean is forced with: the forcing is means of atmosphere outputs, which the ocean normalizes with the atmosphere's output constants.

Parameters:

  • package (Package) –

    Package to load model from, the one DLESyM loads

  • ocean_model_idx (int, default: 0 ) –

    Index of ocean model weights to load, see DLESyM.load_model, by default 0

  • version (('v1.0', 'v1.1'), default: "v1.0" ) –

    Checkpoint version to load, see DLESyM.load_model, by default "v1.1"

Returns:

  • PrognosticModel –

    Ocean prognostic model

Examples using earth2studio.models.px.DLESyMOcean