Testing: Check for duplicate parameter encodings

This commit is contained in:
shahramn 2024-10-15 14:51:27 +01:00
parent e4adcb2cf8
commit 66bfe1fbab
1 changed files with 13 additions and 11 deletions

View File

@ -37,9 +37,11 @@ check_grib_defs()
# -----------------------------------
echo "Check for duplicate encodings"
# -----------------------------------
paramIdFile=$ECCODES_DEFINITION_PATH/grib2/paramId.def
paramIdFiles="$ECCODES_DEFINITION_PATH/grib2/paramId.def $ECCODES_DEFINITION_PATH/grib2/localConcepts/ecmf/paramId.def"
# Flatten the file so we get just the encoding part.
# uniq -d outputs a single copy of each line that is repeated in the input
for paramIdFile in $paramIdFiles; do
cat $paramIdFile | tr '\n' ' ' | tr '\t' ' ' | tr '#' '\n' | sed "s/^.* '//" | sed "s/'//" | awk '{$1="";print}' | sort |uniq -d > $tempText
if [ -s "$tempText" ]; then
# File exists and has a size greater than zero
@ -49,7 +51,7 @@ if [ -s "$tempText" ]; then
else
echo "No duplicates in $paramIdFile"
fi
done
# First check the GRIB2 paramId.def and shortName.def
# ----------------------------------------------------