# ESMValTool
# recipe_mydiag.yml
---
documentation:
  description: |
    Create 2Dmap of maximum temperature in each profile.
    This is an example recipe for a personal diagnostic.
    You can run any Python diagnostic of your choice
    without installing ESMValTool as developer or git pushing.
    An example personal diagnostic can be found in
    esmvaltool/diag_scripts/examples/my_little_diagnostic.py

  authors:
    - unmaintained

  title: |
    Map of maximum temperature.
    Example recipe for running a user-written diagnostic, without installing
    ESMValTool as developer.

  maintainer:
    - unmaintained
    # Helene R. Langehaug

datasets:
#  - {dataset: MPI-ESM-LR, project: CMIP5, exp: historical, ensemble: r1i1p1}
#  - {dataset: NorESM1-M, project: CMIP5, exp: historical, ensemble: r1i1p1}
  - {dataset: MPI-ESM1-2-LR, project: CMIP6, mip: Omon, exp: [historical, ssp126], ensemble: r1i1p1f1, grid: gn, start_year: 1993, end_year: 2025}
  - {dataset: NorESM2-MM, project: CMIP6, mip: Omon, exp: [historical, ssp126], ensemble: r1i1p1f1, grid: gr, start_year: 1993, end_year: 2025}
  - {dataset: IPSL-CM6A-LR, project: CMIP6, mip: Omon, exp: [historical, ssp126], ensemble: r1i1p1f1, grid: gn, start_year: 1993, end_year: 2025}

  

  # --------------------------------------------------
  # Depth-profile preprocessors
  # --------------------------------------------------
preprocessors:
  prep_depth_max_1: # For a 2D map global profile
    custom_order: true
    annual_statistics:
      operator: mean
    axis_statistics:
      axis: z
      operator: max
    regrid:
      target_grid: 1x1
      scheme: linear
    climate_statistics:
      operator: mean
   # extract_region:  
   # convert_units:
   #   units: degrees_C

diagnostics:
  diag_map_2:
    description: Global Ocean Surface regridded map
    variables:
      profile_max_temp:
        short_name: thetao
        additional_datasets:
          - {dataset: WOA, project: OBS6, mip: Omon, tier: 2, type: clim, version: 2018}
        preprocessor: prep_depth_max_1
    scripts:
      Global_Ocean_Surface_regrid_map: &Global_Ocean_Surface_regrid_map
        script: ocean/diagnostic_maps.py

#diagnostics:
#  profile_max_map: # Remember to use underscore
#    description: "map of max temp in each profile"
#    variables:
#      profile_max_temp:
#        short_name: thetao
#        preprocessor: prep_depth_max_1
#    scripts:
#      myscript:
#        script: ~/esmvaltool_workshop/mydiag.py
