Skip to content

Commit

Permalink
Update ERA5 renaming script for hourly (#3630)
Browse files Browse the repository at this point in the history
Co-authored-by: Elizaveta Malinina <[email protected]>
  • Loading branch information
malininae and Elizaveta Malinina authored Jul 11, 2024
1 parent e83ba66 commit d35ecb7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions esmvaltool/diag_scripts/cmorizers/era5.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ def main(cfg):
if CMOR_TABLES['CMIP6'].get_variable(mip, info['short_name']):
basename = basename.replace('E1hr', mip)
basename = basename.replace('E1hr', 'day')
elif info['diagnostic'] == '3hourly':
for mip in ['3hr', 'E3hr', 'CF3hr']:
if CMOR_TABLES['CMIP6'].get_variable(mip, info['short_name']):
basename = basename.replace('E1hr', mip)
basename = basename.replace('E1hr', '3hr')

cube = iris.load_cube(file)
try:
Expand All @@ -36,6 +41,9 @@ def main(cfg):
if info['diagnostic'] == "monthly":
start = time.cell(0).point.strftime("%Y%m")
end = time.cell(-1).point.strftime("%Y%m")
elif "hourly" in info['diagnostic']:
start = time.cell(0).point.strftime("%Y%m%d%H%M")
end = time.cell(-1).point.strftime("%Y%m%d%H%M")
else:
start = time.cell(0).point.strftime("%Y%m%d")
end = time.cell(-1).point.strftime("%Y%m%d")
Expand Down

0 comments on commit d35ecb7

Please sign in to comment.