Merge remote-tracking branch 'origin/develop' into feature/ECC-1903-tablesVersion-switch

This commit is contained in:
Matthew Griffith 2024-09-20 16:01:37 +00:00
commit 93be9ef043
20 changed files with 1118 additions and 1082 deletions

View File

@ -1 +1 @@
2.38.0
2.39.0

View File

@ -114,7 +114,6 @@ if(matrixOfValues == 0)
# From GRIBEX:
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# ! !
# ! This is the WMO definition, but it is entirely !
# ! inadequate when secondary bit maps are present !
# ! eg 3x3 global grid with a matrix of values !
@ -129,7 +128,6 @@ if(matrixOfValues == 0)
# ! missing'). !
# ! This definition will accommodate a 1x1 !
# ! degree global grid. !
# ! !
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#
constant datumSize = NC*NR;

View File

@ -10,10 +10,11 @@ transient numberOfUnusedBitsAtEndOfSection3 = 0 : read_only;
transient tableReference = 0;
#position offsetBeforeBitmap;
meta bitmap gds_not_present_bitmap( missingValue,numberOfValues,
numberOfPoints,
latitudeOfFirstGridPoint,
Ni,numberOfUnusedBitsAtEndOfSection3) : read_only;
meta bitmap gds_not_present_bitmap(
missingValue,numberOfValues,
numberOfPoints,
latitudeOfFirstGridPoint,
Ni,numberOfUnusedBitsAtEndOfSection3) : read_only;
#position offsetAfterBitmap;
#padtoeven padding_sec3_1(offsetSection3,section3Length);

View File

@ -40,6 +40,6 @@ transient numberOfPoints= nd *(Ni + 1) * (Ni + 1);
alias numberOfDataPoints=numberOfPoints;
meta numberOfValues
number_of_values(values,bitsPerValue,numberOfDataPoints,
bitmapPresent,bitmap,numberOfCodedValues) : dump;
number_of_values(
values,bitsPerValue,numberOfDataPoints,
bitmapPresent,bitmap,numberOfCodedValues) : dump;

View File

@ -79,11 +79,11 @@ if(missing(Ni)){
nearest latlon_reduced(values,radius,Nj,pl);
} else {
transient iteratorDisableUnrotate = 0 : hidden; # ECC-808
iterator latlon(numberOfPoints,missingValue,values,longitudeFirstInDegrees,iInc ,
Ni,Nj,iScansNegatively ,
latitudeFirstInDegrees,DjInDegrees,jScansPositively,jPointsAreConsecutive,
isRotatedGrid, angleOfRotation,
latitudeOfSouthernPoleInDegrees,longitudeOfSouthernPoleInDegrees);
iterator latlon(numberOfPoints,missingValue,values,longitudeFirstInDegrees,iInc,
Ni,Nj,iScansNegatively,
latitudeFirstInDegrees,DjInDegrees,jScansPositively,jPointsAreConsecutive,
isRotatedGrid, angleOfRotation,
latitudeOfSouthernPoleInDegrees,longitudeOfSouthernPoleInDegrees);
nearest regular(values,radius,Ni,Nj);
}
meta latLonValues latlonvalues(values);

View File

@ -24,9 +24,9 @@ constant dataRepresentationType = 0;
# (according to data representation type - octet 6 above)
# grib 1 -> 2
constant gridDefinitionTemplateNumber = 0;
constant gridDefinitionTemplateNumber = 0;
# START 1/grid_definition.latitude_longitude_grid ----------------------------------------------------------------------
# START 1/grid_definition.latitude_longitude_grid
# GRID DEFINITION latitude/longitude grid (or equidistant cylindrical)
alias numberOfPointsAlongAParallel=Ni;
@ -122,6 +122,6 @@ constant tableReference = 0;
#position offsetBeforeBitmap;
# meta bitmap gds_not_present_bitmap( missingValue,numberOfValues,
# numberOfPoints,
# latitudeOfFirstGridPoint,
# Ni,numberOfUnusedBitsAtEndOfSection3) : read_only;
# numberOfPoints,
# latitudeOfFirstGridPoint,
# Ni,numberOfUnusedBitsAtEndOfSection3) : read_only;

