# 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:
# working datasets
# CMIP5
   - {dataset: NorESM2-MM,  project: CMIP6,  exp: historical,  ensemble: r1i1p1f1,  grid: gr, start_year: 1995,  end_year: 2004}
#   - {dataset: NorESM2-LM,  project: CMIP6,  exp: historical,  ensemble: r1i1p1f1,  grid: gn, start_year: 1995,  end_year: 2004}
#   - {dataset: CanESM2,       project: CMIP5,  exp: historical,  ensemble: r1i1p1,  start_year: 1995,  end_year: 2004}
#   - {dataset: CESM1-BGC,     project: CMIP5,  exp: historical,  ensemble: r1i1p1,  start_year: 1995,  end_year: 2004}
#   - {dataset: CESM2,     project: CMIP6,  exp: historical,  ensemble: r1i1p1,  start_year: 1995,  end_year: 2004}
#   - {dataset: IPSL-CM5A-LR,  project: CMIP5,  exp: historical,  ensemble: r1i1p1,  start_year: 1995,  end_year: 2004}
#   - {dataset: IPSL-CM5A-MR,  project: CMIP5,  exp: historical,  ensemble: r3i1p1,  start_year: 1995,  end_year: 2004}
#   - {dataset: IPSL-CM5B-LR,  project: CMIP5,  exp: historical,  ensemble: r1i1p1,  start_year: 1995,  end_year: 2004}
#   - {dataset: IPSL-CM6A-LR,  project: CMIP5,  exp: historical,  ensemble: r1i1p1,  start_year: 1995,  end_year: 2004}
#   - {dataset: HadGEM2-ES,    project: CMIP5,  exp: historical,  ensemble: r1i1p1,  start_year: 1995,  end_year: 2004}
#   - {dataset: CNRM-CM5,      project: CMIP5,  exp: historical,  ensemble: r1i1p1,  start_year: 1995,  end_year: 2004}
#   - {dataset: CNRM-ESM2-1,      project: CMIP5,  exp: historical,  ensemble: r1i1p1,  start_year: 1995,  end_year: 2004}
#   - {dataset: HadGEM2-CC,    project: CMIP5,  exp: historical,  ensemble: r1i1p1,  start_year: 1995,  end_year: 2004}
#   - {dataset: CMCC-CESM,     project: CMIP5,  exp: historical,  ensemble: r1i1p1,  start_year: 1995,  end_year: 2004}
#   - {dataset: GFDL-ESM2M,    project: CMIP5,  exp: historical,  ensemble: r1i1p1,  start_year: 1995,  end_year: 2004}
#   - {dataset: MPI-ESM-LR,    project: CMIP5,  exp: historical,  ensemble: r1i1p1,  start_year: 1995,  end_year: 2004}
#   - {dataset: MPI-ESM-MR,    project: CMIP5,  exp: historical,  ensemble: r3i1p1,  start_year: 1995,  end_year: 2004}
#   - {dataset: MPI-ESM-HR,    project: CMIP5,  exp: historical,  ensemble: r3i1p1,  start_year: 1995,  end_year: 2004}
#   - {dataset: MRI-ESM1,      project: CMIP5,  exp: historical,  ensemble: r1i1p1,  start_year: 1995,  end_year: 2004}
#   - {dataset: MRI-ESM2-0,      project: CMIP5,  exp: historical,  ensemble: r1i1p1,  start_year: 1995,  end_year: 2004}
#   - {dataset: NorESM1-ME,    project: CMIP5,  exp: historical,  ensemble: r1i1p1,  start_year: 1995,  end_year: 2004}
#   - {dataset: GISS-E2-H-CC,  project: CMIP5,  exp: historical,  ensemble: r1i1p1,  start_year: 1995,  end_year: 2004}
#   - {dataset: MIROC-ESM,     project: CMIP5,  exp: historical,  ensemble: r1i1p1,  start_year: 1995,  end_year: 2004}
#   - {dataset: MIROC-ES2L,     project: CMIP5,  exp: historical,  ensemble: r1i1p1,  start_year: 1995,  end_year: 2004}
#   - {dataset: ACCESS1-3,    project: CMIP5,  exp: historical,  ensemble: r1i1p1,  start_year: 2001,  end_year: 2004}
#   - {dataset: UKESM1-0-LL,   grid: gn, project: CMIP6,  exp: historical,  ensemble: r1i1p1f2,  start_year: 1950,  end_year: 2014}

