diff --git a/src/libcode/vx_statistics/ens_stats.cc b/src/libcode/vx_statistics/ens_stats.cc index d0bcfde0bd..8349258ef0 100644 --- a/src/libcode/vx_statistics/ens_stats.cc +++ b/src/libcode/vx_statistics/ens_stats.cc @@ -225,6 +225,9 @@ void ECNTInfo::set(const PairDataEnsemble &pd) { double fbar, obar, ffbar, oobar, fobar; NumArray cur; + // Initalize + clear(); + // Store the number of ensemble members n_ens = pd.n_ens; @@ -257,9 +260,17 @@ void ECNTInfo::set(const PairDataEnsemble &pd) { } } - // Compute ensemble mean based statistics, if possible + // Check if the ensemble mean based statistics were + // already computed by Stat-Analysis + if(!is_bad_data(pd.me)) { + me = pd.me; + rmse = pd.rmse; + me_oerr = pd.me_oerr; + rmse_oerr = pd.rmse_oerr; + } + // If not, compute them from the pairs, if possible // HiRA stores the ensemble mean as bad data - if(!pd.mn_na.is_const(bad_data_double)) { + else if(!pd.mn_na.is_const(bad_data_double)) { // Compute ME and RMSE values fbar = obar = ffbar = oobar = fobar = 0.0;