Testing: Padded count in filter

This commit is contained in:
Shahram Najm 2023-03-23 14:43:36 +00:00
parent 28f3e6945f
commit 3c209f7792
1 changed files with 20 additions and 0 deletions

View File

@ -280,6 +280,26 @@ set -e
grep -q "ECCODES ERROR.*Number is too large" $tempOut
echo "Padded count for filenames"
# -----------------------------------------
input=${data_dir}/tigge_af_ecmwf.grib2
tempDir=temp.${label}.dir
rm -fr $tempDir
mkdir -p $tempDir
cd $tempDir
cat >$tempFilt <<EOF
meta count_padded sprintf("%.2d", count);
write "out__[count_padded].grib";
EOF
${tools_dir}/grib_filter $tempFilt $input
[ -f out__01.grib ]
[ -f out__02.grib ]
[ -f out__39.grib ]
[ -f out__40.grib ]
cd ..
rm -rf $tempDir
# Clean up
rm -f $tempGrib $tempFilt $tempOut $tempRef
rm -f ${data_dir}/formatint.rules ${data_dir}/binop.rules