diff --git a/tests/grib_ccsds.sh b/tests/grib_ccsds.sh index d650a0fa0..bb37f060c 100755 --- a/tests/grib_ccsds.sh +++ b/tests/grib_ccsds.sh @@ -146,18 +146,21 @@ ${tools_dir}/grib_compare -c data:n $outfile1 $outfile2 # Test increasing bitsPerValue # ----------------------------- -# TODO: This one is broken for some BPV values. It has AEC_DATA_3BYTE_OPTION_MASK==0 -# input=${data_dir}/ccsds.grib2 - -ifs_samples="gg_ml.tmpl gg_sfc_grib2.tmpl" ifs_dir=${proj_dir}/ifs_samples/grib1_mlgrib2_ccsds +inputs=" + $data_dir/ccsds.grib2 + $ifs_dir/gg_ml.tmpl + $ifs_dir/gg_sfc_grib2.tmpl +" +grib_check_key_equals $data_dir/ccsds.grib2 'bitsPerValue,packingType,AEC_DATA_3BYTE_OPTION_MASK' '14 grid_ccsds 0' +grib_check_key_equals $ifs_dir/gg_ml.tmpl 'bitsPerValue,packingType,AEC_DATA_3BYTE_OPTION_MASK' '16 grid_ccsds 1' +grib_check_key_equals $ifs_dir/gg_sfc_grib2.tmpl 'bitsPerValue,packingType,AEC_DATA_3BYTE_OPTION_MASK' '16 grid_ccsds 1' + MAX_BPV=32 # libaec cannot handle more than this -for sample in $ifs_samples; do - input=$ifs_dir/$sample +for input in $inputs; do MIN_BPV=`${tools_dir}/grib_get -p bitsPerValue $input` stats1=`${tools_dir}/grib_get -F%.3f -p min,max,avg,sd $input` - grib_check_key_equals $input 'bitsPerValue,packingType,AEC_DATA_3BYTE_OPTION_MASK' '16 grid_ccsds 1' for bpv in `seq $MIN_BPV $MAX_BPV`; do ${tools_dir}/grib_set -s setBitsPerValue=$bpv $input $outfile2 ${tools_dir}/grib_compare -c data:n $input $outfile2