get_global_attributes <- function(recipe, archive) {
  # Generates metadata of interest to add to the global attributes of the
  # netCDF files.
  parameters <- recipe$Analysis
  hcst_period <- paste0(parameters$Time$hcst_start, " to ",
                        parameters$Time$hcst_end)
  current_time <- paste0(as.character(Sys.time()), " ", Sys.timezone())
  system_name <- parameters$Datasets$System$name
  reference_name <- parameters$Datasets$Reference$name

  attrs <- list(reference_period = hcst_period,
                institution_system = archive$System[[system_name]]$institution,
                institution_reference = archive$Reference[[reference_name]]$institution,
                system = system_name,
                reference = reference_name,
                calibration_method = parameters$Workflow$Calibration$method,
                computed_on = current_time)

  return(attrs)
}