View File

@ -1,69 +1,70 @@
# Concept marsLevtype
'sfc' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=8;}
'o2d' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=9;}
'sfc' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=162;}
'sfc' = {typeOfFirstFixedSurface=2; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=7; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=8; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=17; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=18; typeOfSecondFixedSurface=255;}
'o2d' = {discipline=10; typeOfFirstFixedSurface=20; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=20; typeOfSecondFixedSurface=255;}
'pl' = {typeOfFirstFixedSurface=100; typeOfSecondFixedSurface=255;}
'pl' = {typeOfFirstFixedSurface=100; typeOfSecondFixedSurface=100;}
'sfc' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=100;
scaleFactorOfSecondFixedSurface=0; scaledValueOfSecondFixedSurface=80000;}
'sfc' = {typeOfFirstFixedSurface=100; scaleFactorOfFirstFixedSurface=0; scaledValueOfFirstFixedSurface=80000;
typeOfSecondFixedSurface=100; scaleFactorOfSecondFixedSurface=0; scaledValueOfSecondFixedSurface=45000;}
'sfc' = {typeOfFirstFixedSurface=100; scaleFactorOfFirstFixedSurface=0;
scaledValueOfFirstFixedSurface=45000; typeOfSecondFixedSurface=8;}
'sfc' = {typeOfFirstFixedSurface=101; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=102; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=103; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=103; typeOfSecondFixedSurface=103;}
'ml' = {typeOfFirstFixedSurface=105; typeOfSecondFixedSurface=255;}
'ml' = {typeOfFirstFixedSurface=105; typeOfSecondFixedSurface=105;}
'sfc' = {typeOfFirstFixedSurface=106; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=106;typeOfSecondFixedSurface=106;}
'pt' = {typeOfFirstFixedSurface=107; typeOfSecondFixedSurface=255;}
'pt' = {typeOfFirstFixedSurface=107; typeOfSecondFixedSurface=107;}
'pv' = {typeOfFirstFixedSurface=109; typeOfSecondFixedSurface=255;}
'sol' = {typeOfFirstFixedSurface=114; typeOfSecondFixedSurface=255;}
'sol' = {typeOfFirstFixedSurface=114; typeOfSecondFixedSurface=114;}
'hhl' = {typeOfFirstFixedSurface=118; typeOfSecondFixedSurface=255;}
'hpl' = {typeOfFirstFixedSurface=119; typeOfSecondFixedSurface=255;}
'sol' = {typeOfFirstFixedSurface=151; typeOfSecondFixedSurface=255;}
'sol' = {typeOfFirstFixedSurface=151; typeOfSecondFixedSurface=151;}
'sol' = {typeOfFirstFixedSurface=152; typeOfSecondFixedSurface=255;}
'sol' = {typeOfFirstFixedSurface=152; typeOfSecondFixedSurface=152;}
'o2d' = {typeOfFirstFixedSurface=160; typeOfSecondFixedSurface=255;}
'o2d' = {typeOfFirstFixedSurface=160; scaleFactorOfFirstFixedSurface=0;
scaledValueOfFirstFixedSurface=0; typeOfSecondFixedSurface=255;}
'o2d' = {typeOfFirstFixedSurface=160; typeOfSecondFixedSurface=160;}
'o2d' = {typeOfFirstFixedSurface=160; typeOfSecondFixedSurface=9;}
'o2d' = {typeOfFirstFixedSurface=160; typeOfSecondFixedSurface=20;
scaledValueOfFirstFixedSurface=0; scaleFactorOfFirstFixedSurface=0;}
'sfc' = {typeOfFirstFixedSurface=162; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=166; typeOfSecondFixedSurface=255;}
'o3d' = {typeOfFirstFixedSurface=168; typeOfSecondFixedSurface=255;}
'o3d' = {typeOfFirstFixedSurface=168; typeOfSecondFixedSurface=168;}
'o2d' = {typeOfFirstFixedSurface=169; typeOfSecondFixedSurface=255;}
'o2d' = {typeOfFirstFixedSurface=170; typeOfSecondFixedSurface=255;}
'o2d' = {typeOfFirstFixedSurface=171; typeOfSecondFixedSurface=255;}
'o2d' = {typeOfFirstFixedSurface=173; typeOfSecondFixedSurface=255;}
'o2d' = {typeOfFirstFixedSurface=173; typeOfSecondFixedSurface=175;}
'o2d' = {typeOfFirstFixedSurface=174; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=174; typeOfSecondFixedSurface=255; discipline=1;}
'o2d' = {typeOfFirstFixedSurface=175; typeOfSecondFixedSurface=255;}
'o2d' = {typeOfFirstFixedSurface=176; typeOfSecondFixedSurface=255;}
'o2d' = {typeOfFirstFixedSurface=174; typeOfSecondFixedSurface=160;
scaleFactorOfSecondFixedSurface=0; scaledValueOfSecondFixedSurface=0;}
'o2d' = {typeOfFirstFixedSurface=174; typeOfSecondFixedSurface=176;}
'sfc' = {typeOfFirstFixedSurface=174; typeOfSecondFixedSurface=176; discipline=1;}
'o2d' = {typeOfFirstFixedSurface=175; typeOfSecondFixedSurface=176;}
'sfc' = {typeOfFirstFixedSurface=177; typeOfSecondFixedSurface=255;}
'o2d' = {typeOfFirstFixedSurface=188; typeOfSecondFixedSurface=189;}
'sfc' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=8;}
'o2d' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=9;}
'sfc' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=162;}
'sfc' = {typeOfFirstFixedSurface=2; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=7; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=8; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=17; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=18; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=19; typeOfSecondFixedSurface=255;}
'o2d' = {discipline=10; typeOfFirstFixedSurface=20; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=20; typeOfSecondFixedSurface=255;}
'pl' = {typeOfFirstFixedSurface=100; typeOfSecondFixedSurface=255;}
'pl' = {typeOfFirstFixedSurface=100; typeOfSecondFixedSurface=100;}
'sfc' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=100;
scaleFactorOfSecondFixedSurface=0; scaledValueOfSecondFixedSurface=80000;}
'sfc' = {typeOfFirstFixedSurface=100; scaleFactorOfFirstFixedSurface=0; scaledValueOfFirstFixedSurface=80000;
typeOfSecondFixedSurface=100; scaleFactorOfSecondFixedSurface=0; scaledValueOfSecondFixedSurface=45000;}
'sfc' = {typeOfFirstFixedSurface=100; scaleFactorOfFirstFixedSurface=0;
scaledValueOfFirstFixedSurface=45000; typeOfSecondFixedSurface=8;}
'sfc' = {typeOfFirstFixedSurface=101; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=102; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=103; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=103; typeOfSecondFixedSurface=103;}
'ml' = {typeOfFirstFixedSurface=105; typeOfSecondFixedSurface=255;}
'ml' = {typeOfFirstFixedSurface=105; typeOfSecondFixedSurface=105;}
'sfc' = {typeOfFirstFixedSurface=106; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=106;typeOfSecondFixedSurface=106;}
'pt' = {typeOfFirstFixedSurface=107; typeOfSecondFixedSurface=255;}
'pt' = {typeOfFirstFixedSurface=107; typeOfSecondFixedSurface=107;}
'pv' = {typeOfFirstFixedSurface=109; typeOfSecondFixedSurface=255;}
'sol' = {typeOfFirstFixedSurface=114; typeOfSecondFixedSurface=255;}
'sol' = {typeOfFirstFixedSurface=114; typeOfSecondFixedSurface=114;}
'hhl' = {typeOfFirstFixedSurface=118; typeOfSecondFixedSurface=255;}
'hpl' = {typeOfFirstFixedSurface=119; typeOfSecondFixedSurface=255;}
'sol' = {typeOfFirstFixedSurface=151; typeOfSecondFixedSurface=255;}
'sol' = {typeOfFirstFixedSurface=151; typeOfSecondFixedSurface=151;}
'sol' = {typeOfFirstFixedSurface=152; typeOfSecondFixedSurface=255;}
'sol' = {typeOfFirstFixedSurface=152; typeOfSecondFixedSurface=152;}
'o2d' = {typeOfFirstFixedSurface=160; typeOfSecondFixedSurface=255;}
'o2d' = {typeOfFirstFixedSurface=160; scaleFactorOfFirstFixedSurface=0;
scaledValueOfFirstFixedSurface=0; typeOfSecondFixedSurface=255;}
'o2d' = {typeOfFirstFixedSurface=160; typeOfSecondFixedSurface=160;}
'o2d' = {typeOfFirstFixedSurface=160; typeOfSecondFixedSurface=9;}
'o2d' = {typeOfFirstFixedSurface=160; typeOfSecondFixedSurface=20;
scaledValueOfFirstFixedSurface=0; scaleFactorOfFirstFixedSurface=0;}
'sfc' = {typeOfFirstFixedSurface=162; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=166; typeOfSecondFixedSurface=255;}
'o3d' = {typeOfFirstFixedSurface=168; typeOfSecondFixedSurface=255;}
'o3d' = {typeOfFirstFixedSurface=168; typeOfSecondFixedSurface=168;}
'o2d' = {typeOfFirstFixedSurface=169; typeOfSecondFixedSurface=255;}
'o2d' = {typeOfFirstFixedSurface=170; typeOfSecondFixedSurface=255;}
'o2d' = {typeOfFirstFixedSurface=171; typeOfSecondFixedSurface=255;}
'o2d' = {typeOfFirstFixedSurface=173; typeOfSecondFixedSurface=255;}
'o2d' = {typeOfFirstFixedSurface=173; typeOfSecondFixedSurface=175;}
'o2d' = {typeOfFirstFixedSurface=174; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=174; typeOfSecondFixedSurface=255; discipline=1;}
'o2d' = {typeOfFirstFixedSurface=175; typeOfSecondFixedSurface=255;}
'o2d' = {typeOfFirstFixedSurface=176; typeOfSecondFixedSurface=255;}
'o2d' = {typeOfFirstFixedSurface=174; typeOfSecondFixedSurface=160;
scaleFactorOfSecondFixedSurface=0; scaledValueOfSecondFixedSurface=0;}
'o2d' = {typeOfFirstFixedSurface=174; typeOfSecondFixedSurface=176;}
'sfc' = {typeOfFirstFixedSurface=174; typeOfSecondFixedSurface=176; discipline=1;}
'o2d' = {typeOfFirstFixedSurface=175; typeOfSecondFixedSurface=176;}
'sfc' = {typeOfFirstFixedSurface=177; typeOfSecondFixedSurface=255;}
'o2d' = {typeOfFirstFixedSurface=188; typeOfSecondFixedSurface=189;}
'sfc' = {typeOfFirstFixedSurface=5; typeOfSecondFixedSurface=255;}
'sfc' = {typeOfFirstFixedSurface=14; typeOfSecondFixedSurface=255;}

