Skip to content

AIFS2ENS

GlobalMRF202640 GBECMWFPyTorch

Import path: earth2studio.models.px.AIFS2ENS

View source on GitHub View install commands

Documentation

Bases: Module, AutoModelMixin, PrognosticMixin

Artificial Intelligence Forecasting System Ensemble version 2 (AIFS ENS v2), a data driven ensemble forecast model developed by the European Centre for Medium-Range Weather Forecasts (ECMWF). AIFS ENS v2 is based on a graph neural network (GNN) encoder and decoder, and a sliding window transformer processor. It extends AIFS ENS v1 with wave forecasting capabilities, improved stratospheric representation (10 hPa level), and snow cover. The ensemble model incorporates inherent stochasticity through noise conditioning, producing different forecasts for the same initial conditions.

Note

Key features of AIFS ENS v2:

  • Ensemble model with inherent stochasticity (noise conditioning)
  • New wave component with 11 wave variables
  • New snow variable (snowc - snow coverage)
  • Extended pressure levels to 10 hPa

It is recommended to use the IFS data source to prepare model inputs given the variable set required.

Note

For additional information see the following resources:

Parameters:

  • model (Module) –

    Core PyTorch module with the pretrained AIFS ENS v2 weights loaded.

  • latitudes (Tensor) –

    Latitude values for the native octahedral grid, registered as a buffer for interpolation.

  • longitudes (Tensor) –

    Longitude values for the native octahedral grid, registered as a buffer for interpolation.

  • interpolation_matrix (Tensor) –

    CSR sparse matrix mapping ERA5 lat/lon inputs onto the octahedral grid.

  • inverse_interpolation_matrix (Tensor) –

    CSR sparse matrix mapping outputs from the octahedral grid back to ERA5 lat/lon.

  • invariants (Tensor) –

    Tensor of shape [5, 721, 1440] containing the invariant fields "lsm", "sdor", "slor", "z", and "wmb" (model bathymetry). Empty if preload_invariants=False.

  • preload_invariants (bool, default: True ) –

    If True, invariant fields are fetched from IFS at load time and cached. If False, invariant fields must be provided as input variables, enabling use of invariants from alternative sources for exact reproducibility, by default True.

Warning

We encourage users to familiarize themselves with the license restrictions of this model's checkpoints.

__call__

__call__(x: DataArray) -> DataArray

Sample a six-hour forecast from two input frames, without hooks.

Parameters:

  • x (DataArray) –

    Initial history matching input_coords().

Returns:

  • DataArray –

    First sampled forecast matching output_coords(x).

create_iterator

create_iterator(
    x: DataArray,
) -> Generator[DataArray, None, None]

Yield six-hour forecasts while retaining explicit native-grid history.

Parameters:

  • x (DataArray) –

    Initial history matching input_coords().

Yields:

  • DataArray –

    Forecasts starting with initialization's prediction. The rear hook runs before every yield and the front hook before subsequent steps.

load_default_package classmethod

load_default_package() -> Package

Load prognostic package

load_model classmethod

load_model(
    package: Package, preload_invariants: bool = True
) -> PrognosticModel

Load prognostic from package

Parameters:

  • package (Package) –

    Model package to load from

  • preload_invariants (bool, default: True ) –

    If True, invariant fields (lsm, sdor, slor, z, wmb) are fetched from IFS at load time and cached. If False, these fields must be provided as input variables, allowing use of invariants from alternative sources (e.g., ECMWF Open Data) for exact reproducibility with reference implementations, by default True.

Returns:

  • PrognosticModel –

    Loaded AIFS2ENS model