Merge branch 'develop' of ssh://software.ecmwf.int:7999/eccodes/eccodes into develop

This commit is contained in:
Enrico Fucile 2016-09-23 14:46:10 +01:00
commit 8243217204
4 changed files with 13 additions and 9 deletions

View File

@ -24,7 +24,7 @@ set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}
include( ecbuild_system NO_POLICY_SCOPE )
ecbuild_requires_macro_version( 1.9 )
ecbuild_requires_macro_version( 2.4 )
###############################################################################
# local project

View File

@ -686,11 +686,6 @@ grib_handle* grib_util_set_spec2(grib_handle* h,
return NULL;
}
if (packing_spec->deleteLocalDefinition) {
/* TODO: not working for grib2 */
SET_LONG_VALUE("deleteLocalDefinition",1);
}
len=100;
grib_get_string(h,"packingType",input_packing_type,&len);
grib_get_long(h,"bitsPerValue",&input_bits_per_value);
@ -1282,8 +1277,14 @@ grib_handle* grib_util_set_spec2(grib_handle* h,
}
}
if(packing_spec->editionNumber && packing_spec->editionNumber!=editionNumber)
if (packing_spec->editionNumber && packing_spec->editionNumber!=editionNumber) {
grib_set_long(outh,"edition", packing_spec->editionNumber);
}
if (packing_spec->deleteLocalDefinition) {
grib_set_long(outh,"setLocalDefinition", 0);
grib_set_long(outh,"deleteLocalDefinition", 1);
}
if ( (*err = check_handle_against_spec(outh, editionNumber, spec, global_grid)) != GRIB_SUCCESS)
{

View File

@ -134,6 +134,9 @@ void test_regular_ll(const char* input_filename, const char* output_filename)
packing_spec.bitsPerValue = 24;
packing_spec.accuracy=GRIB_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES;
packing_spec.packing=GRIB_UTIL_PACKING_USE_PROVIDED;
/* Convert to edition 2 and remove local use section */
packing_spec.editionNumber = 2;
packing_spec.deleteLocalDefinition = 1;
finalh = codes_grib_util_set_spec(
handle,

View File

@ -18,8 +18,8 @@ rm -f $outfile
${test_dir}grib_util_set_spec $infile $outfile > /dev/null
res=`${tools_dir}grib_get -p Ni,Nj,numberOfValues,bitsPerValue $outfile`
[ "$res" = "17 14 238 24" ]
res=`${tools_dir}grib_get -p edition,section2Used,Ni,Nj,numberOfValues,bitsPerValue $outfile`
[ "$res" = "2 0 17 14 238 24" ]
# Check output file geometry
${tools_dir}grib_get_data $outfile > /dev/null