Skip to content

Commit

Permalink
Fix for CMIP6 AWI-ESM-1-1-LR parent time units (#2507)
Browse files Browse the repository at this point in the history
Co-authored-by: Valeriu Predoi <[email protected]>
Co-authored-by: Manuel Schlund <[email protected]>
  • Loading branch information
3 people authored Aug 23, 2024
1 parent 4761f64 commit 343368e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions esmvalcore/cmor/_fixes/cmip6/awi_esm_1_1_lr.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ def fix_metadata(self, cubes):
bad_value = 'days since 0000-01-01 00:00:00'
for cube in cubes:
try:
if cube.attributes[parent_units] == bad_value:
cube.attributes[parent_units] = 'days since 0001-01-01 ' \
+ '00:00:00'
if parent_units in cube.attributes:
if cube.attributes[parent_units] == bad_value:
cube.attributes[parent_units] = \
'days since 0001-01-01 00:00:00'
except AttributeError:
pass
return cubes

0 comments on commit 343368e

Please sign in to comment.