
source("modules/Loading/Loading.R")
source("modules/Saving/Saving.R")
source("modules/Units/Units.R")
source("modules/Visualization/Visualization.R")
#args = commandArgs(trailingOnly = TRUE)
#recipe_file <- args[1]
recipe_file <- "recipe_NAO_single.yml"
#recipe <- read_atomic_recipe(recipe_file)
recipe <- prepare_outputs(recipe_file, disable_checks = TRUE)
# Load datasets
data <- Loading(recipe)
data <- Units(recipe, data)
data_summary(data$hcst, recipe)
data_summary(data$obs, recipe)


source("modules/Crossval/Crossval_NAO.R")
res <- Crossval_NAO(recipe = recipe, data = data)

source("plot_NAO.R")
plot_NAO(recipe = recipe, nao = res, data = data)

source("modules/Crossval/Crossval_metrics.R")
skill_metrics <- Crossval_metrics(recipe = recipe, data_crossval = res,
                                fair = FALSE, nmemb = NULL, nmemb_ref = NULL) 

# No visualisation available for region aggregated

