preprocess_datasets <- function(recipe, data) {
  # Remove 'var_dir' dimension
  for (element in names(data)) {
    data[[element]] <- Subset(x = data[[element]],
                              along = c('var_dir'),
                              indices = list(1),
                              drop = 'selected')
  }
  # Add 'ensemble' dimension to obs
  dim(data$obs) <- c(dim(data$obs), ensemble = 1)
  return(data)
}
