ECC-1540: Ensemble member issue with localDefinitionNumber=36 for param=210170 (VSO2)

This commit is contained in:
Shahram Najm 2023-03-07 17:47:58 +00:00
parent 8b2290804c
commit f1342af080
2 changed files with 19 additions and 8 deletions

View File

@ -1890,15 +1890,19 @@ int parse_keyval_string(const char* grib_tool,
return GRIB_SUCCESS; return GRIB_SUCCESS;
} }
// Return 1 if the productDefinitionTemplateNumber (GRIB2) is related to EPS // Return 1 if the productDefinitionTemplateNumber (GRIB2) is for EPS (ensemble) products
int grib2_is_PDTN_EPS(long pdtn) int grib2_is_PDTN_EPS(long pdtn)
{ {
return ( #define NUMBER(x) (sizeof(x) / sizeof(x[0]))
pdtn == 1 || pdtn == 11 ||
pdtn == 33 || pdtn == 34 || // simulated (synthetic) satellite data static int eps_pdtns[] = { 1, 2, 3, 4, 11, 12, 13, 14, 33, 34, 41, 43, 45, 47,
pdtn == 41 || pdtn == 43 || // atmospheric chemical constituents 49, 54, 56, 58, 59, 60, 61, 63, 68, 71, 73, 77, 79,
pdtn == 45 || pdtn == 47 || pdtn == 85 // aerosols 81, 83, 84, 85, 92, 94, 96, 98 };
); size_t i;
for (i = 0; i < NUMBER(eps_pdtns); ++i) {
if (eps_pdtns[i] == pdtn) return 1;
}
return 0;
} }
// Return 1 if the productDefinitionTemplateNumber (GRIB2) is for atmospheric chemical constituents // Return 1 if the productDefinitionTemplateNumber (GRIB2) is for atmospheric chemical constituents
@ -1963,7 +1967,6 @@ int grib2_is_PDTN_AerosolOptical(long pdtn)
// is_eps: ensemble or deterministic // is_eps: ensemble or deterministic
// is_instant: instantaneous or interval-based // is_instant: instantaneous or interval-based
// etc... // etc...
//
int grib2_select_PDTN(int is_eps, int is_instant, int grib2_select_PDTN(int is_eps, int is_instant,
int is_chemical, int is_chemical,
int is_chemical_srcsink, int is_chemical_srcsink,

View File

@ -198,6 +198,14 @@ grib_check_key_equals $temp 'mars.iteration' '23'
${tools_dir}/grib_ls -jm $temp > $temp.1 ${tools_dir}/grib_ls -jm $temp > $temp.1
grep -q "iteration.* 23" $temp.1 grep -q "iteration.* 23" $temp.1
# ECC-1540: Local Definition 36
# --------------------------------
${tools_dir}/grib_set -s \
setLocalDefinition=1,localDefinitionNumber=36,paramId=210170,class=rd,type=4v,stream=elda \
$sample_g2 $temp
grib_check_key_exists $temp mars.number,constituentType,sourceSinkChemicalPhysicalProcess
${tools_dir}/grib_set -s localDefinitionNumber=36 $temp $temp.1
${tools_dir}/grib_compare $temp $temp.1
# Clean up # Clean up
rm -f $temp $temp.1 $temp.2 $temp.3 rm -f $temp $temp.1 $temp.2 $temp.3