ECC-45: bufr_compare does not detect change in subCentre

This commit is contained in:
Shahram Najm 2015-02-09 17:04:26 +00:00
parent 2557619391
commit 6dee943102
2 changed files with 17 additions and 4 deletions

View File

@ -98,10 +98,20 @@ fi
${tools_dir}/bufr_compare -r ${fBufrInput1} ${fBufrInput2}>> $fLog
#----------------------------------------------------
# Change subCentre and compare
#----------------------------------------------------
${tools_dir}bufr_set -s subCentre=12 aaen_55.bufr $fBufrTmp
set +e
${tools_dir}bufr_compare aaen_55.bufr $fBufrTmp >/dev/null
status=$?
set -e
[ $status -eq 1 ]
#Clean up
rm -f $fLog
rm -f $fBufrTmp | true
rm -f $fBufrInput1 | true
rm -f $fBufrInput2 | true

View File

@ -543,7 +543,7 @@ static int compare_values(grib_runtime_options* options,grib_handle* h1,grib_han
int type1,type2;
int countdiff;
int isangle=0;
int isMissing1,isMissing2;
int isMissing1=0,isMissing2=0;
char *sval1 = NULL,*sval2 = NULL;
unsigned char *uval1 = NULL,*uval2 = NULL;
@ -633,8 +633,11 @@ static int compare_values(grib_runtime_options* options,grib_handle* h1,grib_han
}
*/
if (options->mode != MODE_BUFR) {
/* TODO: Ignore missing values for keys in BUFR. Not yet implemented */
isMissing1= ( (grib_is_missing(h1,name,&err1)==1) && (err1 == 0) ) ? 1 : 0;
isMissing2= ( (grib_is_missing(h2,name,&err2)==1) && (err2 == 0) ) ? 1 : 0;
}
if ((isMissing1==1) && (isMissing2==1)) {
if (verbose) printf(" is set to missing in both fields\n");