climval¶
climval validates climate model output against reference data. It puts both
datasets on the same grid, period and units, computes weighted metrics with
xarray, lazily on dask arrays, and records how every number was made. A
configuration file and the climval check command turn the same comparison
into a pass or fail gate for continuous integration.
import climval
result = climval.compare(
era5, # reference: Dataset, DataArray, path or URL
cmip6_tas, # candidate, for example from intake-esm
variable=("t2m", "tas"),
region=climval.Box(lat=(35, 72), lon=(-10, 40)),
period=("1995", "2014"),
by="season",
)
result.to_dataframe()
result.check({"pearson_r": {"min": 0.95, "sample": "climatology"}})
What it is for¶
climval is the validation step between model output and a decision: a notebook that compares a run with a reanalysis, a pipeline that checks every new simulation, a pull request that must not make a model worse. It works on the data you already have open in Python, including Zarr stores in cloud object storage and intake-esm catalogues such as the Pangeo CMIP6 collection.
It is not a diagnostic suite. For recipe-driven, multi-diagnostic campaigns across CMIP ensembles use ESMValTool; for the standard PCMDI performance metrics use the PCMDI Metrics Package; for land model benchmarking use ILAMB. climval does one comparison of two datasets carefully and says exactly what it did.
Where to go next¶
- Getting started: install, the first comparison, the result object.
- Alignment: what each alignment step does and why.
- Samples and groups and Metrics: what each number is computed over, with formulas.
- Thresholds and the CI gate and the GitHub Action.
- ERA5 against CMIP6 over Europe: five CMIP6 models against ERA5, read anonymously from public cloud storage.
- Migrating from 0.1: what changed, including the defaults that change numbers.
climval is open source under the Apache License 2.0 and maintained by Northflow Technologies AS.