Skip to content

Commit

Permalink
Feature #2362 message_type_group_map take 2 (#2367)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway authored Dec 5, 2022
1 parent 05d4a8f commit 6c7fd1a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
5 changes: 3 additions & 2 deletions docs/Users_Guide/config_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,9 @@ containing a "key" string and "val" string. This defines a mapping of
message type group names to a comma-separated list of values. This map is
defined in the config files for PB2NC, Point-Stat, or Ensemble-Stat. Modify
this map to define sets of message types that should be processed together as
a group. The "SURFACE" entry must be present to define message types for
which surface verification logic should be applied.
a group. The "SURFACE" entry defines message types for which surface verification
logic should be applied. If not defined, the default values listed below are
used.

.. code-block:: none
Expand Down
5 changes: 5 additions & 0 deletions src/basic/vx_util/util_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ static const char surface_msg_typ_group_str [] = "SURFACE"; // Surface message t
static const char landsf_msg_typ_group_str [] = "LANDSF"; // Surface land message type group
static const char watersf_msg_typ_group_str [] = "WATERSF"; // Surface water message type group

// Default message type group values
static const char default_msg_typ_group_surface [] = "ADPSFC,SFCSHP,MSONET";
static const char default_msg_typ_group_landsf [] = "ADPSFC,MSONET";
static const char default_msg_typ_group_watersf [] = "SFCSHP";

// Commonly used regular expressions
static const char yyyymmdd_hhmmss_reg_exp[] =
"[0-9]\\{8,8\\}_[0-9]\\{6,6\\}";
Expand Down
11 changes: 4 additions & 7 deletions src/tools/core/ensemble_stat/ensemble_stat_conf_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,12 @@ void EnsembleStatConfInfo::process_config(GrdFileType etype,
msg_typ_group_map = parse_conf_message_type_group_map(&conf);

// Conf: message_type_group_map(SURFACE)
if(msg_typ_group_map.count((string)surface_msg_typ_group_str) == 0) {
mlog << Error << "\nEnsembleStatConfInfo::process_config() -> "
<< "\"" << conf_key_message_type_group_map
<< "\" must contain an entry for \""
<< surface_msg_typ_group_str << "\".\n\n";
exit(1);
ConcatString cs = surface_msg_typ_group_str;
if(msg_typ_group_map.count(cs) > 0) {
msg_typ_sfc = msg_typ_group_map[cs];
}
else {
msg_typ_sfc = msg_typ_group_map[(string)surface_msg_typ_group_str];
msg_typ_sfc.parse_css(default_msg_typ_group_surface);
}

// Conf: ens_member_ids
Expand Down
12 changes: 12 additions & 0 deletions src/tools/core/point_stat/point_stat_conf_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1018,18 +1018,30 @@ void PointStatVxOpt::set_vx_pd(PointStatConfInfo *conf_info) {
if(conf_info->msg_typ_group_map.count(cs) > 0) {
vx_pd.set_msg_typ_sfc(conf_info->msg_typ_group_map[cs]);
}
else {
sa.parse_css(default_msg_typ_group_surface);
vx_pd.set_msg_typ_sfc(sa);
}

// Store the surface land message type group
cs = landsf_msg_typ_group_str;
if(conf_info->msg_typ_group_map.count(cs) > 0) {
vx_pd.set_msg_typ_lnd(conf_info->msg_typ_group_map[cs]);
}
else {
sa.parse_css(default_msg_typ_group_landsf);
vx_pd.set_msg_typ_lnd(sa);
}

// Store the surface water message type group
cs = watersf_msg_typ_group_str;
if(conf_info->msg_typ_group_map.count(cs) > 0) {
vx_pd.set_msg_typ_wtr(conf_info->msg_typ_group_map[cs]);
}
else {
sa.parse_css(default_msg_typ_group_watersf);
vx_pd.set_msg_typ_wtr(sa);
}

// Define the verifying message type name and values
for(i=0; i<n_msg_typ; i++) {
Expand Down

0 comments on commit 6c7fd1a

Please sign in to comment.