Skip to content

Commit 0d05a77

Browse files
authoredMar 13, 2025··
Merge pull request #785 from PCMDI/issue762_durack1_updateDRSBrandingLabels
add DRS, remove nested brandDict, remove 1x1 nomRes (#762)
2 parents 1244ce0 + ef69ec1 commit 0d05a77

5 files changed

+129
-105
lines changed
 

‎TestTables/CMIP7_CV.json

+85-81
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,39 @@
11
{
22
"CV":{
3-
"branding_labels":{
4-
"area_label":{
5-
"air":"air",
6-
"ccl":"convective cloud",
7-
"cl":"cloud",
8-
"crp":"crops",
9-
"fis":"floating ice shelf",
10-
"gis":"grounded ice sheet",
11-
"ifs":"ice free sea",
12-
"is":"ice sheet",
13-
"li":"land ice",
14-
"lnd":"land",
15-
"lus":"sector (auxiliary coordinate for land-use area types",
16-
"ng":"natural grasses",
17-
"pst":"pasture",
18-
"scl":"stratiform cloud",
19-
"sea":"sea",
20-
"shb":"shrubs",
21-
"si":"sea ice",
22-
"simp":"sea ice melt pond",
23-
"sir":"sea ice ridge",
24-
"sn":"snow",
25-
"tree":"trees",
26-
"u":"unmasked (no \"where\" directive included in cell_methods)",
27-
"ufs":"unfrozen soil",
28-
"veg":"vegetation",
29-
"wl":"wetland"
30-
},
31-
"horizontal_label":{
32-
"hm":"horizontal mean",
33-
"ht":"labeled areas",
34-
"hxy":"gridded",
35-
"hxys":"site values",
36-
"hy":"zonal mean",
37-
"hys":"basin mean"
38-
},
39-
"temporal_label":{
40-
"tavg":"mean",
41-
"tclm":"climatology",
42-
"tclmdc":"diurnal cycle climatology",
43-
"ti":"time independent",
44-
"tpt":"point",
45-
"tstat":"statistic",
46-
"tsum":"sum"
47-
},
48-
"vertical_label":{
49-
"1000hPa":"1000 hPa",
50-
"100hPa":"100 hPa",
51-
"10hPa":"10 hPa",
52-
"220hPa":"220 hPa",
53-
"500hPa":"500 hPa",
54-
"560hPa":"560 hPa",
55-
"700hPa":"700 hPa",
56-
"840hPa":"840 hPa",
57-
"850hPa":"850 hPa",
58-
"d0m":"surface",
59-
"d100m":"100m depth",
60-
"d10cm":"1cm depth",
61-
"d1m":"1m depth",
62-
"d2000m":"2000m depth",
63-
"d300m":"300m depth",
64-
"d700m":"700m depth",
65-
"h100m":"100m height",
66-
"h10m":"10m height",
67-
"h16":"16 height levels",
68-
"h2m":"2m height",
69-
"h40":"40 height levels",
70-
"l":"model level",
71-
"p19":"19 pressure levels",
72-
"p27":"27 pressure levels",
73-
"p3":"3 pressure levels",
74-
"p39":"39 pressure levels",
75-
"p4":"4 pressure levels",
76-
"p7c":"7 pressure levels",
77-
"p7h":"7 pressure levels",
78-
"p8":"8 pressure levels",
79-
"rho":"density surface",
80-
"u":"unspecified (no vertical dimension)"
81-
}
3+
"DRS":{
4+
"directory_path_example":"CMIP7/CMIP/PCMDI-test-1-0/glb/mon/historical/r1i1p1f3/tas/tavg-h2m-hxy-u/gn/v20191207/",
5+
"directory_path_template":"<mip_era>/<activity_id>/<source_id>/<region>/<frequency>/<experiment_id>/<variant_id>/<variable_id>/<branding_suffix>/<grid_label>/<version>",
6+
"filename_example":"tas_tavg-h2m-hxy-u_mon_glb_gn_PCMDI-test-1-0 _historical_r1i1p1f3_185001-186912.nc",
7+
"filename_template":"<variable_id>_<branding_suffix>_<frequency>_<region>_<grid_label>_<source_id>_<experiment_id>_<variant_id>[_<time_range>].nc"
828
},
9+
"area_label":{
10+
"air":"air",
11+
"ccl":"convective cloud",
12+
"cl":"cloud",
13+
"crp":"crops",
14+
"fis":"floating ice shelf",
15+
"gis":"grounded ice sheet",
16+
"ifs":"ice free sea",
17+
"is":"ice sheet",
18+
"li":"land ice",
19+
"lnd":"land",
20+
"lus":"sector (auxiliary coordinate for land-use area types",
21+
"ng":"natural grasses",
22+
"pst":"pasture",
23+
"scl":"stratiform cloud",
24+
"sea":"sea",
25+
"shb":"shrubs",
26+
"si":"sea ice",
27+
"simp":"sea ice melt pond",
28+
"sir":"sea ice ridge",
29+
"sn":"snow",
30+
"tree":"trees",
31+
"u":"unmasked (no \"where\" directive included in cell_methods)",
32+
"ufs":"unfrozen soil",
33+
"veg":"vegetation",
34+
"wl":"wetland"
35+
},
36+
"branding_suffix":"<temporal_label>-<vertical_label>-<horizontal_label>-<area_label>",
8337
"data_archive_id":{
8438
"WCRP":"a collection of datasets from the AMIP and CMIP project phases, along with project supporting datasets from the input4MIPs (forcing datasets used to drive CMIP simulations) and obs4MIPs (observational datasets used to evaluate CMIP simulations, and numerous other supporting activities"
8539
},
@@ -161,6 +115,14 @@
161115
"grg":"regridded data in the region of Greenland reported on the data provider's preferred target grid",
162116
"grz":"regridded zonal mean data reported on the data provider's preferred latitude target grid"
163117
},
118+
"horizontal_label":{
119+
"hm":"horizontal mean",
120+
"ht":"labeled areas",
121+
"hxy":"gridded",
122+
"hxys":"site values",
123+
"hy":"zonal mean",
124+
"hys":"basin mean"
125+
},
164126
"institution_id":{
165127
"PCMDI":"Program for Climate Model Diagnosis and Intercomparison, Lawrence Livermore National Laboratory, Livermore, CA 94550, USA"
166128
},
@@ -176,7 +138,6 @@
176138
"100 km",
177139
"1000 km",
178140
"10000 km",
179-
"1x1 degree",
180141
"2.5 km",
181142
"25 km",
182143
"250 km",
@@ -314,8 +275,51 @@
314275
"RAD":"radiation component of an atmospheric model run 'offline'",
315276
"SLAB":"slab-ocean used with an AGCM in representing the atmosphere-ocean coupled system"
316277
},
278+
"temporal_label":{
279+
"tavg":"mean",
280+
"tclm":"climatology",
281+
"tclmdc":"diurnal cycle climatology",
282+
"ti":"time independent",
283+
"tpt":"point",
284+
"tstat":"statistic",
285+
"tsum":"sum"
286+
},
317287
"tracking_id":[
318288
"hdl:21.14100/.*"
319-
]
289+
],
290+
"vertical_label":{
291+
"1000hPa":"1000 hPa",
292+
"100hPa":"100 hPa",
293+
"10hPa":"10 hPa",
294+
"220hPa":"220 hPa",
295+
"500hPa":"500 hPa",
296+
"560hPa":"560 hPa",
297+
"700hPa":"700 hPa",
298+
"840hPa":"840 hPa",
299+
"850hPa":"850 hPa",
300+
"d0m":"surface",
301+
"d100m":"100m depth",
302+
"d10cm":"1cm depth",
303+
"d1m":"1m depth",
304+
"d2000m":"2000m depth",
305+
"d300m":"300m depth",
306+
"d700m":"700m depth",
307+
"h100m":"100m height",
308+
"h10m":"10m height",
309+
"h16":"16 height levels",
310+
"h2m":"2m height",
311+
"h40":"40 height levels",
312+
"l":"model level",
313+
"p19":"19 pressure levels",
314+
"p27":"27 pressure levels",
315+
"p3":"3 pressure levels",
316+
"p39":"39 pressure levels",
317+
"p4":"4 pressure levels",
318+
"p7c":"7 pressure levels",
319+
"p7h":"7 pressure levels",
320+
"p8":"8 pressure levels",
321+
"rho":"density surface",
322+
"u":"unspecified (no vertical dimension)"
323+
}
320324
}
321325
}

