diff --git a/src/grib_accessor_class_data_apply_bitmap.c b/src/grib_accessor_class_data_apply_bitmap.c index de90a01d9..076cf4ebf 100644 --- a/src/grib_accessor_class_data_apply_bitmap.c +++ b/src/grib_accessor_class_data_apply_bitmap.c @@ -195,7 +195,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) if (err) return err; if(!grib_find_accessor(grib_handle_of_accessor(a),self->bitmap)) - return grib_get_double_array_internal(grib_handle_of_accessor(a),self->coded_values,val,len); + return grib_get_double_array(grib_handle_of_accessor(a),self->coded_values,val,len); if((err = grib_get_size(grib_handle_of_accessor(a),self->coded_values,&coded_n_vals)) != GRIB_SUCCESS) return err; @@ -223,7 +223,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) coded_vals = (double*)grib_context_malloc(a->context,coded_n_vals*sizeof(double)); if(coded_vals == NULL) return GRIB_OUT_OF_MEMORY; - if((err = grib_get_double_array_internal(grib_handle_of_accessor(a),self->coded_values,coded_vals,&coded_n_vals)) + if((err = grib_get_double_array(grib_handle_of_accessor(a),self->coded_values,coded_vals,&coded_n_vals)) != GRIB_SUCCESS) { grib_context_free(a->context,coded_vals); diff --git a/src/grib_accessor_class_data_ccsds_packing.c b/src/grib_accessor_class_data_ccsds_packing.c index c414f9874..830d3d9c6 100644 --- a/src/grib_accessor_class_data_ccsds_packing.c +++ b/src/grib_accessor_class_data_ccsds_packing.c @@ -230,8 +230,10 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->ccsds_flags,&ccsds_flags)) != GRIB_SUCCESS) + /* ECC-477: Don't call grib_get_long_internal to suppress error message being output */ + if((err = grib_get_long(grib_handle_of_accessor(a),self->ccsds_flags,&ccsds_flags)) != GRIB_SUCCESS) return err; + if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->ccsds_block_size, &ccsds_block_size)) != GRIB_SUCCESS) return err; if((err = grib_get_long_internal(grib_handle_of_accessor(a),self->ccsds_rsi, &ccsds_rsi)) != GRIB_SUCCESS) diff --git a/src/grib_accessor_class_data_g22order_packing.c b/src/grib_accessor_class_data_g22order_packing.c index 3423b3439..51fea7c43 100644 --- a/src/grib_accessor_class_data_g22order_packing.c +++ b/src/grib_accessor_class_data_g22order_packing.c @@ -489,7 +489,10 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len) if((err = grib_get_long_internal(gh,self->binary_scale_factor,&binary_scale_factor )) != GRIB_SUCCESS) return err; if((err = grib_get_long_internal(gh,self->decimal_scale_factor,&decimal_scale_factor )) != GRIB_SUCCESS) return err; if((err = grib_get_long_internal(gh,self->typeOfOriginalFieldValues,&typeOfOriginalFieldValues )) != GRIB_SUCCESS) return err; - if((err = grib_get_long_internal(gh,self->groupSplittingMethodUsed,&groupSplittingMethodUsed )) != GRIB_SUCCESS) return err; + + /* Don't call grib_get_long_internal to suppress error message being output */ + if((err = grib_get_long(gh,self->groupSplittingMethodUsed,&groupSplittingMethodUsed )) != GRIB_SUCCESS) return err; + if((err = grib_get_long_internal(gh,self->missingValueManagementUsed,&missingValueManagementUsed )) != GRIB_SUCCESS) return err; if((err = grib_get_long_internal(gh,self->primaryMissingValueSubstitute,&primaryMissingValueSubstitute )) != GRIB_SUCCESS) return err; if((err = grib_get_long_internal(gh,self->secondaryMissingValueSubstitute,&secondaryMissingValueSubstitute )) != GRIB_SUCCESS) return err; diff --git a/tests/grib_ccsds.sh b/tests/grib_ccsds.sh index 1a175f4c2..3606b41c8 100755 --- a/tests/grib_ccsds.sh +++ b/tests/grib_ccsds.sh @@ -37,8 +37,8 @@ infile=${data_dir}/ccsds.grib2 outfile1=$infile.tmp_ccsds.1 outfile2=$infile.tmp_ccsds.2 -rm -f $outfile1 $outfile2 || true -${tools_dir}/grib_set -f -r -s packingType=grid_simple $infile $outfile1 2> $REDIRECT +rm -f $outfile1 $outfile2 +${tools_dir}/grib_set -f -r -s packingType=grid_simple $infile $outfile1 ${tools_dir}/grib_compare -P -b $BLACKLIST $outfile1 $infile > $REDIRECT ${tools_dir}/grib_set -r -s packingType=grid_ccsds $outfile1 $outfile2 @@ -52,7 +52,7 @@ then exit 1 fi -rm -f $outfile1 $outfile2 || true +rm -f $outfile1 $outfile2 infile=${data_dir}/reduced_latlon_surface.grib2 outfile1=$infile.tmp_ccsds.1 @@ -60,7 +60,7 @@ outfile2=$infile.tmp_ccsds.2 ${tools_dir}/grib_set -r -s packingType=grid_ccsds $infile $outfile1 ${tools_dir}/grib_compare -P -b $BLACKLIST $infile $outfile1 > $REDIRECT -${tools_dir}/grib_set -f -r -s packingType=grid_simple $outfile1 $outfile2 2> $REDIRECT +${tools_dir}/grib_set -f -r -s packingType=grid_simple $outfile1 $outfile2 ${tools_dir}/grib_compare -P -b $BLACKLIST $outfile2 $outfile1 > $REDIRECT res1=`${tools_dir}/grib_get '-F%1.2f' -p min,max,avg $infile` @@ -69,7 +69,7 @@ res3=`${tools_dir}/grib_get '-F%1.2f' -p min,max,avg $outfile2` [ "$res1" = "$res2" ] [ "$res1" = "$res3" ] -rm -f $outfile1 $outfile2 || true +rm -f $outfile1 $outfile2 # ECC-297 infile=${data_dir}/tigge_ecmwf.grib2 @@ -80,4 +80,11 @@ ${tools_dir}/grib_set -r -s bitsPerValue=17 $infile $outfile1 ${tools_dir}/grib_set -r -s packingType=grid_ccsds $outfile1 $outfile2 ${tools_dir}/grib_compare -P -c data:n $outfile1 $outfile2 +# ECC-477: redundant error message during conversion +infile=${data_dir}/ccsds.grib2 +rm -f $outfile2 +${tools_dir}/grib_set -f -r -s packingType=grid_simple $infile $outfile1 >$outfile2 2>&1 +# there should be no error messages printed (to stdout or stderr) +[ ! -s $outfile2 ] + rm -f $outfile1 $outfile2