diff --git a/met/src/libcode/vx_tc_util/pair_data_genesis.cc b/met/src/libcode/vx_tc_util/pair_data_genesis.cc index 2b3e5f07b7..b07185e4c1 100644 --- a/met/src/libcode/vx_tc_util/pair_data_genesis.cc +++ b/met/src/libcode/vx_tc_util/pair_data_genesis.cc @@ -260,7 +260,8 @@ void PairDataGenesis::add_fcst_gen(const GenesisInfo *fgi) { void PairDataGenesis::add_best_gen(const GenesisInfo *bgi, const int fcst_beg, const int fcst_end, const int init_add, const unixtime init_beg, const unixtime init_end, - const TimeArray &init_inc, const TimeArray &init_exc) { + const TimeArray &init_inc, const TimeArray &init_exc, + const NumArray &init_hour, const NumArray &lead) { if(!bgi) return; @@ -282,6 +283,11 @@ void PairDataGenesis::add_best_gen(const GenesisInfo *bgi, (init_exc.n() > 0 && init_exc.has(init_ut))) continue; + // Check if this initialization hour and lead time should be used + if((init_hour.n() > 0 && !init_hour.has(unix_to_sec_of_day(init_ut))) || + (lead.n() > 0 && !lead.has(nint(bgi->genesis_time() - init_ut)))) + continue; + // Check if this case already exists if(!has_case(bgi->storm_id(), init_ut, i_case)) { diff --git a/met/src/libcode/vx_tc_util/pair_data_genesis.h b/met/src/libcode/vx_tc_util/pair_data_genesis.h index 12949ec790..1725273751 100644 --- a/met/src/libcode/vx_tc_util/pair_data_genesis.h +++ b/met/src/libcode/vx_tc_util/pair_data_genesis.h @@ -129,7 +129,8 @@ class PairDataGenesis { void add_best_gen(const GenesisInfo *, const int, const int, const int, const unixtime, const unixtime, - const TimeArray &, const TimeArray &); + const TimeArray &, const TimeArray &, + const NumArray &, const NumArray &); void add_gen_pair(const GenesisInfo *, const GenesisInfo *); void set_gen_diff(int, const GenesisPairDiff &); diff --git a/met/src/tools/tc_utils/tc_gen/tc_gen.cc b/met/src/tools/tc_utils/tc_gen/tc_gen.cc index c6f136d5d5..1e339dbec5 100644 --- a/met/src/tools/tc_utils/tc_gen/tc_gen.cc +++ b/met/src/tools/tc_utils/tc_gen/tc_gen.cc @@ -22,6 +22,7 @@ // 005 04/02/21 Halley Gotway MET #1714 Refinem matching logic // 006 11/04/21 Halley Gotway MET #1809 Add -edeck option // 007 11/22/21 Halley Gotway MET #1810 Add -shape option +// 008 05/02/22 Halley Gotway MET #2148 Fix init_hour and lead misses // //////////////////////////////////////////////////////////////////////// @@ -605,7 +606,8 @@ void get_genesis_pairs(const TCGenVxOpt &vx_opt, conf_info.FcstSecBeg, conf_info.FcstSecEnd, conf_info.InitFreqHr*sec_per_hour, vx_opt.InitBeg, vx_opt.InitEnd, - vx_opt.InitInc, vx_opt.InitExc); + vx_opt.InitInc, vx_opt.InitExc, + vx_opt.InitHour, vx_opt.Lead); } // end for i bga // Loop over the model genesis events looking for pairs.