View File

@ -1,39 +1,42 @@
# (C) Copyright 2005- ECMWF.
codetable[2] marsClass "mars/class.table" = "od" : dump,string_type,lowercase;
codetable[2] marsClass "mars/class.table" = "od" : dump,string_type,lowercase;
codetable[2] marsType "mars/type.table" = "an" : dump,string_type,no_fail,lowercase;
codetable[2] marsStream "mars/stream.table" = "oper" : dump,string_type,lowercase ;
codetable[2] marsStream "mars/stream.table" = "oper" : dump,string_type,lowercase;
ksec1expver[4] experimentVersionNumber = "0001" : dump;
meta class g2_mars_labeling(0,marsClass,
marsType,
marsStream,
experimentVersionNumber,
typeOfProcessedData,
productDefinitionTemplateNumber,
stepType,
derivedForecast,
typeOfGeneratingProcess);
meta class g2_mars_labeling(
0,marsClass,
marsType,
marsStream,
experimentVersionNumber,
typeOfProcessedData,
productDefinitionTemplateNumber,
stepType,
derivedForecast,
typeOfGeneratingProcess);
meta type g2_mars_labeling(1,marsClass,
marsType,
marsStream,
experimentVersionNumber,
typeOfProcessedData,
productDefinitionTemplateNumber,
stepType,
derivedForecast,
typeOfGeneratingProcess);
meta type g2_mars_labeling(
1,marsClass,
marsType,
marsStream,
experimentVersionNumber,
typeOfProcessedData,
productDefinitionTemplateNumber,
stepType,
derivedForecast,
typeOfGeneratingProcess);
meta stream g2_mars_labeling(2,marsClass,
marsType,
marsStream,
experimentVersionNumber,
typeOfProcessedData,
productDefinitionTemplateNumber,
stepType,
derivedForecast,
typeOfGeneratingProcess);
meta stream g2_mars_labeling(
2,marsClass,
marsType,
marsStream,
experimentVersionNumber,
typeOfProcessedData,
productDefinitionTemplateNumber,
stepType,
derivedForecast,
typeOfGeneratingProcess);
alias ls.dataType = marsType;
@ -41,5 +44,4 @@ alias mars.class = class;
alias mars.type = type;
alias mars.stream = stream;
alias mars.expver = experimentVersionNumber;
alias mars.domain = globalDomain; # For now...
alias mars.domain = globalDomain; # For now...

