diff --git a/src/tools/core/grid_stat/grid_stat.cc b/src/tools/core/grid_stat/grid_stat.cc index 45afc7461..702de39fd 100644 --- a/src/tools/core/grid_stat/grid_stat.cc +++ b/src/tools/core/grid_stat/grid_stat.cc @@ -114,6 +114,7 @@ // 056 01/29/24 Halley Gotway MET #2801 Configure time difference warnings. // 057 07/05/24 Halley Gotway MET #2924 Support forecast climatology. // 058 10/03/24 Halley Gotway MET #2887 Compute weighted contingency tables. +// 059 11/15/24 Halley Gotway MET #3020 SEEPS NetCDF output. // //////////////////////////////////////////////////////////////////////// @@ -1267,23 +1268,36 @@ void process_scores() { SeepsAggScore seeps_agg; int month, day, year, hour, minute, second; + // Compute SEEPS statistics unix_to_mdyhms(fcst_dp.valid(), month, day, year, hour, minute, second); compute_aggregated_seeps_grid(fcst_dp_smooth, obs_dp_smooth, seeps_dp, seeps_dp_fcat, seeps_dp_ocat, &seeps_agg, month, hour, conf_info.seeps_p1_thresh, conf_info.seeps_climo_name); - write_nc("SEEPS_MPR_SCORE", seeps_dp, - i, mthd, pnts, - conf_info.vx_opt[i].interp_info.field); - write_nc("SEEPS_MPR_FCAT", seeps_dp_fcat, - i, mthd, pnts, - conf_info.vx_opt[i].interp_info.field); - write_nc("SEEPS_MPR_OCAT", seeps_dp_ocat, - i, mthd, pnts, - conf_info.vx_opt[i].interp_info.field); - write_seeps_row(shc, &seeps_agg, conf_info.output_flag[i_seeps], - stat_at, i_stat_row, txt_at[i_seeps], i_txt_row[i_seeps]); + // Write out SEEPS + if(conf_info.vx_opt[i].output_flag[i_seeps] != STATOutputType::None && + seeps_agg.n_obs > 0) { + + write_seeps_row(shc, &seeps_agg, + conf_info.output_flag[i_seeps], + stat_at, i_stat_row, + txt_at[i_seeps], i_txt_row[i_seeps]); + } + + // MET #3020 + // Write out the SEEPS data if requested in the config file + if(conf_info.vx_opt[i].nc_info.do_seeps) { + write_nc("SEEPS_MPR_SCORE", seeps_dp, + i, mthd, pnts, + conf_info.vx_opt[i].interp_info.field); + write_nc("SEEPS_MPR_FCAT", seeps_dp_fcat, + i, mthd, pnts, + conf_info.vx_opt[i].interp_info.field); + write_nc("SEEPS_MPR_OCAT", seeps_dp_ocat, + i, mthd, pnts, + conf_info.vx_opt[i].interp_info.field); + } } // Compute gradient statistics if requested in the config file diff --git a/src/tools/core/grid_stat/grid_stat_conf_info.cc b/src/tools/core/grid_stat/grid_stat_conf_info.cc index d33480485..f9b704e45 100644 --- a/src/tools/core/grid_stat/grid_stat_conf_info.cc +++ b/src/tools/core/grid_stat/grid_stat_conf_info.cc @@ -359,6 +359,7 @@ void GridStatConfInfo::process_flags() { if(vx_opt[i].nc_info.do_diff) nc_info.do_diff = true; if(vx_opt[i].nc_info.do_climo) nc_info.do_climo = true; if(vx_opt[i].nc_info.do_climo_cdp) nc_info.do_climo_cdp = true; + if(vx_opt[i].nc_info.do_seeps) nc_info.do_seeps = true; if(vx_opt[i].nc_info.do_weight) nc_info.do_weight = true; if(vx_opt[i].nc_info.do_nbrhd) nc_info.do_nbrhd = true; if(vx_opt[i].nc_info.do_fourier) nc_info.do_fourier = true; @@ -987,6 +988,7 @@ void GridStatVxOpt::parse_nc_info(Dictionary &odict) { nc_info.do_diff = d->lookup_bool(conf_key_diff_flag); nc_info.do_climo = d->lookup_bool(conf_key_climo_flag); nc_info.do_climo_cdp = d->lookup_bool(conf_key_climo_cdp_flag); + nc_info.do_seeps = d->lookup_bool(conf_key_seeps_flag); nc_info.do_weight = d->lookup_bool(conf_key_weight); nc_info.do_nbrhd = d->lookup_bool(conf_key_nbrhd); nc_info.do_fourier = d->lookup_bool(conf_key_fourier); @@ -1310,10 +1312,10 @@ void GridStatNcOutInfo::clear() { bool GridStatNcOutInfo::all_false() const { - bool status = do_latlon || do_raw || do_diff || - do_climo || do_climo_cdp || do_weight || - do_nbrhd || do_fourier || do_gradient || - do_distance_map || do_apply_mask; + bool status = do_latlon || do_raw || do_diff || + do_climo || do_climo_cdp || do_seeps || + do_weight || do_nbrhd || do_fourier || + do_gradient || do_distance_map || do_apply_mask; return !status; } @@ -1327,6 +1329,7 @@ void GridStatNcOutInfo::set_all_false() { do_diff = false; do_climo = false; do_climo_cdp = false; + do_seeps = false; do_weight = false; do_nbrhd = false; do_fourier = false; @@ -1346,6 +1349,7 @@ void GridStatNcOutInfo::set_all_true() { do_diff = true; do_climo = true; do_climo_cdp = true; + do_seeps = true; do_weight = true; do_nbrhd = true; do_fourier = true; diff --git a/src/tools/core/grid_stat/grid_stat_conf_info.h b/src/tools/core/grid_stat/grid_stat_conf_info.h index c3e72ee3a..e24326c7c 100644 --- a/src/tools/core/grid_stat/grid_stat_conf_info.h +++ b/src/tools/core/grid_stat/grid_stat_conf_info.h @@ -106,6 +106,7 @@ struct GridStatNcOutInfo { bool do_diff; bool do_climo; bool do_climo_cdp; + bool do_seeps; bool do_weight; bool do_nbrhd; bool do_fourier;