diff --git a/lib/iris/fileformats/netcdf.py b/lib/iris/fileformats/netcdf.py index 02312e75cd..40a2fbf255 100644 --- a/lib/iris/fileformats/netcdf.py +++ b/lib/iris/fileformats/netcdf.py @@ -1236,6 +1236,8 @@ def _create_cf_variable(self, cube, dimension_names, coord): if np.issubdtype(coord.points.dtype, np.str): string_dimension_depth = coord.points.dtype.itemsize + if coord.points.dtype.kind == 'U': + string_dimension_depth //= 4 string_dimension_name = 'string%d' % string_dimension_depth # Determine whether to create the string length dimension.