Skip to content

Commit e1e7616

Browse files
committed
cdds workflow directory can be indepent from other model/experiment/variant
runs and to be consistent with how it is with cdds 2.5.5.
1 parent 4897c4b commit e1e7616

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

CMEW/app/configure_standardise/bin/create_request_file.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@ def create_request():
3131
root_proc_dir = os.environ["ROOT_PROC_DIR"]
3232
root_data_dir = os.environ["ROOT_DATA_DIR"]
3333
variables_path = os.environ["VARIABLES_PATH"]
34+
experiment_id = "amip"
35+
variant_label = "r1i1p1f1"
3436

3537
start_datetime = f"{start_year}-01-01T00:00:00Z"
3638
end_year = int(start_year) + int(number_of_years)
3739
end_datetime = f"{end_year}-01-01T00:00:00Z"
3840
base_date = "1850-01-01T00:00:00Z"
39-
# time_units = "days since " + base_date
4041
mip_table_v = "0.0.23"
4142
mip_table_dir = "$CDDS_ETC" + "/mip_tables/GCModelDev/" + mip_table_v
4243

@@ -45,26 +46,30 @@ def create_request():
4546
"branch_method": "no parent",
4647
"base_date": base_date,
4748
"calendar": calendar,
48-
"experiment_id": "amip",
49+
"experiment_id": experiment_id,
4950
"institution_id": institution_id,
5051
"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
5152
"mip": "ESMVal",
5253
"mip_era": "GCModelDev",
5354
"sub_experiment_id": "none",
54-
"variant_label": "r1i1p1f1",
55+
"variant_label": variant_label,
5556
"model_id": model_id,
5657
"model_type": "AGCM AER",
5758
} # end metadata
5859
request["netcdf_global_attributes"] = {
59-
# This is needed for CDDS 3.0.6 but may not be needed with 3.1+, to be
60+
# This is needed for CDDS 3.0.6 but may not be needed with 3.1+. To be
6061
# ascertained by follow-up discussion and testing.
6162
"parent_experiment_id": "no parent",
6263
}
6364
request["common"] = {
6465
"mip_table_dir": mip_table_dir,
6566
"mode": "relaxed",
6667
"package": "round-1",
67-
"workflow_basename": "CMEW",
68+
"workflow_basename": model_id
69+
+ "_"
70+
+ experiment_id
71+
+ "_"
72+
+ variant_label,
6873
"root_proc_dir": root_proc_dir,
6974
"root_data_dir": root_data_dir,
7075
"root_ancil_dir": "$CDDS_ETC/" + "ancil",

CMEW/app/configure_standardise/bin/test_create_request_file.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ def monkey_env(monkeypatch):
2020
monkeypatch.setenv("CALENDAR", "360_day")
2121
monkeypatch.setenv("INSTITUTION_ID", "MOHC")
2222
monkeypatch.setenv("SUITE_ID", "u-az513")
23+
monkeypatch.setenv("EXPERIMENT_ID", "amip")
24+
monkeypatch.setenv("VARIANT_LABEL", "r1i1p1f1")
2325
monkeypatch.setenv("ROOT_PROC_DIR", "~/cylc-run/CMEW/runX/share/proc")
2426
monkeypatch.setenv("ROOT_DATA_DIR", "~/cylc-run/CMEW/runX/share/data")
2527
monkeypatch.setenv(
@@ -79,6 +81,8 @@ def expected_config():
7981
root_proc_dir = os.environ["ROOT_PROC_DIR"]
8082
root_data_dir = os.environ["ROOT_DATA_DIR"]
8183
variables_path = os.environ["VARIABLES_PATH"]
84+
experiment_id = os.environ["EXPERIMENT_ID"]
85+
variant_label = os.environ["VARIANT_LABEL"]
8286

8387
start_datetime = f"{start_year}-01-01T00:00:00Z"
8488
end_year = int(start_year) + int(number_of_years)
@@ -92,13 +96,13 @@ def expected_config():
9296
"branch_method": "no parent",
9397
"base_date": base_date,
9498
"calendar": calendar,
95-
"experiment_id": "amip",
99+
"experiment_id": experiment_id,
96100
"institution_id": institution_id,
97101
"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
98102
"mip": "ESMVal",
99103
"mip_era": "GCModelDev",
100104
"sub_experiment_id": "none",
101-
"variant_label": "r1i1p1f1",
105+
"variant_label": variant_label,
102106
"model_id": model_id,
103107
"model_type": "AGCM AER",
104108
} # end metadata
@@ -109,7 +113,11 @@ def expected_config():
109113
"mip_table_dir": mip_table_dir,
110114
"mode": "relaxed",
111115
"package": "round-1",
112-
"workflow_basename": "CMEW",
116+
"workflow_basename": model_id
117+
+ "_"
118+
+ experiment_id
119+
+ "_"
120+
+ variant_label,
113121
"root_proc_dir": root_proc_dir,
114122
"root_data_dir": root_data_dir,
115123
"root_ancil_dir": "$CDDS_ETC/" + "ancil",

0 commit comments

Comments
 (0)