Skip to content

Commit

Permalink
Per #1879, porting the same changes over to the develop branch. (#1881)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway authored Aug 18, 2021
1 parent f903075 commit 7fdb052
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
17 changes: 8 additions & 9 deletions met/src/libcode/vx_data2d_grib/var_info_grib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,7 @@ void VarInfoGrib::add_grib_code (Dictionary &dict)
}
int field_center = dict.lookup_int (conf_key_GRIB1_center, false);
int field_subcenter = dict.lookup_int (conf_key_GRIB1_subcenter, false);
Grib1TableEntry tab;

// if not specified, fill others with default values
if(field_ptv == bad_data_int) field_ptv = default_grib1_ptv;
if(field_center == bad_data_int) field_center = default_grib1_center;
if(field_subcenter == bad_data_int) field_subcenter = default_grib1_subcenter;
Grib1TableEntry tab;

// if the name is specified, use it
if( !field_name.empty() ){
Expand All @@ -229,9 +224,13 @@ void VarInfoGrib::add_grib_code (Dictionary &dict)
if( !GribTable.lookup_grib1(field_name.c_str(), default_grib1_ptv, field_code, default_grib1_center, default_grib1_subcenter, tab, tab_match) )
{
mlog << Error << "\nVarInfoGrib::add_grib_code() -> "
<< "unrecognized GRIB1 field abbreviation '"
<< field_name << "' for table version " << field_ptv
<< "\n\n";
<< "unrecognized GRIB1 field abbreviation '" << field_name
<< "' for table version (" << field_ptv
<< "), center (" << field_center
<< "), and subcenter (" << field_subcenter
<< ") or default table version (" << default_grib1_ptv
<< "), center (" << default_grib1_center
<< "), and subcenter (" << default_grib1_subcenter << ").\n\n";
exit(1);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ void EnsembleStatVxOpt::process_config(GrdFileType ftype, Dictionary &fdict,
vx_pd.obs_info->set_dict(odict);

// Set the GRIB code for point observations
if(!use_var_id) vx_pd.obs_info->add_grib_code(odict);
if(point_vx && !use_var_id) vx_pd.obs_info->add_grib_code(odict);

// Dump the contents of the current VarInfo
if(mlog.verbosity_level() >= 5) {
Expand Down

0 comments on commit 7fdb052

Please sign in to comment.