# ESMValTool
# recipe_python_bergen.yml
---
documentation:
  description: |
    Example recipe that plots a map and timeseries of temperature.

  title: Recipe that runs an example diagnostic written in Python.

  authors:
    - andela_bouwe
    - righi_mattia

  maintainer:
    - schlund_manuel

  references:
    - acknow_project

  projects:
    - esmval
    - c3s-magic

datasets:
  - {dataset: NorESM2-LM, project: CMIP6, exp: historical, ensemble: r1i1p1f1, grid: gn}
  - {dataset: BCC-ESM1, project: CMIP6, exp: historical, ensemble: r1i1p1f1, grid: gn}
  - {dataset: NorESM1-M, project: CMIP5, exp: historical, ensemble: r1i1p1}
  - {dataset: CanESM2, project: CMIP5, exp: historical, ensemble: r1i1p1}

preprocessors:

  select_january:
    extract_month:
      month: 1

  annual_mean_bergen:
    extract_point:
      latitude: 60.389444
      longitude: 5.330000
      scheme: linear
    annual_statistics:
      operator: mean
    multi_model_statistics:
      statistics:
        - mean
      span: overlap

  annual_mean_global:
    area_statistics:
      operator: mean
      fx_variables:
        areacella:
    annual_statistics:
      operator: mean

diagnostics:

  map:
    description: Global map of temperature in January 2000.
    themes:
      - phys
    realms:
      - atmos
    variables:
      tas:
        mip: Amon
        preprocessor: select_january
        start_year: 2000
        end_year: 2000
    scripts:
      script1:
        script: examples/diagnostic.py
        quickplot:
          plot_type: pcolormesh
          cmap: Reds

  timeseries:
    description: Annual mean temperature in Bergen and global mean since 1850.
    themes:
      - phys
    realms:
      - atmos
    variables:
      tas_bergen:
        short_name: tas
        mip: Amon
        preprocessor: annual_mean_bergen
        start_year: 1850
        end_year: 2000
      tas_global:
        short_name: tas
        mip: Amon
        preprocessor: annual_mean_global
        start_year: 1850
        end_year: 2000
    scripts:
      script1:
        script: examples/diagnostic.py
        quickplot:
          plot_type: plot
