From 27fe8f5c68639527424fe4ee29bc3fbbd79fb879 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Tue, 16 Jul 2024 20:31:35 +0000 Subject: [PATCH] Per #2924, update Ensemble-Stat to set the VxPairBase::fcst_info pointer --- src/libcode/vx_statistics/pair_base.cc | 2 +- src/libcode/vx_statistics/pair_data_ensemble.cc | 2 +- src/tools/core/ensemble_stat/ensemble_stat_conf_info.cc | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/libcode/vx_statistics/pair_base.cc b/src/libcode/vx_statistics/pair_base.cc index 6ef9cdc1c..67cca2428 100644 --- a/src/libcode/vx_statistics/pair_base.cc +++ b/src/libcode/vx_statistics/pair_base.cc @@ -871,7 +871,7 @@ VxPairBase & VxPairBase::operator=(const VxPairBase &vx_pb) { void VxPairBase::init_from_scratch() { fcst_info = (VarInfo *) nullptr; - obs_info = (VarInfo *) nullptr; + obs_info = (VarInfo *) nullptr; fclm_info = (VarInfo *) nullptr; oclm_info = (VarInfo *) nullptr; diff --git a/src/libcode/vx_statistics/pair_data_ensemble.cc b/src/libcode/vx_statistics/pair_data_ensemble.cc index 0e45c45fe..0f6aee54b 100644 --- a/src/libcode/vx_statistics/pair_data_ensemble.cc +++ b/src/libcode/vx_statistics/pair_data_ensemble.cc @@ -1049,7 +1049,7 @@ void VxPairDataEnsemble::set_ens_info(EnsVarInfo *info) { ens_info = new EnsVarInfo(*info); // Set the base pointer - if(!fcst_info) set_fcst_info(info->get_var_info()); + if(!fcst_info) set_fcst_info(ens_info->get_var_info()); return; } diff --git a/src/tools/core/ensemble_stat/ensemble_stat_conf_info.cc b/src/tools/core/ensemble_stat/ensemble_stat_conf_info.cc index 4b7b03c9b..6bd534126 100644 --- a/src/tools/core/ensemble_stat/ensemble_stat_conf_info.cc +++ b/src/tools/core/ensemble_stat/ensemble_stat_conf_info.cc @@ -665,6 +665,9 @@ void EnsembleStatVxOpt::process_config(GrdFileType ftype, Dictionary &fdict, input_info.file_list = ens_files; vx_pd.ens_info->add_input(input_info); + // Set the fcst_info, if needed + if(!vx_pd.fcst_info) vx_pd.set_fcst_info(next_var); + // Add InputInfo to fcst info list for each ensemble file provided // set var_info to nullptr to note first VarInfo should be used int last_member_index = ens_files->n() - (use_ctrl ? 1 : 0); @@ -695,7 +698,7 @@ void EnsembleStatVxOpt::process_config(GrdFileType ftype, Dictionary &fdict, } // Allocate new VarInfo object for obs - vx_pd.obs_info = info_factory.new_var_info(otype); + vx_pd.obs_info = info_factory.new_var_info(otype); // Set the VarInfo objects vx_pd.obs_info->set_dict(odict);