View File

@ -20,6 +20,7 @@
'neutralBuoyancy' = {typeOfFirstFixedSurface=16; typeOfSecondFixedSurface=255;}
'mostUnstableParcel' = {typeOfFirstFixedSurface=17; typeOfSecondFixedSurface=255;}
'mixedLayerParcel' = {typeOfFirstFixedSurface=18; typeOfSecondFixedSurface=255;}
'lowestLevelOfCloudCoverExceedance' = {typeOfFirstFixedSurface=19; typeOfSecondFixedSurface=255;}
'isothermal' = {typeOfFirstFixedSurface=20; typeOfSecondFixedSurface=255;}
'isobaricInPa' = {typeOfFirstFixedSurface=100; typeOfSecondFixedSurface=255; pressureUnits='Pa';}
'isobaricInhPa' = {typeOfFirstFixedSurface=100; pressureUnits='hPa'; typeOfSecondFixedSurface=255;}

View File

@ -31,8 +31,10 @@ program codes_dump_test
if (iret == CODES_END_OF_FILE) exit
call codes_set_debug(0)
call codes_set_data_quality_checks(1)
call codes_dump(msgid)
call codes_set_debug(1)
call codes_set_data_quality_checks(0)
call codes_release(msgid)

View File

@ -2786,6 +2786,12 @@
call grib_set_debug(dmode)
end subroutine codes_set_debug
!> Set data quality check value (0, 1 or 2)
subroutine codes_set_data_quality_checks(val)
integer(kind=kindOfInt), intent(in) :: val
call grib_set_data_quality_checks(val)
end subroutine codes_set_data_quality_checks
!> Set the definition path

