diff --git a/src/grib_iterator_class_latlon.cc b/src/grib_iterator_class_latlon.cc index d0e4d2d54..2d68b8f4e 100644 --- a/src/grib_iterator_class_latlon.cc +++ b/src/grib_iterator_class_latlon.cc @@ -171,7 +171,7 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) return err; if ((err = grib_get_double_internal(h, "latitudeLastInDegrees", &lat2))) return err; - if ((err = grib_get_double_internal(h, s_jdir, &jdir))) + if ((err = grib_get_double_internal(h, s_jdir, &jdir))) //can be GRIB_MISSING_DOUBLE return err; if ((err = grib_get_long_internal(h, s_jScansPos, &jScansPositively))) return err; @@ -182,7 +182,7 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) /* ECC-984: If jDirectionIncrement is missing, then we cannot use it (See jDirectionIncrementGiven) */ /* So try to compute the increment */ - if (grib_is_missing(h, s_jdir, &err) && err == GRIB_SUCCESS) { + if ( (grib_is_missing(h, s_jdir, &err) && err == GRIB_SUCCESS) || (jdir == GRIB_MISSING_DOUBLE) ) { const long Nj = self->Nj; Assert(Nj > 1); if (lat1 > lat2) { @@ -191,8 +191,8 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) else { jdir = (lat2 - lat1) / (Nj - 1); } - grib_context_log(h->context, GRIB_LOG_INFO, - "%s is missing (See jDirectionIncrementGiven). Using value of %.6f obtained from La1, La2 and Nj", s_jdir, jdir); + grib_context_log(h->context, GRIB_LOG_DEBUG, + "Cannot use jDirectionIncrement. Using value of %.6f obtained from La1, La2 and Nj", jdir); } if (jScansPositively) { diff --git a/src/grib_iterator_class_regular.cc b/src/grib_iterator_class_regular.cc index ce45da00a..ddbaa3044 100644 --- a/src/grib_iterator_class_regular.cc +++ b/src/grib_iterator_class_regular.cc @@ -161,7 +161,7 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) return ret; if ((ret = grib_get_double_internal(h, "longitudeOfLastGridPointInDegrees", &lon2))) return ret; - if ((ret = grib_get_double_internal(h, s_idir, &idir))) + if ((ret = grib_get_double_internal(h, s_idir, &idir))) // can be GRIB_MISSING_DOUBLE return ret; if ((ret = grib_get_long_internal(h, s_Ni, &Ni))) return ret; diff --git a/tests/grib_ecc-984.sh b/tests/grib_ecc-984.sh index 49cbe7fb4..caebd55a9 100755 --- a/tests/grib_ecc-984.sh +++ b/tests/grib_ecc-984.sh @@ -25,7 +25,7 @@ grib_check_key_equals $tempGrb jDirectionIncrementInDegrees MISSING ${tools_dir}/grib_get_data -F%.2f $tempGrb >$tempOut 2>$tempErr grep -q "2.000 20.000 302.53" $tempOut -grep -q "DjInDegrees is missing" $tempErr +# grep -q "Cannot use jDirectionIncrement" $tempErr # Clean up rm -f $tempGrb $tempOut $tempErr