Bug in activity_id determination for some cmip6 experiments
In PR #107 (addressing issue #37), we introduced the automatic determination of `activity_id` from `experiment_id`. This works nicely in most cases, but a few experiments have more than one activity associated with them. In that case, all activities are listed in the CV field separated by spaces, but following [the official DRS standard (bottom of page 17)](http://goo.gl/v1drZl), only the first one is used in the path.

As a fix, the field coming from the CV should be `split` on `" "` and only the first entry be taken. This should also work in the normal case of only one activity.

The list of afflicted experiments is
- dcppC-forecast-addPinatubo
- esm-1pct-brch-1000PgC
- esm-1pct-brch-2000PgC
- esm-1pct-brch-750PgC
- esm-1pctCO2
- esm-bell-1000PgC
- esm-bell-2000PgC
- esm-bell-750PgC
- land-hist
- piClim-aer
- piClim-control
- ssp370

diff --git a/esmvalcore/_config.py b/esmvalcore/_config.py
index c3710141f..5caccda7f 100644
--- a/esmvalcore/_config.py
+++ b/esmvalcore/_config.py
@@ -190,8 +190,8 @@ def get_activity(variable):
         exp = variable['exp']
         logger.debug("Retrieving activity_id for experiment %s", exp)
         if isinstance(exp, list):
-            return [CMOR_TABLES[project].activities[value] for value in exp]
-        return CMOR_TABLES[project].activities[exp]
+            return [CMOR_TABLES[project].activities[value][0] for value in exp]
+        return CMOR_TABLES[project].activities[exp][0]
     except (KeyError, AttributeError):
         return None
 
diff --git a/esmvalcore/cmor/table.py b/esmvalcore/cmor/table.py
index f179f8193..d876f9d06 100644
--- a/esmvalcore/cmor/table.py
+++ b/esmvalcore/cmor/table.py
@@ -191,7 +191,7 @@ class CMIP6Info(object):
                 try:
                     exps = table_data['CV']['experiment_id']
                     for exp_id in exps:
-                        activity = exps[exp_id]['activity_id']
+                        activity = exps[exp_id]['activity_id'][0].split(' ')
                         self.activities[exp_id] = activity
                 except (KeyError, AttributeError):
                     pass
diff --git a/tests/integration/test_recipe.py b/tests/integration/test_recipe.py
index 31d2d7853..fa73f5ed7 100644
--- a/tests/integration/test_recipe.py
+++ b/tests/integration/test_recipe.py
@@ -408,7 +408,7 @@ def test_cmip6_variable_autocomplete(tmp_path, patched_datafinder,
     variable = recipe.diagnostics['test']['preprocessor_output']['pr'][0]
 
     reference = {
-        'activity': ['CMIP'],
+        'activity': 'CMIP',
         'dataset': 'HadGEM3-GC31-LL',
         'diagnostic': 'test',
         'end_year': 2001,
['tests/integration/test_recipe.py', 'esmvalcore/_config.py', 'esmvalcore/cmor/table.py']