View File

@ -79,7 +79,7 @@ integer, external :: grib_f_set_int, grib_f_set_int_array, &
integer, external :: grib_f_get_message_size, grib_f_copy_message, grib_f_count_in_file
integer, external :: grib_f_write, grib_f_multi_write, grib_f_multi_append
integer, external :: grib_f_clone, grib_f_copy_namespace
external :: grib_f_check , grib_f_set_debug
external :: grib_f_check , grib_f_set_debug, grib_f_set_data_quality_checks
integer, external :: grib_f_util_sections_copy
integer, external :: grib_f_set_definitions_path, grib_f_set_samples_path
integer, external :: grib_f_julian_to_datetime, grib_f_datetime_to_julian, grib_f_copy_key

View File

@ -3211,6 +3211,12 @@
call grib_f_set_debug(dmode)
end subroutine grib_set_debug
!> Set data quality check value (0, 1 or 2)
subroutine grib_set_data_quality_checks(val)
integer(kind=kindOfInt), intent(in) :: val
call grib_f_set_data_quality_checks(val)
end subroutine grib_set_data_quality_checks
!> Set the definition path
!>

View File

@ -2875,6 +2875,13 @@ void grib_f_set_debug_(int* dmode)
grib_context* c = grib_context_get_default();
grib_context_set_debug(c, *dmode);
}
/*****************************************************************************/
void grib_f_set_data_quality_checks_(int* val)
{
Assert(val);
grib_context* c = grib_context_get_default();
grib_context_set_data_quality_checks(c, *val);
}
/*****************************************************************************/
int grib_f_set_definitions_path_(char* path, int len)

