diff --git a/iris_grib/_load_convert.py b/iris_grib/_load_convert.py index 82eed1ea..03b8e7c9 100644 --- a/iris_grib/_load_convert.py +++ b/iris_grib/_load_convert.py @@ -812,8 +812,6 @@ def grid_definition_template_12(section, metadata): lat = section["latitudeOfReferencePoint"] * _GRID_ACCURACY_IN_DEGREES lon = section["longitudeOfReferencePoint"] * _GRID_ACCURACY_IN_DEGREES scale = section["scaleFactorAtReferencePoint"] - # Catch bug in ECMWF GRIB API (present at 1.12.1) where the scale - # is treated as a signed, 4-byte integer. CM_TO_M = 0.01 easting = section["XR"] * CM_TO_M northing = section["YR"] * CM_TO_M diff --git a/iris_grib/_save_rules.py b/iris_grib/_save_rules.py index 1b601854..612cd9d7 100644 --- a/iris_grib/_save_rules.py +++ b/iris_grib/_save_rules.py @@ -515,10 +515,6 @@ def grid_definition_template_12(cube, grib): eccodes.codes_set(grib, "Di", abs(x_step)) eccodes.codes_set(grib, "Dj", abs(y_step)) horizontal_grid_common(cube, grib) - - # GRIBAPI expects unsigned ints in X1, X2, Y1, Y2 but it should accept - # signed ints, so work around this. - # See https://software.ecmwf.int/issues/browse/SUP-1101 eccodes.codes_set(grib, "Y1", int(y_cm[0])) eccodes.codes_set(grib, "Y2", int(y_cm[-1])) eccodes.codes_set(grib, "X1", int(x_cm[0])) @@ -544,10 +540,6 @@ def m_to_cm(value): # False easting and false northing are measured in units of (10^-2)m. eccodes.codes_set(grib, "XR", m_to_cm(cs.false_easting)) eccodes.codes_set(grib, "YR", m_to_cm(cs.false_northing)) - - # GRIBAPI expects a signed int for scaleFactorAtReferencePoint - # but it should accept a float, so work around this. - # See https://software.ecmwf.int/issues/browse/SUP-1100 value = cs.scale_factor_at_central_meridian eccodes.codes_set(grib, "scaleFactorAtReferencePoint", value)