diff --git a/definitions/grib1/data.grid_second_order.def b/definitions/grib1/data.grid_second_order.def index d517d26b8..2ef74a82e 100644 --- a/definitions/grib1/data.grid_second_order.def +++ b/definitions/grib1/data.grid_second_order.def @@ -27,6 +27,7 @@ meta countOfGroupLengths sum(groupLengths); transient numberOfCodedValues=countOfGroupLengths+orderOfSPD; #transient numberOfCodedValues=countOfGroupLengths; meta bitsPerValue second_order_bits_per_value(codedValues,binaryScaleFactor,decimalScaleFactor); +alias accuracy = bitsPerValue; position offsetBeforeData; diff --git a/definitions/grib1/data.grid_second_order_constant_width.def b/definitions/grib1/data.grid_second_order_constant_width.def index 1c30e0e24..8042255b4 100644 --- a/definitions/grib1/data.grid_second_order_constant_width.def +++ b/definitions/grib1/data.grid_second_order_constant_width.def @@ -11,6 +11,7 @@ meta numberOfGroups evaluate(codedNumberOfFirstOrderPackedValues + 65536 * extra unsigned[1] groupWidth :dump; meta bitsPerValue second_order_bits_per_value(values,binaryScaleFactor,decimalScaleFactor); +alias accuracy = bitsPerValue; position offsetBeforeData; diff --git a/definitions/grib1/data.grid_second_order_general_grib1.def b/definitions/grib1/data.grid_second_order_general_grib1.def index 3e02ac8df..6f5ef7c8a 100644 --- a/definitions/grib1/data.grid_second_order_general_grib1.def +++ b/definitions/grib1/data.grid_second_order_general_grib1.def @@ -11,6 +11,7 @@ meta numberOfGroups evaluate(codedNumberOfFirstOrderPackedValues + 65536 * extra unsigned[1] groupWidths[numberOfGroups] :dump; meta bitsPerValue second_order_bits_per_value(values,binaryScaleFactor,decimalScaleFactor); +alias accuracy = bitsPerValue; position offsetBeforeData; diff --git a/definitions/grib1/data.grid_second_order_row_by_row.def b/definitions/grib1/data.grid_second_order_row_by_row.def index 8368f4430..e5c96e3e8 100644 --- a/definitions/grib1/data.grid_second_order_row_by_row.def +++ b/definitions/grib1/data.grid_second_order_row_by_row.def @@ -11,6 +11,7 @@ meta numberOfGroups evaluate(codedNumberOfFirstOrderPackedValues + 65536 * extra unsigned[1] groupWidths[numberOfGroups] :dump; meta bitsPerValue second_order_bits_per_value(values,binaryScaleFactor,decimalScaleFactor); +alias accuracy = bitsPerValue; position offsetBeforeData; diff --git a/definitions/grib2/template.5.50001.def b/definitions/grib2/template.5.50001.def index 1e8eed339..01d0aedbe 100755 --- a/definitions/grib2/template.5.50001.def +++ b/definitions/grib2/template.5.50001.def @@ -1,27 +1,28 @@ # (C) Copyright 2005- ECMWF. -ieeefloat referenceValue : no_copy; +ieeefloat referenceValue: no_copy; meta referenceValueError reference_value_error(referenceValue,ieee); -signed[2] binaryScaleFactor : no_copy; +signed[2] binaryScaleFactor: no_copy; -signed[2] decimalScaleFactor :no_copy; +signed[2] decimalScaleFactor: no_copy; # Try different values of binaryScaleFactor and decimalScaleFactor to reduce packing error transient optimizeScaleFactor = 0; -unsigned[1] bitsPerValue ; +unsigned[1] bitsPerValue; +alias accuracy = bitsPerValue; if (bitsPerValue) { - unsigned[1] widthOfFirstOrderValues :no_copy ; + unsigned[1] widthOfFirstOrderValues :no_copy ; - unsigned [4] numberOfGroups : no_copy; - unsigned [4] numberOfSecondOrderPackedValues : no_copy; - unsigned [1] widthOfWidths : no_copy; - unsigned [1] widthOfLengths : no_copy; - unsigned [1] orderOfSPD = 2 : no_copy ; + unsigned [4] numberOfGroups : no_copy; + unsigned [4] numberOfSecondOrderPackedValues : no_copy; + unsigned [1] widthOfWidths : no_copy; + unsigned [1] widthOfLengths : no_copy; + unsigned [1] orderOfSPD = 2 : no_copy ; - if (orderOfSPD) { - unsigned[1] widthOfSPD ; - meta SPD spd(widthOfSPD,orderOfSPD) : read_only; - } + if (orderOfSPD) { + unsigned[1] widthOfSPD ; + meta SPD spd(widthOfSPD,orderOfSPD) : read_only; + } } diff --git a/definitions/grib2/template.5.50002.def b/definitions/grib2/template.5.50002.def index dd687a02b..a30bdaee0 100755 --- a/definitions/grib2/template.5.50002.def +++ b/definitions/grib2/template.5.50002.def @@ -3,15 +3,16 @@ ieeefloat referenceValue : no_copy; meta referenceValueError reference_value_error(referenceValue,ieee); -signed[2] binaryScaleFactor : no_copy; +signed[2] binaryScaleFactor : no_copy; -signed[2] decimalScaleFactor :no_copy; +signed[2] decimalScaleFactor :no_copy; # Try different values of binaryScaleFactor and decimalScaleFactor to reduce packing error transient optimizeScaleFactor = 0; -unsigned[1] bitsPerValue ; -unsigned[1] widthOfFirstOrderValues :no_copy ; +unsigned[1] bitsPerValue; +alias accuracy = bitsPerValue; +unsigned[1] widthOfFirstOrderValues :no_copy; unsigned [4] numberOfGroups : no_copy; unsigned [4] numberOfSecondOrderPackedValues : no_copy; @@ -24,6 +25,6 @@ flagbit boustrophedonicOrdering(secondOrderFlags,7) = 0; alias boustrophedonic=boustrophedonicOrdering; if (orderOfSPD) { - unsigned[1] widthOfSPD ; - meta SPD spd(widthOfSPD,orderOfSPD) : read_only; + unsigned[1] widthOfSPD ; + meta SPD spd(widthOfSPD,orderOfSPD) : read_only; } diff --git a/tests/grib_second_order.sh b/tests/grib_second_order.sh index ae01c20a2..032667778 100755 --- a/tests/grib_second_order.sh +++ b/tests/grib_second_order.sh @@ -87,6 +87,7 @@ sec_ord_bmp=sec_ord_bmp.$$.grib1 # Convert to second order packing ${tools_dir}/grib_set -r -s packingType=grid_second_order gen_bitmap.grib $sec_ord_bmp +grib_check_key_equals $sec_ord_bmp accuracy 4 # Check there are missing values nums=`${tools_dir}/grib_get -p numberOfDataPoints,numberOfCodedValues,numberOfMissing $sec_ord_bmp` [ "$nums" = "5969 4 5965" ] @@ -129,7 +130,7 @@ cat > $test_filter< $test_filter< $test_filter<