‎TestTables/CMIP7_atmos2d.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"Header":{
33
"Conventions":"CF-1.11 CMIP-7.0.0.0",
4-
"checksum":"b9dab11b03ca4d3bd46329321eefd569",
4+
"checksum":"16d968eb7e89b5b95d1e119e32aaa0db",
55
"cmor_version":"3.10",
66
"generic_levels":"alevel alevhalf",
77
"int_missing_value":"-999",
@@ -11,7 +11,7 @@
1111
"positive":"",
1212
"product":"model-output",
1313
"realm":"atmos",
14-
"table_date":"2025-03-09",
14+
"table_date":"2025-03-12",
1515
"table_id":"atmos2d",
1616
"type":"real",
1717
"valid_max":"",

‎TestTables/CMIP7_ocean2d.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"Header":{
33
"Conventions":"CF-1.11 CMIP-7.0.0.0",
4-
"checksum":"8f0a03d98a85aed3624887353b5af6c5",
4+
"checksum":"0d05fb60cb5645eb4b581f5c77508f7c",
55
"cmor_version":"3.10",
66
"generic_levels":"",
77
"int_missing_value":"-999",
@@ -11,7 +11,7 @@
1111
"positive":"",
1212
"product":"model-output",
1313
"realm":"ocean",
14-
"table_date":"2025-03-09",
14+
"table_date":"2025-03-12",
1515
"table_id":"ocean2d",
1616
"type":"real",
1717
"valid_max":"",

‎TestTables/CMIP7_oceanLev.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"Header":{
33
"Conventions":"CF-1.11 CMIP-7.0.0.0",
4-
"checksum":"773fc4e03a0ea47bdc0119167be9d89e",
4+
"checksum":"651bbe7b494203f2383f6feee44ad299",
55
"cmor_version":"3.10",
66
"generic_levels":"olevel olevhalf",
77
"int_missing_value":"-999",
@@ -11,7 +11,7 @@
1111
"positive":"",
1212
"product":"model-output",
1313
"realm":"ocean",
14-
"table_date":"2025-03-09",
14+
"table_date":"2025-03-12",
1515
"table_id":"oceanLev",
1616
"type":"real",
1717
"valid_max":"",

‎TestTables/makeCMIP7MIPTables.ipynb

+38-18
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060
"PJD 9 Mar 2025 - adding nominal_resolution, data_archive_id, and regions<br>\n",
6161
"PJD 9 Mar 2025 - frequency tweaks (correct for pt entries)<br>\n",
6262
"PJD 9 Mar 2025 - add nominal_resolution = 0.25 km; update region identifiers; remove monC frequency<br>\n",
63+
"PJD 12 Mar 2025 - further updates to 1) add DRS; 2) remove nested branding_label dict; 3) remove nom*_res 1x1 degree<br>\n",
64+
"\n",
6365
"TODO:\n",
6466
"\n",
6567
"**Links**"
@@ -83,8 +85,8 @@
8385
"name": "stdout",
8486
"output_type": "stream",
8587
"text": [
86-
"CPU times: user 30.6 ms, sys: 12 ms, total: 42.6 ms\n",
87-
"Wall time: 51.1 ms\n"
88+
"CPU times: user 40.2 ms, sys: 17.4 ms, total: 57.6 ms\n",
89+
"Wall time: 65.8 ms\n"
8890
]
8991
}
9092
],
@@ -153,8 +155,8 @@
153155
"APday\n",
154156
"OPmon\n",
155157
"OPmonLev\n",
156-
"CPU times: user 8.02 ms, sys: 3.76 ms, total: 11.8 ms\n",
157-
"Wall time: 52.2 ms\n"
158+
"CPU times: user 36.7 ms, sys: 16.8 ms, total: 53.5 ms\n",
159+
"Wall time: 15.8 s\n"
158160
]
159161
}
160162
],
@@ -371,13 +373,13 @@
371373
"data": {
372374
"text/plain": [
373375
"{'Header': {'Conventions': 'CF-1.11 CMIP-7.0.0.0',\n",
374-
" 'checksum': 'b9dab11b03ca4d3bd46329321eefd569',\n",
376+
" 'checksum': '16d968eb7e89b5b95d1e119e32aaa0db',\n",
375377
" 'cmor_version': '3.10',\n",
376378
" 'generic_levels': 'alevel alevhalf',\n",
377379
" 'int_missing_value': '-999',\n",
378380
" 'missing_value': '1e20',\n",
379381
" 'product': 'model-output',\n",
380-
" 'table_date': '2025-03-09',\n",
382+
" 'table_date': '2025-03-12',\n",
381383
" 'table_id': 'atmos2d',\n",
382384
" 'realm': 'atmos',\n",
383385
" 'type': 'real',\n",
@@ -484,13 +486,13 @@
484486
"data": {
485487
"text/plain": [
486488
"{'Header': {'Conventions': 'CF-1.11 CMIP-7.0.0.0',\n",
487-
" 'checksum': '8f0a03d98a85aed3624887353b5af6c5',\n",
489+
" 'checksum': '0d05fb60cb5645eb4b581f5c77508f7c',\n",
488490
" 'cmor_version': '3.10',\n",
489491
" 'generic_levels': '',\n",
490492
" 'int_missing_value': '-999',\n",
491493
" 'missing_value': '1e20',\n",
492494
" 'product': 'model-output',\n",
493-
" 'table_date': '2025-03-09',\n",
495+
" 'table_date': '2025-03-12',\n",
494496
" 'table_id': 'ocean2d',\n",
495497
" 'realm': 'ocean',\n",
496498
" 'type': 'real',\n",
@@ -564,13 +566,13 @@
564566
"data": {
565567
"text/plain": [
566568
"{'Header': {'Conventions': 'CF-1.11 CMIP-7.0.0.0',\n",
567-
" 'checksum': '773fc4e03a0ea47bdc0119167be9d89e',\n",
569+
" 'checksum': '651bbe7b494203f2383f6feee44ad299',\n",
568570
" 'cmor_version': '3.10',\n",
569571
" 'generic_levels': 'olevel olevhalf',\n",
570572
" 'int_missing_value': '-999',\n",
571573
" 'missing_value': '1e20',\n",
572574
" 'product': 'model-output',\n",
573-
" 'table_date': '2025-03-09',\n",
575+
" 'table_date': '2025-03-12',\n",
574576
" 'table_id': 'oceanLev',\n",
575577
" 'realm': 'ocean',\n",
576578
" 'type': 'real',\n",
@@ -654,8 +656,8 @@
654656
"output_type": "stream",
655657
"text": [
656658
"CV\n",
657-
"CPU times: user 4.48 ms, sys: 1.63 ms, total: 6.12 ms\n",
658-
"Wall time: 18.6 ms\n"
659+
"CPU times: user 16.5 ms, sys: 6.39 ms, total: 22.9 ms\n",
660+
"Wall time: 5.26 s\n"
659661
]
660662
}
661663
],
@@ -687,6 +689,7 @@
687689
"source": [
688690
"keyList = list(CV[\"CV\"].keys())\n",
689691
"keepKeys = [\n",
692+
" \"DRS\",\n",
690693
" \"frequency\",\n",
691694
" \"grid_label\",\n",
692695
" \"license\",\n",
@@ -716,6 +719,21 @@
716719
"metadata": {},
717720
"outputs": [],
718721
"source": [
722+
"# DRS\n",
723+
"CV[\"CV\"][\"DRS\"].pop(\"directory_path_sub_experiment_example\")\n",
724+
"CV[\"CV\"][\"DRS\"].pop(\"filename_sub_experiment_example\")\n",
725+
"CV[\"CV\"][\"DRS\"][\n",
726+
" \"directory_path_example\"\n",
727+
"] = \"CMIP7/CMIP/PCMDI-test-1-0/glb/mon/historical/r1i1p1f3/tas/tavg-h2m-hxy-u/gn/v20191207/\"\n",
728+
"CV[\"CV\"][\"DRS\"][\n",
729+
" \"directory_path_template\"\n",
730+
"] = \"<mip_era>/<activity_id>/<source_id>/<region>/<frequency>/<experiment_id>/<variant_id>/<variable_id>/<branding_suffix>/<grid_label>/<version>\"\n",
731+
"CV[\"CV\"][\"DRS\"][\n",
732+
" \"filename_example\"\n",
733+
"] = \"tas_tavg-h2m-hxy-u_mon_glb_gn_PCMDI-test-1-0 _historical_r1i1p1f3_185001-186912.nc\"\n",
734+
"CV[\"CV\"][\"DRS\"][\n",
735+
" \"filename_template\"\n",
736+
"] = \"<variable_id>_<branding_suffix>_<frequency>_<region>_<grid_label>_<source_id>_<experiment_id>_<variant_id>[_<time_range>].nc\"\n",
719737
"# frequency\n",
720738
"keepKeys = [\"1hr\", \"1hrCM\", \"3hr\", \"6hr\", \"day\", \"dec\", \"fx\", \"mon\", \"monC\", \"yr\"]\n",
721739
"keyList = list(CV[\"CV\"][\"frequency\"].keys())\n",
@@ -812,7 +830,6 @@
812830
" '100 km',\n",
813831
" '1000 km',\n",
814832
" '10000 km',\n",
815-
" '1x1 degree',\n",
816833
" '2.5 km',\n",
817834
" '25 km',\n",
818835
" '250 km',\n",
@@ -831,6 +848,7 @@
831848
"source": [
832849
"# add 0.25 km\n",
833850
"CV[\"CV\"][\"nominal_resolution\"].insert(0, \"0.25 km\")\n",
851+
"CV[\"CV\"][\"nominal_resolution\"].remove(\"1x1 degree\")\n",
834852
"CV[\"CV\"][\"nominal_resolution\"]"
835853
]
836854
},
@@ -851,6 +869,9 @@
851869
"source": [
852870
"# other CVs\n",
853871
"# new data_archive_id to capture WCRP-affiliated entries\n",
872+
"CV[\"CV\"][\n",
873+
" \"branding_suffix\"\n",
874+
"] = \"<temporal_label>-<vertical_label>-<horizontal_label>-<area_label>\"\n",
854875
"CV[\"CV\"][\"data_archive_id\"] = {}\n",
855876
"CV[\"CV\"][\"data_archive_id\"][\"WCRP\"] = \" \".join(\n",
856877
" [\n",
@@ -1063,11 +1084,10 @@
10631084
"temporal_label = dict(sorted(temporal_label.items()))\n",
10641085
"vertical_label = dict(sorted(vertical_label.items()))\n",
10651086
"# add to CV master dict\n",
1066-
"CV[\"CV\"][\"branding_labels\"] = {}\n",
1067-
"CV[\"CV\"][\"branding_labels\"][\"area_label\"] = area_label\n",
1068-
"CV[\"CV\"][\"branding_labels\"][\"horizontal_label\"] = horizontal_label\n",
1069-
"CV[\"CV\"][\"branding_labels\"][\"temporal_label\"] = temporal_label\n",
1070-
"CV[\"CV\"][\"branding_labels\"][\"vertical_label\"] = vertical_label"
1087+
"CV[\"CV\"][\"area_label\"] = area_label\n",
1088+
"CV[\"CV\"][\"horizontal_label\"] = horizontal_label\n",
1089+
"CV[\"CV\"][\"temporal_label\"] = temporal_label\n",
1090+
"CV[\"CV\"][\"vertical_label\"] = vertical_label"
10711091
]
10721092
},
10731093
{

0 commit comments

Comments
 (0)
Please sign in to comment.