# IMPORTANT: This is recipe is not intended to represent a real workflow: it is only a template showcasing ALL available options.
Description:
  Author: N.Pérez-Zanón
  Info: # Complete recipe containing all possible fields.
Analysis:
  Horizon: subseasonal # Mandatory, str: 'seasonal', or 'decadal'. Subseasonal is in development
  Variables:
    # name: variable name(s) in the /esarchive (Mandatory, str)
    # freq: 'monthly_mean', 'daily' or 'daily_mean' (Mandatory, str)
    # units: desired data units for each variable. Only available for temperature,
    #   precipitation, and pressure variables.
    - {name: 'tas', freq: 'weekly_mean', units: 'C'}
#    name: 'tas'
#    freq: 'weekly_mean'
#    units: 'C'
    # To request more variables to be divided in atomic recipes, add them this way:
#    - {name: 'prlr', freq: 'weekly_mean', units: 'mm'}
#    - {name: 'sfcWind', freq: 'weekly_mean', units: 'm s-1'}
#    - {name: 'rsds', freq: 'weekly_mean', units: 'W m-2'}
    # To request multiple variables *in the same* atomic recipe, add them this way:
    #   - {name: 'tas, prlr, sfcWind, rsds', freq: 'weekly_mean', units: {tas: 'C', prlr: 'mm', sfcWind: 'm s-1', rsds:'W m-2'}}
  Datasets:
    System:
      # name: System name (Mandatory, str)
      # member: 'all' or individual members, separated by a comma and in quotes (decadal only, str)
      - {name: 'NCEP-CFSv2', member: 'all'}
      # To request more Systems to be divided in atomic recipes, add them this way:
      #  - {name: 'Meteo-France-System7'}
    Multimodel:
      execute: no # Either yes/true or no/false (Mandatory, bool)
      approach: pooled # Multimodel computation approach. 'pooled' currently the only option (str)
      createFrom: Anomalies # Which module should the anomalies be created from (str)
    Reference:
      - {name: 'ERA5'} # Reference name (Mandatory, str)
      # To request more References to be divided into atomic recipes, add them this way:
      # - {name: 'ERA5Land'}
  Time:
    sdate: 2023 #%Y%m%d # Cambiar a 2023
      #- '1201' # Start date, 'mmdd' (Mandatory, int)
      # To request more startdates to be divided into atomic recipes, add them this way:
      # - '0101'
      # - '0201'
      # ...
    fcst_year: #20231207 # Forecast initialization year 'YYYY' (Optional, int)
    hcst_start: '1999' # Hindcast initialization start year 'YYYY' (Mandatory, int)
    hcst_end: '2016' # Hindcast initialization end year 'YYYY' (Mandatory, int)
    ftime_min: 1 # First forecast time step in months. Starts at “1”. (Mandatory, int)
    ftime_max: 4 # Last forecast time step in months. Starts at “1”. (Mandatory, int)
    week_day: Thursday
    sweek_window: 9
    sday_window: 3
  Region:
   # latmin: minimum latitude (Mandatory, int)
    # latmax: maximum latitude (Mandatory, int)
    # lonmin: # minimum longitude (Mandatory, int)
    # lonmax: # maximum longitude (Mandatory, int)
    #- {name: global, latmin: -90, latmax: 90, lonmin: 0, lonmax: 359.9}
    # To request more regions to be divided in atomic recipes, add them this way:
    # {name: "Nino34", latmin: -5, latmax: 5, lonmin: -10, lonmax: 60}
    - {name: "Kuwait", latmin: 28, latmax: 31, lonmin: 46, lonmax: 49}    
    #- {name: "Iberia", latmin: 36, latmax: 44, lonmin: -10, lonmax: 5}
    # - {name: "EU", latmin: 20, latmax: 80, lonmin: -20, lonmax: 40}
  Regrid:
    method: bilinear # Interpolation method (Mandatory, str)
    type: "conf/grid_description/griddes_system51c3s.txt" # Interpolate to: 'to_system', 'to_reference', 'none',
                    # or CDO-accepted grid. (Mandatory, str)
  Workflow:
    # This is the section of the recipe where the parameters for each module are specified
    Time_aggregation:
      execute: no
    Calibration:
      method: evmos # Calibration method. (Mandatory, str)
      save: 'all' # Options: 'all', 'none', 'exp_only', 'fcst_only' (Mandatory, str) 
    Skill:
      metric: mean_bias rpss enscorr # List of skill metrics separated by spaces or commas. (Mandatory, str)
      save: 'none' # Options: 'all', 'none' (Mandatory, str)
    Statistics:
      metric: cov std var n_eff # List of statistics separated by spaces or commas. (Mandatory, str)
      save: 'all' # Options: 'all', 'none' (Mandatory, str)
    Probabilities:
      # percentiles: [[1/3, 2/3], [1/10, 9/10], [1/4, 2/4, 3/4]] # Thresholds
      percentiles: [[1/3, 2/3]]
      # for quantiles and probability categories. Each set of thresholds should be
      # enclosed within brackets. For now, they are INDEPENDENT from skill metrics. (Optional)
      save: 'percentiles_only' # Options: 'all', 'none', 'bins_only', 'percentiles_only' (Mandatory, str)
    Visualization:
      plots: skill_metrics # Types of plots to generate (Optional, str)
      multi_panel: no # Multi-panel plot or single-panel plots. Default is 'no/false'. (Optional, bool)
      projection: 'cylindrical_equidistant' # Options: 'cylindrical_equidistant', 'robinson', 'lambert_europe'. Default is cylindrical equidistant. (Optional, str)
      mask_terciles: no # Whether to mask the non-significant points by rpss in the most likely tercile plot. yes/true, no/false or 'both'. Default is no/false. (Optional, str)
      dots_terciles: yes # Whether to dot the non-significant by rpss in the most likely tercile plot. yes/true, no/false or 'both'. Default is no/false. (Optional, str)
      mask_ens: no # Whether to mask the non-significant points by rpss in the forecast ensemble mean plot. yes/true, no/false or 'both'. Default is no/false. (Optional, str)
      file_format: 'PNG' # Final file format of the plots. Formats available: PNG, JPG, JPEG, EPS. Defaults to PDF.
    Scorecards:
      execute: no # yes/no
      regions:
        # Mandatory: Define regions for which the spatial aggregation will be performed.
        # The regions must be included within the area defined in the 'Analysis:Region' section.
        Iberia: {lon.min: -10, lon.max: 5, lat.min: 36, lat.max: 44}
        #Extra-tropical NH:  {lon.min: 0,  lon.max: 360, lat.min: 30, lat.max: 90}
        #Tropics: {lon.min: 0,  lon.max: 360, lat.min: -30, lat.max: 30}
        #Extra-tropical SH : {lon.min: 0,  lon.max: 360, lat.min: -90, lat.max: -30}
      start_months: 1, 2, 3 # Mandatory, int: start months to visualise in scorecard table. Options: 'all' or a sequence of numbers.
      metric: mean_bias enscorr rpss crpss enssprerr # Mandatory: metrics to visualise in scorecard table
      metric_aggregation: 'score' # Mandatory, str: level of aggregation for skill scores. Options: 'score' or 'skill'
      inf_to_na: True # Optional, bool: set inf values in data to NA, default is no/False
      table_label: NULL # Optional, str: extra information to add in scorecard table title
      fileout_label: NULL # Optional, str: extra information to add in scorecard output filename
      col1_width: NULL # Optional, int: to adjust width of first column in scorecards table
      col2_width: NULL # Optional, int: to adjust width of second column in scorecards table
      calculate_diff: False # Mandatory, bool: True/False
  ncores: 9  # Number of cores to be used in parallel computation.
             # If left empty, defaults to 1. (Optional, int)
  remove_NAs: yes # Whether to remove NAs.
                   # If left empty, defaults to no/false. (Optional, bool)
  Output_format: 'Scorecards' # 'S2S4E' or 'Scorecards'. Determines the format of the output. Default is 'S2S4E'.
Run:
  filesystem: gpfs # Name of the filesystem as defined in the archive configuration file
  Loglevel: INFO # Minimum category of log messages to display: 'DEBUG', 'INFO', 'WARN', 'ERROR' or 'FATAL'. 
                 # Default value is 'INFO'. (Optional, str)
  Terminal: yes  # Optional, bool: Whether to display log messages in the terminal.
                 # Default is yes/true.
  output_dir: /home/bsc/bsc032339/ # Output directory. Must have write permissions. (Mandatory, str)
  code_dir: /home/bsc/bsc032339/sunset/ # Directory where the code is stored. Is used when launching jobs (not running interactively)
  autosubmit: no # Whether or not to run with Autosubmit. Only for non-atomic recipes (not running interactively)
  # fill only if using autosubmit

