# ESMValTool
# recipe_ocean_multimap.yml
---
documentation:
  description: |
    Recipe to evaluate multiple model bias against a reference dataset
    Written by Tomas Lovato, CMCC, tomas.lovato@cmcc.it

  authors:
    - lovato_tomas
  
  maintainer:
    - lovato_tomas

  references:
    - acknow_project

  projects:
    - crescendo

# --------------------------------------------------
# Datasets
# --------------------------------------------------
DATASET_ANCHOR_TO: &datasets_fgco2
   - {dataset: NorESM2-LM, project: CMIP6, exp: historical, ensemble: "r1i1p1f1", grid: gn, start_year: 2001, end_year: 2010}
   - {dataset: NorESM2-MM, project: CMIP6, exp: historical, ensemble: "r1i1p1f1", grid: gn, start_year: 2001, end_year: 2010}
   - {dataset: NorESM2-MM, project: KeyCLIM, exp: hist-piAerOxid, ensemble: r1i1p1f1, grid: gn, start_year: 2001, end_year: 2010}
   - {dataset: NorESM2-MM, project: KeyCLIM, exp: hist-snow, ensemble: r1i1p1f1, grid: gn, start_year: 2001, end_year: 2010}
   - {dataset: NorESM2-MM, project: KeyCLIM, exp: hist-cloud, ensemble: r1i1p1f1, grid: gn, start_year: 2001, end_year: 2010}
#   - {dataset: NorESM2-MM, project: KeyCLIM, exp: hist-iceSheet, ensemble: r1i1p1f1, grid: gn, start_year: 2001, end_year: 2010}
   - {dataset: Landschuetzer2016,  project: OBS,  type: clim,  version: v2016,  start_year: 2001,  end_year: 2010,  tier: 2}

# Climatological time window selection
# --------------------------------------------------
SELECT_CLIMA: &select_clima
   - { start_year: 2001, start_month: 1, start_day: 1, end_year: 2010, end_month: 12, end_day: 31 }

# Select level for 3D variable
# --------------------------------------------------
#SELECT_LEVEL: &select_level
#   - {levels:  [0.,100.,500.,1000.,1500.] , scheme: linear_horizontal_extrapolate_vertical}

# --------------------------------------------------
# Preprocessors
# --------------------------------------------------
preprocessors:
  # --------------------------------------------------
  # MAP preprocessors
  # --------------------------------------------------
  prep_map_2D:
    custom_order: true
    extract_time:
      <<: *select_clima
    climate_statistics:
      operator: mean
    regrid:
      target_grid: 1x1
      scheme: linear

# --------------------------------------------------
# Diagnostics
# --------------------------------------------------
diagnostics:

  maps_Landschutzer_fgco2:
    description: Ocean maps vs OBS
    additional_datasets: *datasets_fgco2
    variables:
      fgco2:
        preprocessor: prep_map_2D
        mip: Omon
        plot_ccrs: PlateCarree
        layout_rowcol: [2, 3]
        diff_range: [-0.08, 0.08]

    scripts:
      model_vs_obs:
        script: ocean/diagnostic_maps_multimodel_KeyCLIM.py
        observational_dataset: {dataset: Landschuetzer2016, project: OBS}



