How esmvalgroup/esmvaltool works
Main Components
• Recipe Engine & Interface – Representing the “driver” of the tool. This is where users provide recipe files that specify input data, preprocessing steps, and the diagnostic routines.
• Preprocessing/Core Module – The integration with ESMValCore (used for CMORization, regridding, masking, and other scientific preprocessing operations). This module reads configuration files, environment settings (via YAML/conda/environment files), and handles data input.
• CMORizers & Data Downloaders – Under the esmvaltool/cmorizers directory you see modules that convert raw input data (CMIP3, CMIP5, CMIP6, re-analysis, obs datasets, etc.) into a common format along with downloaders and formatters.
• External Interfaces & Deployment – Indicate components like Dockerfiles, CI/CD pipelines (.github/workflows, .circleci), conda environment files, and configuration scripts that facilitate deployment, continuous testing (with tests/integration and tests/unit), and packaging (setup.py, pyproject.toml).
Relationships and Data Flow
• The Recipe Engine parses the recipe and triggers the preprocessor module (ESMValCore integration via esmvaltool/core functionality) to prepare the input data (using CMORizers and formatters).
• Once preprocessing is complete, the Control Flow branches into various Diagnostic Modules based on directives in the recipe. These modules may invoke code written in various languages.
• The output of each diagnostic is then aggregated and post-processed, with results being passed back to the recipe engine for final output.
• Testing/Continuous Integration runs (represented separately via the tests directory and CI configuration in .github/workflows and .circleci) ensure that the modules work as intended. These pipelines ensure compliance with style and proper functioning.
• Deployment components (docker, conda files, etc.) create an environment that bundles this modular structure together.
Architectural Patterns and Key Design Principles
• Modularity and Extensibility: The separation of concerns is explicit (input handling, preprocessing, diagnostics execution, and output postprocessing).
• Configuration-driven Execution: Recipes and configuration reference files drive the framework, decoupling the user’s inputs from the underlying mechanics.
• CI/CD & Reproducibility: The presence of Dockerfiles, conda environment configuration files, and several testing directories (integration and unit tests) emphasize a strong focus on continuous integration and reproducibility.
Technologies and Frameworks
• Python is the core language, serving as the “glue” for many of the modules.
• ESMValCore is integrated as the preprocessing engine.
• NCL and R are used for specific diagnostics and plotting scripts.
• Docker, conda and CI pipelines (GitHub Actions, CircleCI) are used to ensure a reproducible deployment environment.