diff --git a/src/accessor/grib_accessor_class_g2_aerosol.cc b/src/accessor/grib_accessor_class_g2_aerosol.cc index f32d51e7c..641e4e125 100644 --- a/src/accessor/grib_accessor_class_g2_aerosol.cc +++ b/src/accessor/grib_accessor_class_g2_aerosol.cc @@ -79,7 +79,7 @@ int grib_accessor_g2_aerosol_t::pack_long(const long* val, size_t* len) } else { if (isInstant) { - productDefinitionTemplateNumberNew = 48; // 44 is deprecated + productDefinitionTemplateNumberNew = 50; // ECC-1963: 44 is deprecated } else { productDefinitionTemplateNumberNew = 46; diff --git a/src/accessor/grib_accessor_class_select_step_template.cc b/src/accessor/grib_accessor_class_select_step_template.cc index e37f62fa3..00cb2ca7b 100644 --- a/src/accessor/grib_accessor_class_select_step_template.cc +++ b/src/accessor/grib_accessor_class_select_step_template.cc @@ -70,7 +70,7 @@ int grib_accessor_select_step_template_t::pack_long(const long* val, size_t* len productDefinitionTemplateNumberNew = 41; break; case 46: // DET aerosol - productDefinitionTemplateNumberNew = 48; // 44 is deprecated + productDefinitionTemplateNumberNew = 50; // ECC-1963: 44 is deprecated break; case 47: // ENS aerosol productDefinitionTemplateNumberNew = 45; diff --git a/src/grib_util.cc b/src/grib_util.cc index a3998926b..abc72d830 100644 --- a/src/grib_util.cc +++ b/src/grib_util.cc @@ -1950,12 +1950,13 @@ int grib2_is_PDTN_ChemicalDistFunc(long pdtn) // Return 1 if the productDefinitionTemplateNumber (GRIB2) is for aerosols int grib2_is_PDTN_Aerosol(long pdtn) { - // Notes: PDT 44 is deprecated and replaced by 48 + // Notes: PDT 44 is deprecated and replaced by 50 // PDT 47 is deprecated and replaced by 85 return ( pdtn == 44 || pdtn == 48 || pdtn == 49 || + pdtn == 50 || pdtn == 45 || pdtn == 46 || pdtn == 47 || @@ -2014,6 +2015,9 @@ int grib2_choose_PDTN(int current_PDTN, bool is_det, bool is_instant) if (is_interval && is_ens) return 85; if (is_interval && is_det) return 46; } + if (current_PDTN == 50) { + if (is_instant && is_ens) return 45; + } return current_PDTN; // no change } @@ -2102,7 +2106,7 @@ int grib2_select_PDTN(int is_eps, int is_instant, } else { if (is_instant) - return 48; // 44 is deprecated + return 50; // ECC-1963: 44 is deprecated else return 46; } diff --git a/tests/grib2_chemicals_aerosols.sh b/tests/grib2_chemicals_aerosols.sh index 645dbc8e1..6ab0649a2 100755 --- a/tests/grib2_chemicals_aerosols.sh +++ b/tests/grib2_chemicals_aerosols.sh @@ -55,8 +55,8 @@ grib_check_key_equals $temp constituentType,numberOfModeOfDistribution,modeNumbe # Plain aerosols ${tools_dir}/grib_set -s tablesVersion=$latest,is_aerosol=1 $sample2 $temp -grib_check_key_equals $temp productDefinitionTemplateNumber '48' -grib_check_key_equals $temp aerosolType,typeOfSizeInterval,typeOfWavelengthInterval '0 0 0' +grib_check_key_equals $temp productDefinitionTemplateNumber '50' +grib_check_key_equals $temp aerosolType,typeOfSizeInterval '0 0' # Aerosol optical ${tools_dir}/grib_set -s tablesVersion=$latest,is_aerosol_optical=1 $sample2 $temp diff --git a/tests/grib2_templates.sh b/tests/grib2_templates.sh index 800a5aca9..47cdc3bce 100755 --- a/tests/grib2_templates.sh +++ b/tests/grib2_templates.sh @@ -242,7 +242,7 @@ grib_check_key_equals $temp productDefinitionTemplateNumber '43' # Aerosol 210072 $tools_dir/grib_set -s paramId=210072,stepType=instant,eps=0 $input $temp -grib_check_key_equals $temp productDefinitionTemplateNumber '48' +grib_check_key_equals $temp productDefinitionTemplateNumber '50' $tools_dir/grib_set -s paramId=210072,stepType=instant,eps=1 $input $temp grib_check_key_equals $temp productDefinitionTemplateNumber '45' diff --git a/tests/grib_local_ECMWF.sh b/tests/grib_local_ECMWF.sh index 830dd124d..a081322cc 100755 --- a/tests/grib_local_ECMWF.sh +++ b/tests/grib_local_ECMWF.sh @@ -222,7 +222,7 @@ ${tools_dir}/grib_set -s productDefinitionTemplateNumber=76,paramId=456000,setLo grib_check_key_equals $temp shortName drydep_vel_vol ${tools_dir}/grib_set -s paramId=215225,setLocalDefinition=1,localDefinitionNumber=36 $sample_g2 $temp -grib_check_key_equals $temp productDefinitionTemplateNumber 48 +grib_check_key_equals $temp productDefinitionTemplateNumber 50 ${tools_dir}/grib_set -s paramId=210251,setLocalDefinition=1,localDefinitionNumber=36 $sample_g2 $temp diff --git a/tests/grib_sub_hourly.sh b/tests/grib_sub_hourly.sh index a7a47f69f..4c4cd0e50 100755 --- a/tests/grib_sub_hourly.sh +++ b/tests/grib_sub_hourly.sh @@ -621,7 +621,7 @@ ${tools_dir}/grib_set -s stepUnits=s,paramId=131060 $sample_g2 $temp # probabili grib_check_key_equals $temp '-p indicatorOfUnitOfTimeRange,stepUnits:s,productDefinitionTemplateNumber' '13 s 9' ${tools_dir}/grib_set -s stepUnits=s,paramId=210073 $sample_g2 $temp # is_aerosol -grib_check_key_equals $temp '-p indicatorOfUnitOfTimeRange,stepUnits:s,productDefinitionTemplateNumber' '13 s 48' +grib_check_key_equals $temp '-p indicatorOfUnitOfTimeRange,stepUnits:s,productDefinitionTemplateNumber' '13 s 50' ${tools_dir}/grib_set -s stepUnits=s,paramId=210170 $sample_g2 $temp # is_chemical_srcsink grib_check_key_equals $temp '-p indicatorOfUnitOfTimeRange,stepUnits:s,productDefinitionTemplateNumber' '13 s 76' diff --git a/tests/unit_tests.cc b/tests/unit_tests.cc index c401b94aa..f0f1e8ffa 100644 --- a/tests/unit_tests.cc +++ b/tests/unit_tests.cc @@ -742,7 +742,7 @@ void test_grib2_select_PDTN() Assert( 67 == grib2_select_PDTN(!eps, !instant, 0, 0, chemical_distfn, 0, 0) ); // Aerosols - Assert( 48 == grib2_select_PDTN(!eps, instant, 0, 0, 0, aerosol, 0) ); + Assert( 50 == grib2_select_PDTN(!eps, instant, 0, 0, 0, aerosol, 0) ); Assert( 46 == grib2_select_PDTN(!eps, !instant, 0, 0, 0, aerosol, 0) ); Assert( 45 == grib2_select_PDTN(eps, instant, 0, 0, 0, aerosol, 0) ); Assert( 85 == grib2_select_PDTN(eps, !instant, 0, 0, 0, aerosol, 0) );