diff --git a/CMEW/app/configure_for/bin/test_update_recipe_file.py b/CMEW/app/configure_for/bin/test_update_recipe_file.py index dd4a4425..a1be1742 100644 --- a/CMEW/app/configure_for/bin/test_update_recipe_file.py +++ b/CMEW/app/configure_for/bin/test_update_recipe_file.py @@ -12,16 +12,18 @@ def mock_env_vars(monkeypatch): # Time window monkeypatch.setenv("START_YEAR", "1993") monkeypatch.setenv("NUMBER_OF_YEARS", "1") - monkeypatch.setenv("LABEL_FOR_PLOTS", "Test Label") - monkeypatch.setenv("REF_LABEL_FOR_PLOTS", "Ref Test Label") # Reference run metadata monkeypatch.setenv("REF_MODEL_ID", "HadGEM3-GC31-LL") monkeypatch.setenv("REF_VARIANT_LABEL", "r1i1p1f3") + monkeypatch.setenv("REF_LABEL_FOR_PLOTS", "Ref Test Label") + monkeypatch.setenv("REF_EXPERIMENT_ID", "historical") # Evaluation run metadata monkeypatch.setenv("MODEL_ID", "UKESM1-0-LL") monkeypatch.setenv("VARIANT_LABEL", "r1i1p1f1") + monkeypatch.setenv("LABEL_FOR_PLOTS", "Test Label") + monkeypatch.setenv("EXPERIMENT_ID", "amip") @pytest.fixture diff --git a/CMEW/app/configure_for/bin/update_recipe_file.py b/CMEW/app/configure_for/bin/update_recipe_file.py index 2d8e8abf..57953c17 100755 --- a/CMEW/app/configure_for/bin/update_recipe_file.py +++ b/CMEW/app/configure_for/bin/update_recipe_file.py @@ -34,11 +34,12 @@ def update_recipe(recipe_path): datasets: - {activity: , alias: , dataset: , - end_year: , ensemble: , exp: , grid: , - project: , start_year: } + end_year: , ensemble: , exp: , + grid: , project: , start_year: } - {activity: , alias: , dataset: , - end_year: , ensemble: , exp: , grid: , - project: , start_year: } + end_year: , ensemble: , + exp: , grid: , project: , + start_year: } Notes ----- @@ -66,8 +67,10 @@ def update_recipe(recipe_path): # Model metadata from environment ref_model_id = os.environ["REF_MODEL_ID"] ref_variant = os.environ["REF_VARIANT_LABEL"] + ref_experiment_id = os.environ["REF_EXPERIMENT_ID"] eval_model_id = os.environ["MODEL_ID"] eval_variant = os.environ["VARIANT_LABEL"] + eval_experiment_id = os.environ["EXPERIMENT_ID"] # Read given reference alias or use the suite ID if os.environ.get("REF_LABEL_FOR_PLOTS"): @@ -91,14 +94,13 @@ def update_recipe(recipe_path): "one for the reference and one for the evaluation run." ) - # Reference dataset: treat as a GCModelDev / ESMVal / amip run, - # using REF_MODEL_ID & REF_VARIANT_LABEL, with the configured time window. + # Reference dataset ref_dataset = datasets[0] ref_dataset.update( { "dataset": ref_model_id, "project": "ESMVal", - "exp": "amip", + "exp": ref_experiment_id, "activity": "ESMVal", "institute": "MOHC", "ensemble": ref_variant, @@ -108,13 +110,13 @@ def update_recipe(recipe_path): } ) - # Evaluation dataset: ESMVal / amip run using MODEL_ID and VARIANT_LABEL + # Evaluation dataset eval_dataset = datasets[1] eval_dataset.update( { "dataset": eval_model_id, "project": "ESMVal", - "exp": "amip", + "exp": eval_experiment_id, "activity": "ESMVal", "institute": "MOHC", "ensemble": eval_variant, diff --git a/CMEW/app/configure_standardise/bin/configure_standardise.sh b/CMEW/app/configure_standardise/bin/configure_standardise.sh index d31f3656..ac661967 100755 --- a/CMEW/app/configure_standardise/bin/configure_standardise.sh +++ b/CMEW/app/configure_standardise/bin/configure_standardise.sh @@ -1,5 +1,5 @@ #!/bin/bash -# (C) Crown Copyright 2024-2025, Met Office. +# (C) Crown Copyright 2024-2026, Met Office. # The LICENSE.md file contains full licensing details. # Send the output from 'set -x' to 'stdout' rather than 'stderr'. BASH_XTRACEFD=1 @@ -20,9 +20,11 @@ echo "[INFO] Using REQUEST_PATH_EVAL=${REQUEST_PATH_EVAL}" : "${REF_MODEL_ID:?REF_MODEL_ID must be set}" : "${REF_SUITE_ID:?REF_SUITE_ID must be set}" : "${REF_CALENDAR:?REF_CALENDAR must be set}" +: "${REF_EXPERIMENT_ID:??REF_EXPERIMENT_ID must be set}" : "${MODEL_ID:?MODEL_ID (evaluation) must be set}" : "${SUITE_ID:?SUITE_ID (evaluation) must be set}" : "${CALENDAR:?CALENDAR (evaluation) must be set}" +: "${EXPERIMENT_ID:?EXPERIMENT_ID (evaluation) must be set}" # --------------------------------------------------------------------------- # 1. Create variables.txt once (shared by both runs) @@ -48,6 +50,7 @@ create_for_run() { run_suite_id="${REF_SUITE_ID}" run_calendar="${REF_CALENDAR}" run_variant="${REF_VARIANT_LABEL:-}" + run_experiment_id="${REF_EXPERIMENT_ID}" run_request="${REQUEST_PATH_REF}" ;; EVAL) @@ -56,6 +59,7 @@ create_for_run() { run_suite_id="${SUITE_ID}" run_calendar="${CALENDAR}" run_variant="${VARIANT_LABEL:-}" + run_experiment_id="${EXPERIMENT_ID}" run_request="${REQUEST_PATH_EVAL}" ;; *) @@ -70,6 +74,7 @@ create_for_run() { export SUITE_ID="${run_suite_id}" export CALENDAR="${run_calendar}" export VARIANT_LABEL="${run_variant}" + export EXPERIMENT_ID="${run_experiment_id}" export REQUEST_PATH="${run_request}" echo "[INFO] Creating request for ${RUN_LABEL} run at: ${REQUEST_PATH}" diff --git a/CMEW/app/configure_standardise/bin/create_request_file.py b/CMEW/app/configure_standardise/bin/create_request_file.py index 19e02c53..e1d070ab 100755 --- a/CMEW/app/configure_standardise/bin/create_request_file.py +++ b/CMEW/app/configure_standardise/bin/create_request_file.py @@ -25,7 +25,7 @@ def create_request(): "base_date": "1850-01-01T00:00:00", "branch_method": "no parent", "calendar": os.environ["CALENDAR"], - "experiment_id": "amip", + "experiment_id": os.environ["EXPERIMENT_ID"], "institution_id": os.environ["INSTITUTION_ID"], "license": "GCModelDev model data is licensed under the Open Government License v3 (https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/)", # noqa: E501 "mip": "ESMVal", diff --git a/CMEW/app/configure_standardise/bin/test_create_request_file.py b/CMEW/app/configure_standardise/bin/test_create_request_file.py index 716a788e..ebb8d542 100644 --- a/CMEW/app/configure_standardise/bin/test_create_request_file.py +++ b/CMEW/app/configure_standardise/bin/test_create_request_file.py @@ -10,6 +10,7 @@ def test_create_request(monkeypatch): monkeypatch.setenv("START_YEAR", "1993") monkeypatch.setenv("NUMBER_OF_YEARS", "1") monkeypatch.setenv("CALENDAR", "360_day") + monkeypatch.setenv("EXPERIMENT_ID", "amip") monkeypatch.setenv("INSTITUTION_ID", "MOHC") monkeypatch.setenv("MODEL_ID", "UKESM1-0-LL") monkeypatch.setenv("ROOT_PROC_DIR", "/path/to/proc/dir/") diff --git a/CMEW/app/unittest/kgo/test_updated_radiation_budget_recipe.yml b/CMEW/app/unittest/kgo/test_updated_radiation_budget_recipe.yml index f6fc24e5..8ae1c445 100644 --- a/CMEW/app/unittest/kgo/test_updated_radiation_budget_recipe.yml +++ b/CMEW/app/unittest/kgo/test_updated_radiation_budget_recipe.yml @@ -9,7 +9,7 @@ datasets: dataset: HadGEM3-GC31-LL end_year: 1993 ensemble: r1i1p1f3 - exp: amip + exp: historical grid: gn institute: MOHC project: ESMVal diff --git a/CMEW/flow.cylc b/CMEW/flow.cylc index 1979ebd6..323aeead 100644 --- a/CMEW/flow.cylc +++ b/CMEW/flow.cylc @@ -66,12 +66,14 @@ REF_SUITE_ID = {{ REF_SUITE_ID }} REF_CALENDAR = {{ REF_CALENDAR }} REF_VARIANT_LABEL = {{ REF_VARIANT_LABEL }} + REF_EXPERIMENT_ID = {{ REF_EXPERIMENT_ID }} # Evaluation run metadata MODEL_ID = {{ MODEL_ID }} SUITE_ID = {{ SUITE_ID }} CALENDAR = {{ CALENDAR }} VARIANT_LABEL = {{ VARIANT_LABEL }} + EXPERIMENT_ID = {{ EXPERIMENT_ID }} [[install_env_file]] [[[environment]]] @@ -107,9 +109,7 @@ START_YEAR = {{ START_YEAR }} NUMBER_OF_YEARS = {{ NUMBER_OF_YEARS }} LABEL_FOR_PLOTS = {{ LABEL_FOR_PLOTS }} - SUITE_ID = {{ SUITE_ID }} REF_LABEL_FOR_PLOTS = {{ REF_LABEL_FOR_PLOTS }} - REF_SUITE_ID = {{ REF_SUITE_ID }} [[configure_standardise]] inherit = STANDARDISE, RECIPE, MODEL_RUNS diff --git a/CMEW/meta/rose-meta.conf b/CMEW/meta/rose-meta.conf index 0d1facda..9b41fa48 100644 --- a/CMEW/meta/rose-meta.conf +++ b/CMEW/meta/rose-meta.conf @@ -4,7 +4,7 @@ [template variables=CALENDAR] compulsory=true description=The calendar used by the run to be evaluated. -sort-key=05 +sort-key=06 values="gregorian","360_day" [template variables=CDDS_VERSION] @@ -104,6 +104,13 @@ help=If required, this value must be set in a site-specific configuration file =empty string. type=quoted +[template variables=EXPERIMENT_ID] +compulsory=true +description=The experiment ID used by the evaluation run. +help=A string such as 'amip' or 'piControl'. +sort-key=05 +type=quoted + [template variables=LABEL_FOR_PLOTS] compulsory=false description=An 'alias' for the evaluation dataset in the ESMValTool recipe. @@ -138,15 +145,22 @@ compulsory=true description=The number of years of model data to evaluate. help=Data evaluated will end on 31 December START_YEAR + NUMBER_OF_YEARS -1, =inclusive. -sort-key=23 +sort-key=24 type=integer [template variables=REF_CALENDAR] compulsory=true description=The calendar used by the reference run. -sort-key=15 +sort-key=17 values="gregorian","360_day" +[template variables=REF_EXPERIMENT_ID] +compulsory=true +description=The experiment ID used by the reference run. +help=A string such as 'amip' or 'piControl'. +sort-key=16 +type=quoted + [template variables=REF_LABEL_FOR_PLOTS] compulsory=false description=An 'alias' for the reference dataset in the ESMValTool recipe. @@ -156,7 +170,7 @@ help=It is recommended to limit the length of this string as much as is =Not all diagnostics make use of this variable. =It may be set to the same value as REF_SUITE_ID or REF_MODEL_ID. pattern=^".{0,25}"$ -sort-key=13 +sort-key=14 type=quoted [template variables=REF_MODEL_ID] @@ -164,7 +178,7 @@ compulsory=true description=A short name for the run to be used as reference. help=Must only contain letters, numbers, underscores or dashes. pattern=^"[a-zA-Z0-9_-]+"$ -sort-key=12 +sort-key=13 type=quoted [template variables=REF_SUITE_ID] @@ -172,7 +186,7 @@ compulsory=true description=The ID of the model simulation suite to be used as reference. help=Must only contain letters, numbers, underscores or dashes. pattern=^"[a-zA-Z0-9_-]+"$ -sort-key=11 +sort-key=12 type=quoted [template variables=REF_VARIANT_LABEL] @@ -181,7 +195,7 @@ description=Ensemble member variant label for the reference run. help=Must adhere to CMIP6 variant label format: ripf. =E.g. r2i1p1f3. https://help.ceda.ac.uk/article/4801-cmip6-data pattern=^"r[0-9]+i[0-9]+p[0-9]+f[0-9]+"$ -sort-key=14 +sort-key=15 type=quoted [template variables=ROOTPATH_ANA4MIPS] @@ -275,7 +289,7 @@ type=quoted compulsory=true description=The first year of model data to evaluate. help=Data evaluated will begin on 1 Jan START_YEAR. -sort-key=22 +sort-key=24 type=integer [template variables=SUITE_ID] diff --git a/CMEW/rose-suite.conf b/CMEW/rose-suite.conf index afd2d62a..b875df0e 100644 --- a/CMEW/rose-suite.conf +++ b/CMEW/rose-suite.conf @@ -14,11 +14,13 @@ DRS_OBS="default" DRS_OBS4MIPS="default" DRS_OBS6="default" ESMVALTOOL_MODULE_NAME="" +EXPERIMENT_ID="historical" LABEL_FOR_PLOTS="HadGEM3-GC5E-LL N96ORCA1" MAX_PARALLEL_TASKS=4 MODEL_ID="HadGEM3-GC5E-LL" NUMBER_OF_YEARS=1 REF_CALENDAR="360_day" +REF_EXPERIMENT_ID="amip" REF_LABEL_FOR_PLOTS="HadGEM3-GC3.1 N96ORCA1" REF_MODEL_ID="HadGEM3-GC31-LL" REF_SUITE_ID="u-bv526"