diff --git a/src/grib_iterator_class_lambert_conformal.c b/src/grib_iterator_class_lambert_conformal.c index 2f01801c4..8161de653 100644 --- a/src/grib_iterator_class_lambert_conformal.c +++ b/src/grib_iterator_class_lambert_conformal.c @@ -116,6 +116,7 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) int i, j, err=0; double *lats, *lons; /* the lat/lon arrays to be populated */ long nx,ny,iScansNegatively,jScansPositively,jPointsAreConsecutive,alternativeRowScanning; + long oblate=0; double LoVInDegrees,LaDInDegrees,Latin1InDegrees,Latin2InDegrees,latFirstInDegrees, lonFirstInDegrees, Dx, Dy, radius=0; double latFirstInRadians, lonFirstInRadians, LoVInRadians, Latin1InRadians, Latin2InRadians, @@ -146,6 +147,11 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) if((err = grib_get_long_internal(h, sny,&ny)) != GRIB_SUCCESS) return err; + if(grib_get_long(h, "earthIsOblate", &oblate) == GRIB_SUCCESS && oblate == 1) { + grib_context_log(h->context,GRIB_LOG_ERROR,"Lambert Conformal only supported for spherical earth."); + return GRIB_GEOCALCULUS_PROBLEM; + } + if (iter->nv!=nx*ny) { grib_context_log(h->context,GRIB_LOG_ERROR,"Wrong number of points (%ld!=%ldx%ld)",iter->nv,nx,ny); return GRIB_WRONG_GRID;