diff --git a/recipes/recipe_decadal_split.yml b/recipes/recipe_decadal_split.yml new file mode 100644 index 0000000000000000000000000000000000000000..708037f75dea5828e3574afb29e7482815ab0d83 --- /dev/null +++ b/recipes/recipe_decadal_split.yml @@ -0,0 +1,61 @@ +Description: + Author: Carlos Delgado Torres + Info: Test for spliting a decadal recipe (two variables) +Analysis: + Horizon: Decadal + Variables: + - {name: tas, freq: monthly_mean} + - {name: pr, freq: monthly_mean} + Datasets: + System: + name: EC-Earth3-i4 + member: r1i4p1f1,r2i4p1f1 + Multimodel: no + Reference: + name: JRA-55 + Time: + fcst_year: + hcst_start: 2015 # 2015-2016 in dcppA, 2017-2018 in dcppB + hcst_end: 2018 +# season: 'Annual' + ftime_min: 6 # Apr + ftime_max: 8 + Region: + - {latmin: -5, latmax: 5, lonmin: -5, lonmax: 5} + Regrid: + method: bilinear + type: to_system + Workflow: + Anomalies: + compute: no + cross_validation: + Calibration: + method: 'bias' + Skill: + metric: EnsCorr RPSS + Probabilities: + percentiles: [[1/3, 2/3]] + Indicators: + index: FALSE + ncores: 8 # Optional, int: number of cores, defaults to 1 + remove_NAs: FALSE # Optional, bool: Whether NAs are removed, defaults to FALSE + Output_format: S2S4E +Run: + Loglevel: INFO + Terminal: yes + filesystem: esarchive + output_dir: /esarchive/scratch/cdelgado/auto-s2s_logs/ + code_dir: /esarchive/scratch/cdelgado/gitlab/auto-s2s/ + autosubmit: yes + # fill only if using autosubmit + auto_conf: + script: /esarchive/scratch/cdelgado/gitlab/cdelgado_copernicus/ESS_evaluation_tool/main_decadal.R + expid: a5tx ## if left empty, create new exp? + hpc_user: bsc32924 # your hpc username + wallclock: 01:00 # hh:mm + processors_per_job: 8 # use ncores parameter? + platform: nord3v2 # make this constant? + email_notifications: yes # enable/disable email notifications + email_address: carlos.delgado@bsc.es # email address for notifications + notify_completed: yes # notify me by email when a job finishes + notify_failed: yes # notify me by email when a job fails diff --git a/tools/divide_recipe.R b/tools/divide_recipe.R index 403304c433c2b270673316c68de9018c71a4866e..8bbe48facf11b2206d717a76036770594c8bb1a2 100644 --- a/tools/divide_recipe.R +++ b/tools/divide_recipe.R @@ -35,35 +35,52 @@ divide_recipe <- function(recipe) { # duplicate recipe by Datasets: # check Systems - if (recipe$Analysis$Datasets$Multimodel) { + if (recipe$Analysis$Datasets$Multimodel %in% c(TRUE,'both')) { for (reci in 1:length(all_recipes)) { all_recipes[[reci]]$Analysis$Datasets <- - list(System = recipe$Analysis$Datasets$System, - Multimodel = recipe$Analysis$Datasets$Multimodel, - Reference = NULL) + list(System = recipe$Analysis$Datasets$System, + Multimodel = recipe$Analysis$Datasets$Multimodel, + Reference = NULL) } } else { - for (sys in 1:length(recipe$Analysis$Datasets$System)) { - for (reci in 1:length(all_recipes)) { - all_recipes[[reci]]$Analysis$Datasets <- - list(System = recipe$Analysis$Datasets$System[[sys]], - Multimodel = recipe$Analysis$Datasets$Multimodel, - Reference = NULL) + if (tolower(recipe$Analysis$Horizon) == 'seasonal') { + for (sys in 1:length(recipe$Analysis$Datasets$System)) { + for (reci in 1:length(all_recipes)) { + all_recipes[[reci]]$Analysis$Datasets <- + list(System = recipe$Analysis$Datasets$System[[sys]], + Multimodel = recipe$Analysis$Datasets$Multimodel, + Reference = NULL) + } + if (sys == 1) { + recipes <- all_recipes + } else { + recipes <- append(recipes, all_recipes) + } } - if (sys == 1) { - recipes <- all_recipes - } else { - recipes <- append(recipes, all_recipes) + } else if (tolower(recipe$Analysis$Horizon) == 'decadal') { + for (sys in 1:length(recipe$Analysis$Datasets$System$name)) { + for (reci in 1:length(all_recipes)) { + all_recipes[[reci]]$Analysis$Datasets <- + list(System = list(name = recipe$Analysis$Datasets$System$name[[sys]], + member = recipe$Analysis$Datasets$System$member[[sys]]), + Multimodel = recipe$Analysis$Datasets$Multimodel, + Reference = NULL) + } + if (sys == 1) { + recipes <- all_recipes + } else { + recipes <- append(recipes, all_recipes) + } } - } + } # Rest of horizons all_recipes <- recipes rm(list = 'recipes') } # check References - for (ref in 1:length(recipe$Analysis$Datasets$Reference)) { + for (ref in 1:length(recipe$Analysis$Datasets$Reference$name)) { for (reci in 1:length(all_recipes)) { - all_recipes[[reci]]$Analysis$Datasets$Reference <- - recipe$Analysis$Datasets$Reference[[ref]] + all_recipes[[reci]]$Analysis$Datasets$Reference$name <- + recipe$Analysis$Datasets$Reference$name[[ref]] } if (ref == 1) { recipes <- all_recipes @@ -102,6 +119,15 @@ divide_recipe <- function(recipe) { } all_recipes <- recipes rm(list = 'recipes') + } else if (tolower(recipe$Analysis$Horizon) == 'decadal') { + for (reci in 1:length(all_recipes)) { + all_recipes[[reci]]$Analysis$Time <- + list(fcst_year = recipe$Analysis$Time$fcst_year, + hcst_start = recipe$Analysis$Time$hcst_start, + hcst_end = recipe$Analysis$Time$hcst_end, + ftime_min = recipe$Analysis$Time$ftime_min, + ftime_max = recipe$Analysis$Time$ftime_max) + } } # Rest of horizons # Save all recipes in separate YAML files for (reci in 1:length(all_recipes)) {