Commit 5c5dadda authored by Thibault Hallouin's avatar Thibault Hallouin
Browse files

fix dimension error in RANK_DIAG

1 merge request!3release v0.1.0
Pipeline #43638 passed with stage
in 2 minutes and 35 seconds
Showing with 5 additions and 6 deletions
+5 -6
...@@ -91,7 +91,7 @@ namespace evalhyd ...@@ -91,7 +91,7 @@ namespace evalhyd
xtl::xoptional<xt::xtensor<double, 6>, bool> CSI; xtl::xoptional<xt::xtensor<double, 6>, bool> CSI;
xtl::xoptional<xt::xtensor<double, 5>, bool> ROCSS; xtl::xoptional<xt::xtensor<double, 5>, bool> ROCSS;
// > Ranks-based // > Ranks-based
xtl::xoptional<xt::xtensor<double, 6>, bool> RANK_DIAG; xtl::xoptional<xt::xtensor<double, 5>, bool> RANK_DIAG;
xtl::xoptional<xt::xtensor<double, 4>, bool> DS; xtl::xoptional<xt::xtensor<double, 4>, bool> DS;
xtl::xoptional<xt::xtensor<double, 4>, bool> AS; xtl::xoptional<xt::xtensor<double, 4>, bool> AS;
...@@ -543,7 +543,7 @@ namespace evalhyd ...@@ -543,7 +543,7 @@ namespace evalhyd
return ROCSS.value(); return ROCSS.value();
}; };
xt::xtensor<double, 6> get_RANK_DIAG() xt::xtensor<double, 5> get_RANK_DIAG()
{ {
if (!RANK_DIAG.has_value()) if (!RANK_DIAG.has_value())
{ {
......
...@@ -208,7 +208,7 @@ namespace evalhyd ...@@ -208,7 +208,7 @@ namespace evalhyd
/// \return /// \return
/// Rank diagram. /// Rank diagram.
/// shape: (sites, lead times, subsets, samples, ranks) /// shape: (sites, lead times, subsets, samples, ranks)
inline xt::xtensor<double, 6> calc_RANK_DIAG( inline xt::xtensor<double, 5> calc_RANK_DIAG(
const xt::xtensor<double, 5>& o_j, const xt::xtensor<double, 5>& o_j,
const xt::xtensor<bool, 4>& t_msk, const xt::xtensor<bool, 4>& t_msk,
const std::vector<xt::xkeep_slice<int>>& b_exp, const std::vector<xt::xkeep_slice<int>>& b_exp,
...@@ -220,9 +220,8 @@ namespace evalhyd ...@@ -220,9 +220,8 @@ namespace evalhyd
) )
{ {
// initialise output variable // initialise output variable
xt::xtensor<double, 6> REL_DIAG = xt::xtensor<double, 5> REL_DIAG =
xt::zeros<double>({n_sit, n_ldt, n_msk, n_exp, xt::zeros<double>({n_sit, n_ldt, n_msk, n_exp, n_mbr + 1});
n_mbr + 1, std::size_t {2}});
// compute variable one mask at a time to minimise memory imprint // compute variable one mask at a time to minimise memory imprint
for (std::size_t m = 0; m < n_msk; m++) for (std::size_t m = 0; m < n_msk; m++)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment