test enabled but exclusions added
#Define a common label for all the tmp files
label="bufr_wmo_tables_test"
-#Create log file
-fLog=${label}".log"
-rm -f $fLog
-touch $fLog
-
-#Define tmp bufr files
-fTmp=${label}".tmp"
+#Define tmp bufr file
+fTmp=${label}".tmp.bufr"
#==============================================
# Testing latest WMO tables
#==============================================
bufr_files=`cat ${data_dir}/bufr/bufr_data_files.txt`
REDIRECT=/dev/null
-latest_wmo_version=25
-blacklist=masterTablesVersionNumber,bandwidthCorrectionCoefficient1ForAtovs,bandwidthCorrectionCoefficient2ForAtovs,tovsOrAtovsProductQualifier,centre,subCentre
+
+blacklist=masterTablesVersionNumber
+
+# In version 29, some key names changed. So blacklist them
+latest_wmo_version=29
+blacklist=$blacklist",bandwidthCorrectionCoefficient1ForAtovs,bandwidthCorrectionCoefficient2ForAtovs,tovsOrAtovsProductQualifier"
+
+# The units for centre also changed
+blacklist=$blacklist",centre,subCentre,generatingApplication"
+
for file in ${bufr_files}
do
- ${tools_dir}/bufr_set -s masterTablesVersionNumber=$latest_wmo_version ${data_dir}/bufr/$file $fTmp
- #${tools_dir}/bufr_dump $fTmp >/dev/null
- #${tools_dir}/bufr_compare -b $blacklist ${data_dir}/bufr/$file $fTmp
+ input=${data_dir}/bufr/$file
+ mtv=`${tools_dir}/bufr_get -p masterTablesVersionNumber $input`
+ # Must exclude old versions (before 14):
+ # Sequence 312060 changed content from v15 to v16:
+ # 021062 backscatter became 021088 wetBackscatter!
+ # Also exclude version 19:
+ # This has the issue with local tables (eum_iasi_twt.bufr and eumetsat_iasi_co.bufr)
+ # because they only work for v19 as we only have definitions/bufr/tables/0/local/19-1
+ if [ $mtv -gt 13 -a $mtv -ne 19 ]; then
+ ${tools_dir}/bufr_set -s masterTablesVersionNumber=$latest_wmo_version $input $fTmp
+ ${tools_dir}/bufr_dump $fTmp >/dev/null
+ ${tools_dir}/bufr_compare -b $blacklist $input $fTmp
+ fi
done
-
rm -f $fTmp
