Pullback Dynamic Mode Decomposition with control (PullbackDMDc) decomposes spatiotemporal climate data into forced and internal variability components by fitting a linear stochastic dynamical system with external forcing and estimating its pullback attractor.
This repo contains the code used to produce paper figures from PullbackDMDc, LIM, and linear-regression baselines.
@misc{mankovich2026pullbackdmdc,
title={Disentangling Forced and Internal Climate Variability in Single Realizations using Dynamic Mode Decomposition with Control},
author={Nathan Mankovich and Andrei Gavrilov and Gustau Camps-Valls},
year={2026},
eprint={2607.18298},
archivePrefix={arXiv},
primaryClass={stat.ML},
url={https://arxiv.org/abs/2607.18298},
}
Create and activate the environment:
conda env create -f dmdc_variants.yml
conda activate dmdc_variantsIf your environment name differs, use the name specified in dmdc_variants.yml.
See getting_started_pullbackdmdc.ipynb for a runnable walkthrough of:
- fitting
PullbackDMDcon synthetic data, - obtaining forced-response estimations,
- computing rotated modes,
- and serializing a fitted model object.
The model class implementation is in utils/pullback_dmdc.py. For import consistency, use:
from utils.pullback_dmdc import PullbackDMDc
model = PullbackDMDc(...)Taylor diagram workflow details are documented in evaluation/utils/README.md.
data_preparation/: preprocessing utilities and EOF generation used by downstream evaluation.evaluation/: scripts that compute intermediate metrics and produce paper figure files.evaluation_results/: output directory for generated plots and intermediate files.utils/: model implementations and shared data-loading logic.downloads/: dataset download and preprocessing helpers.downloads/models_gdex/: GDEX scripts for MMLEA model members (tas/psl).downloads/obs_20cr_v3/: NOAA PSL 20CRv3 observational downloads and regridding helper.
dmdc_variants.yml: conda environment definition.
The workflow expects data under PBDMDC_DATA_ROOT (defaults to /data/databases/dmdc-variants/mmlea_v2/).
- Download MMLEA model ensembles:
sbatch downloads/models_gdex/run_download.slurm- Download 20CRv3 observational products:
bash downloads/obs_20cr_v3/download.sh- Regrid and format 20CRv3 to match model grid/time range:
python -m downloads/obs_20cr_v3/regrid_downloaded_dataSee downloads/README.md for details and expected output layout.
The retained figure generation path is:
- Prepare data and EOF artifacts:
python -m data_preparation.interpolate_full_forcing
python -m data_preparation.compute_means
python -m data_preparation.compute_eofs
python -m data_preparation.create_tas_ocean- Fit models (lag-3 all-time and tier1):
python experiments.py- Compute intermediate metrics used by plotting scripts:
python -m evaluation.compute_taylor_vis
python -m evaluation.compute_trend_taylor_viz
python -m evaluation.compute_gm_timeseries
python -m evaluation.compute_acfs- Generate paper figures in
evaluation_results/:
python -m evaluation.plot_taylor_vis
python -m evaluation.plot_gm_timeseries
python -m evaluation.plot_modes
python -m evaluation.eig_vis_circle
python -m evaluation.plot_decay_frequency
python -m evaluation.plot_mode_selection
python -m evaluation.plot_mode_summary_three_rows
python -m evaluation.plot_psd_mtm
python -m evaluation.plot_timescale_vs_forced_summary
python -m evaluation.plot_acf_summary
python -m evaluation.B_vis_smallNotes:
- Main scripts read data/output roots from
PBDMDC_DATA_ROOT,PBDMDC_ARTIFACT_ROOT, andPBDMDC_PDF_ROOT(seeutils/params.pyandslurm/*.sbatch). - Model/pickle-producing scripts were intentionally preserved (for example
data_preparation.compute_eofs,evaluation.compute_*).
Example environment setup:
export PBDMDC_DATA_ROOT=/data/databases/dmdc-variants/mmlea_v2/
export PBDMDC_ARTIFACT_ROOT=/data/users/nate/PullbackDMDc
export PBDMDC_PDF_ROOT=/data/users/nate/PullbackDMDc/pdfFor cluster execution, use the ordered submission wrapper:
bash slurm/submit_pipeline.shThis submits:
slurm/00_prepare_artifacts.sbatchslurm/01_fit_models.sbatchslurm/02_compute_metrics.sbatchslurm/03_plot_main.sbatchslurm/04_plot_tier1.sbatch
with dependencies so fitting runs before metrics, and both plotting jobs run after metrics.
Nathan Mankovich nathan.mankovich@uv.es
Andrei Gavrilov andrei.gavrilov@uv.es