# --------------------------------------------------
SELECT_REGION: &select_region 
   - { start_longitude: -140., end_longitude: -68., start_latitude:  -60., end_latitude: 20. } # South east Pacific
   #- { start_longitude: 324., end_longitude: 357., start_latitude:  30., end_latitude: 57. } # EU Atlantic
   #- { start_longitude: -12., end_longitude:  38., start_latitude: 29.5, end_latitude: 48. } # Mediterranean
   #- { start_longitude:   0., end_longitude: 360., start_latitude:  60., end_latitude: 90. } # Arctic

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

# Select level for 3D variable
# --------------------------------------------------
SELECT_LEVEL: &select_level
   - {levels:  [0.,] , 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
    extract_region:
      <<: *select_region

  prep_map_3D:
    custom_order: true
    extract_time:
      <<: *select_clima
    extract_levels:
      <<: *select_level
    climate_statistics:
      operator: mean
    regrid:
      target_grid: 1x1
      scheme: linear
    extract_region:
      <<: *select_region

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

  # --------------------------------------------------
  # Map diagnostics vs OBS
  # --------------------------------------------------
#  diag_surface_multimap:
#    description: Global Ocean Surface maps vs OBS
#    variables:
#      fgco2:
#        preprocessor: prep_map_2D
#        mip: Omon
#        maps_range: [-0.12, 0.12]
#        diff_range: [-0.09, 0.09]
#        layout_rowcol: [4, 4]
#    additional_datasets:
#      - {dataset: Landschuetzer2016,  project: OBS,  type: clim,  version: v2016,  start_year: 1995,  end_year: 2014,  tier: 2}
#    scripts:
#      Global_Ocean_multi_vs_obs:
#        script: ocean/diagnostic_maps_multimodel.py
#        observational_dataset: {dataset: Landschuetzer2016, project: OBS}

#  maps_intpp:
#    description: Ocean surface maps of primary production
#    variables:
#      intpp:
#        preprocessor: prep_map_2D
#        mip: Omon
#        plot_ccrs: PlateCarree
#        additional_datasets:
#         - {dataset: Eppley-VGPM-MODIS,  project: OBS,  type: sat,  version: R2018,  start_year: 2004,  end_year: 2014,  tier: 2}
#    scripts:
#      model_vs_obs:
#        script: ocean/diagnostic_maps_multimodel.py
#        observational_dataset: {dataset: Eppley-VGPM-MODIS, project: OBS}

  maps_woa:
    description: Ocean Surface maps vs OBS
    variables:
#      no3:
#        preprocessor: prep_map_3D
#        mip: Oyr
#        plot_ccrs: PlateCarree
#        additional_datasets:
#          - {dataset: WOA,  project: OBS,  type: clim, version: 2013v2,  start_year: 2000,  end_year: 2000,  tier: 2}
      thetao:
        preprocessor: prep_map_3D
        mip: Omon
        plot_ccrs: PlateCarree
        layout_rowcol: [2, 2]
        additional_datasets:
          - {dataset: WOA,  project: OBS,  type: clim, version: 2013v2,  start_year: 2000,  end_year: 2000,  tier: 2}
#      o2:
#        preprocessor: prep_map_2D
#        mip: Omon
#        plot_ccrs: PlateCarree
#        additional_datasets:
#          - {dataset: WOA,  project: OBS,  type: clim, version: 2013v2,  start_year: 2000,  end_year: 2000,  tier: 2}
    scripts:
      model_vs_obs:
        script: ocean/diagnostic_maps_multimodel.py
        observational_dataset: {dataset: WOA, project: OBS}
