From ad8478f4df300ce14f8f3fd7ac747e2ef8460b57 Mon Sep 17 00:00:00 2001
From: Brian Lewis <keller@csh.rit.edu>
Date: Thu, 9 Jun 2022 16:38:54 +0200
Subject: [PATCH] Set cmip6 -> metadata to use MIP_ERA for it's activity

---
 freva/src/drs/metadata.rs | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/freva/src/drs/metadata.rs b/freva/src/drs/metadata.rs
index 72191ea..3cb87fa 100644
--- a/freva/src/drs/metadata.rs
+++ b/freva/src/drs/metadata.rs
@@ -12,7 +12,11 @@ use std::{
 };
 
 use camino::{Utf8Path, Utf8PathBuf};
-use drs::{cmip5::Cmip5, cmip6::Cmip6, cordex::Cordex};
+use drs::{
+    cmip5::Cmip5,
+    cmip6::{Cmip6, MIP_ERA},
+    cordex::Cordex,
+};
 use netcdf::AttrValue;
 use thiserror::Error;
 use tracing::{debug, error};
@@ -418,8 +422,8 @@ fn metadata_from_cmip6(cmip: Cmip6, root_dir: &Utf8Path) -> Result<Metadata, Ext
     let m = &cmip.metadata;
     Ok(Metadata {
         path: cmip.path.to_owned(),
-        activity: m.activity_id.to_owned(),
-        product: m.activity_id.to_owned(), // all cmip6 data as the same product so we duplicate `activity_id` here
+        activity: MIP_ERA.to_owned(),
+        product: m.activity_id.to_owned(),
         institute: m.institution_id.to_owned(),
         model: m.source_id.to_owned(),
         experiment: m.experiment_id.to_owned(),
-- 
GitLab