File "/home/rng/miniconda3/envs/esmvaltool2/lib/python3.7/site-packages/iris/_concatenate.py", line 480, in match
raise iris.exceptions.ConcatenateError(msgs)
iris.exceptions.ConcatenateError: failed to concatenate into a single cube.
Dimension coordinates metadata differ: latitude, longitude != latitude, longitude
**** 1 [_CoordMetaData(defn=CoordDefn(standard_name='time', long_name=None, var_name='time', units=Unit('days since 1850-1-1 00:00:00', calendar='365_day'), attributes={'title': 'time', 'type': 'double'}, coord_system=None), dims=(0,), points_dtype=dtype('float64'), bounds_dtype=dtype('float64'), kwargs={'scalar': False, 'circular': False, 'order': 1}), _CoordMetaData(defn=CoordDefn(standard_name='latitude', long_name=None, var_name='lat', units=Unit('degrees_north'), attributes={'title': 'Latitude', 'type': 'double', 'valid_max': 90.0, 'valid_min': -90.0}, coord_system=None), dims=(1,), points_dtype=dtype('float64'), bounds_dtype=dtype('float32'), kwargs={'scalar': False, 'circular': False, 'order': 1}), _CoordMetaData(defn=CoordDefn(standard_name='longitude', long_name=None, var_name='lon', units=Unit('degrees_east'), attributes={'title': 'Longitude', 'type': 'double', 'valid_max': 360.0, 'valid_min': 0.0}, coord_system=None), dims=(2,), points_dtype=dtype('float64'), bounds_dtype=dtype('float32'), kwargs={'scalar': False, 'circular': True, 'order': 1})]
**** 2 [_CoordMetaData(defn=CoordDefn(standard_name='time', long_name=None, var_name='time', units=Unit('days since 1850-1-1 00:00:00', calendar='365_day'), attributes={'title': 'time', 'type': 'double'}, coord_system=None), dims=(0,), points_dtype=dtype('float64'), bounds_dtype=dtype('float64'), kwargs={'scalar': False, 'circular': False, 'order': 1}), _CoordMetaData(defn=CoordDefn(standard_name='latitude', long_name=None, var_name='lat', units=Unit('degrees_north'), attributes={'title': 'Latitude', 'type': 'double', 'valid_max': 90.0, 'valid_min': -90.0}, coord_system=None), dims=(1,), points_dtype=dtype('float64'), bounds_dtype=dtype('float64'), kwargs={'scalar': False, 'circular': False, 'order': 1}), _CoordMetaData(defn=CoordDefn(standard_name='longitude', long_name=None, var_name='lon', units=Unit('degrees_east'), attributes={'title': 'Longitude', 'type': 'double', 'valid_max': 360.0, 'valid_min': 0.0}, coord_system=None), dims=(2,), points_dtype=dtype('float64'), bounds_dtype=dtype('float64'), kwargs={'scalar': False, 'circular': True, 'order': 1})]
latitude = cube.coord('latitude')
latitude.bounds_dtype=np.dtype('float64')
longitude = cube.coord('longitude')
longitude.bounds_dtype=np.dtype('float64')
File "/home/rng/miniconda3/envs/esmvaltool2/lib/python3.7/site-packages/esmvalcore/cmor/_fixes/cmip6/cesm2.py", line 30, in fix_metadata
latitude.bounds_dtype=np.dtype('float64')
AttributeError: can't set attribute
CMIP6/CMIP/NCAR/CESM2/historical/r1i1p1f1/Amon/tas/gn/v20190308/tas_Amon_CESM2_historical_r1i1p1f1_gn_185001-201412.nc
CMIP6/ScenarioMIP/NCAR/CESM2/ssp245/r1i1p1f1/Amon/tas/gn/v20190730/tas_Amon_CESM2_ssp245_r1i1p1f1_gn_201501-206412.nc
CESM2 monthly mean tas historical has
bounds_dtype float32and corresponding ssp245 file hasbounds_dtype float64. I want to concatenate historical and ssp245 and this gives an error when trying to concatenate cubes. I tried to write a fix for this model, but apparently this attribute is read-only, so it's not possible simply to overwrite one of the attributes. How should I proceed?Fails with this message:
The
dim_metadatawhich are compared and which lead to the above failure are the following:Note that
bounds_typeis different for latitude and longitude for the two files.I tried adding the following to
cesm2.pyto overwrite bounds_dtype:But that gave the following error:
This seems to be because
bounds_dtypeis read-only (see e.g. here https://scitools.org.uk/iris/docs/latest/whatsnew/2.0.html)test-cesm.yml.txt
main_log_debug.txt