###############################################################################
## Author: An-Chi Ho
## Description: Script to test developments for decadal workflows. Please,
##              do not modify.
###############################################################################

source("modules/Loading/Loading.R")
source("modules/Calibration/Calibration.R")
source("modules/Skill/Skill.R")
source("modules/Saving/Saving.R")
source("modules/Visualization/Visualization.R")

recipe_file <- "recipes/atomic_recipes/recipe_decadal.yml"
recipe <- prepare_outputs(recipe_file)
# archive <- read_yaml(paste0(recipe$Run$code_dir, "conf/archive_decadal.yml"))$archive

# Load datasets
data <- Loading(recipe)

# Calibrate datasets
calibrated_data <- Calibration(recipe, data)

# Compute skill metrics
skill_metrics <- Skill(recipe, calibrated_data)

# Compute percentiles and probability bins
probabilities <- Probabilities(recipe, calibrated_data)

# Plot data
Visualization(recipe, calibrated_data, skill_metrics, probabilities,
	      significance = T)

