Skip to content

Commit dbee1fb

Browse files
A potential bug fix in mean_climate_driver.py
The driver contains the following code block: result_dict["Variable"] = dict() result_dict["Variable"]["id"] = varname if level is not None: result_dict["Variable"]["level"] = level * 100 # hPa to Pa that attempts to convert the specified pressure level from hPa to Pa. However, this code block conflicted with the following code block in the associated libarary model "load_and_regrid.py": if "plev" in list(ds.coords.keys()): if ds.plev.units == "Pa": level = level * 100 # hPa to Pa try: ds = ds.sel(plev=level) The plev in reanalysis such as ERA5 has a unit of Pa by default. The above two code blocks will lead to wrong level and failure of the data selection.
1 parent fd17646 commit dbee1fb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pcmdi_metrics/mean_climate/mean_climate_driver.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@
167167
result_dict["Variable"] = dict()
168168
result_dict["Variable"]["id"] = varname
169169
if level is not None:
170-
result_dict["Variable"]["level"] = level * 100 # hPa to Pa
170+
result_dict["Variable"][
171+
"level"
172+
] = level # SZhang: should not "* 100" here # hPa to Pa
171173

172174
result_dict["References"] = dict()
173175

0 commit comments

Comments
 (0)