<a id="recipes-schlund20jgr"></a>

# Legacy recipe: Constraining uncertainty in projected gross primary production (GPP) with machine learning

#### NOTE
This recipe has been retired and moved to the folder “archive”. This recipe is only included
for documentation purposes and not maintained any more. The last known ESMValTool version
supporting this recipe is version 2.12.0.

#### WARNING
Not all datasets necessary to run these recipes are available on ESGF.
The following datasets are missing:

* Dataset: co2, Amon, CMIP5, HadGEM2-ES, esmHistorical, r1i1p1
* Dataset: gpp, Lmon, CMIP5, MIROC-ESM, esmFixClim1, r1i1p1
* Supplementary: sftlf, fx, CMIP5, MIROC-ESM, esmFixClim1, r0i0p0

## Overview

These recipes reproduce the analysis of [Schlund et al., JGR: Biogeosciences
(2020)](https://doi.org/10.1029/2019JG005619). In this paper, a machine learning regression (MLR) approach (using
the MLR algorithm [Gradient Boosted Regression Trees, GBRT](https://scikit-learn.org/stable/modules/ensemble.html#gradient-tree-boosting)) is proposed to
constrain uncertainties in projected gross primary production (GPP) in the RCP
8.5 scenario using observations of process-based diagnostics.

## Recipes and diagnostics

Recipes are stored in archive/legacy_recipes/

* schlund20jgr/recipe_schlund20jgr_gpp_abs_rcp85.yml
* schlund20jgr/recipe_schlund20jgr_gpp_change_1pct.yml
* schlund20jgr/recipe_schlund20jgr_gpp_change_rcp85.yml

Diagnostics are stored in archive/legacy_diag_scripts/

* mlr/evaluate_residuals.py
* mlr/main.py
* mlr/mmm.py
* mlr/plot.py
* mlr/postprocess.py
* mlr/preprocess.py
* mlr/rescale_with_emergent_constraint.py

## Variables

* *co2s* (atmos, monthly, longitude, latitude, time)
* *gpp* (land, monthly, longitude, latitude, time)
* *gppStderr* (land, monthly, longitude, latitude, time)
* *lai* (land, monthly, longitude, latitude, time)
* *pr* (atmos, monthly, longitude, latitude, time)
* *rsds* (atmos, monthly, longitude, latitude, time)
* *tas* (atmos, monthly, longitude, latitude, time)

## Observations and reformat scripts

* [CRU](https://crudata.uea.ac.uk/cru/data/hrg/cru_ts_4.02/cruts.1811131722.v4.02/) (*pr*, *tas*)
* [ERA-Interim](https://cds.climate.copernicus.eu/stac-browser/collections/reanalysis-era-interim?.language=en) (*rsds*)
* LAI3g (*lai*)
* [MTE](http://www.bgc-jena.mpg.de/geodb/BGI/Home) (*gpp*, *gppStderr*)
* [Scripps-CO2-KUM](https://scrippsco2.ucsd.edu/data/atmospheric_co2/kum.html) (*co2s*)

## References

* Schlund, M., Eyring, V., Camps‐Valls, G., Friedlingstein, P., Gentine, P., &
  Reichstein, M. (2020). Constraining uncertainty in projected gross primary
  production with machine learning. Journal of Geophysical Research:
  Biogeosciences, 125, e2019JG005619,
  [https://doi.org/10.1029/2019JG005619](https://doi.org/10.1029/2019JG005619).

## Example plots

<a id="fig-schlund20jgr-1"></a>
![image](recipes/figures/schlund20jgr/map_prediction_output___GBRT_change.png)

<a id="fig-schlund20jgr-2"></a>
![image](recipes/figures/schlund20jgr/map_prediction_output_error___GBRT_change.png)

<a id="fig-schlund20jgr-3"></a>
![image](recipes/figures/schlund20jgr/map_prediction_output___GBRT_abs.png)

<a id="fig-schlund20jgr-4"></a>
![image](recipes/figures/schlund20jgr/map_prediction_output_error___GBRT_abs.png)

<a id="fig-schlund20jgr-5"></a>
![image](recipes/figures/schlund20jgr/rmse_plot.png)

<a id="fig-schlund20jgr-6"></a>
![image](recipes/figures/schlund20jgr/feature_importance.png)

<a id="fig-schlund20jgr-7"></a>
![image](recipes/figures/schlund20jgr/residuals_distribution.png)

<a id="fig-schlund20jgr-8"></a>
![image](recipes/figures/schlund20jgr/training_progress.png)