View File

@ -310,6 +310,7 @@ int codes_f_bufr_keys_iterator_new_(int* gid,int* iterid);
int grib_f_read_file_(int* fid, void* buffer, size_t* nbytes);
int codes_f_bufr_keys_iterator_delete_(int* iterid);
void grib_f_set_debug_(int* mode);
void grib_f_set_data_quality_checks_(int* val);
int grib_f_set_definitions_path_(char* path, int len);
int grib_f_read_any_from_file_(int* fid, void* buffer, size_t* nbytes);
int any_f_new_from_file_(int* fid, int* gid);

View File

@ -218,10 +218,9 @@ static grib_concept_value* get_concept_impl(grib_handle* h, grib_action_concept*
char master[1024] = {0,};
char local[1024] = {0,};
char masterDir[1024] = {0,};
size_t lenMasterDir = 1024;
size_t lenMasterDir = sizeof(masterDir);
char key[4096] = {0,};
char* full = 0;
int id;
const size_t bufLen = sizeof(buf);
const size_t keyLen = sizeof(key);
@ -234,7 +233,15 @@ static grib_concept_value* get_concept_impl(grib_handle* h, grib_action_concept*
Assert(self->masterDir);
grib_get_string(h, self->masterDir, masterDir, &lenMasterDir);
snprintf(buf, bufLen, "%s/%s", masterDir, self->basename);
// See ECC-1920: The basename could be a key or a string
char* basename = self->basename; // default is a string
Assert(basename);
char baseNameValue[1024] = {0,}; // its value if a key
size_t lenBaseName = sizeof(baseNameValue);
if (grib_get_string(h, self->basename, baseNameValue, &lenBaseName) == GRIB_SUCCESS) {
basename = baseNameValue; // self->basename was a key whose value is baseNameValue
}
snprintf(buf, bufLen, "%s/%s", masterDir, basename);
grib_recompose_name(h, NULL, buf, master, 1);
@ -242,13 +249,13 @@ static grib_concept_value* get_concept_impl(grib_handle* h, grib_action_concept*
char localDir[1024] = {0,};
size_t lenLocalDir = 1024;
grib_get_string(h, self->localDir, localDir, &lenLocalDir);
snprintf(buf, bufLen, "%s/%s", localDir, self->basename);
snprintf(buf, bufLen, "%s/%s", localDir, basename);
grib_recompose_name(h, NULL, buf, local, 1);
}
snprintf(key, keyLen, "%s%s", master, local);
id = grib_itrie_get_id(h->context->concepts_index, key);
int id = grib_itrie_get_id(h->context->concepts_index, key);
if ((c = h->context->concepts[id]) != NULL)
return c;
@ -274,7 +281,7 @@ static grib_concept_value* get_concept_impl(grib_handle* h, grib_action_concept*
else {
grib_context_log(context, GRIB_LOG_FATAL,
"unable to find definition file %s in %s:%s\nDefinition files path=\"%s\"",
self->basename, master, local, context->grib_definition_files_path);
basename, master, local, context->grib_definition_files_path);
return NULL;
}

View File

@ -244,6 +244,11 @@ void grib_context_set_print_proc(grib_context* c, grib_print_proc p)
void grib_context_set_data_quality_checks(grib_context* c, int val)
{
c = c ? c : grib_context_get_default();
// If val == 0, disable data quality checks
// If val == 1, failure results in an error
// If val == 2, failure results in a warning
Assert(val == 0 || val == 1 || val == 2);
c->grib_data_quality_checks = val;
}

File diff suppressed because it is too large Load Diff

View File

@ -703,7 +703,8 @@ trigger_block: TRIGGER '(' argument_list ')' '{' instructions '}' { $$ = grib_ac
concept_block: CONCEPT IDENT '{' concept_list '}' flags { $$ = grib_action_create_concept(grib_parser_context,$2,$4,0,0,0,0,0,0,$6,0); free($2); }
| CONCEPT IDENT '(' IDENT ')' '{' concept_list '}' flags { $$ = grib_action_create_concept(grib_parser_context,$2,$7,0,0,$4,0,0,0,$9,0); free($2);free($4); }
| CONCEPT IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ')' flags { $$ = grib_action_create_concept(grib_parser_context,$2,0,$6,0,$4,$8,$10,0,$12,0); free($2);free($6);free($4);free($8);free($10); }
| CONCEPT IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ')' flags { $$ = grib_action_create_concept(grib_parser_context,$2,0,$6,0,$4,$8,$10,0,$12,0); free($2);free($6);free($4);free($8);free($10); }
| CONCEPT IDENT '(' IDENT ',' IDENT ',' IDENT ',' IDENT ')' flags { $$ = grib_action_create_concept(grib_parser_context,$2,0,$6,0,$4,$8,$10,0,$12,0); free($2);free($6);free($4);free($8);free($10); }
| CONCEPT IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ',' IDENT ')' flags { $$ = grib_action_create_concept(grib_parser_context,$2,0,$6,0,$4,$8,$10,$12,$14,0); free($2);free($6);free($4);free($8);free($10);free($12); }
| CONCEPT IDENT '(' IDENT ',' STRING ',' IDENT ')' flags { $$ = grib_action_create_concept(grib_parser_context,$2,0,$6,0,$4,$8,0,0,$10,0); free($2);free($6);free($4);free($8); }
| CONCEPT IDENT '.' IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ')' flags { $$ = grib_action_create_concept(grib_parser_context,$4,0,$8,$2,$6,$10,$12,0,$14,0); free($4);free($8);free($6);free($10); free($12); free($2);}

View File

@ -422,6 +422,16 @@ static void test_gts_header_mode()
Assert(c->gts_header_on == 0);
}
static void test_data_quality_checks()
{
grib_context* c = grib_context_get_default();
printf("Running %s ...\n", __func__);
grib_context_set_data_quality_checks(c, 1);//warning
grib_context_set_data_quality_checks(c, 2);//error
grib_context_set_data_quality_checks(c, 0);//no checks
}
static void test_bufr_multi_element_constant_arrays()
{
grib_context* c = grib_context_get_default();
@ -859,6 +869,7 @@ int main(int argc, char** argv)
test_gribex_mode();
test_gts_header_mode();
test_bufr_multi_element_constant_arrays();
test_data_quality_checks();
test_concept_condition_strings();