From 11bbb3333706acd70a2f2d5bede57d0477d1b699 Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Mon, 30 Nov 2020 10:14:20 +0100 Subject: [PATCH] Shift the report step argument used when calling UDQ eval --- ebos/eclwriter.hh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ebos/eclwriter.hh b/ebos/eclwriter.hh index 05c9a0f1b..1401e234b 100644 --- a/ebos/eclwriter.hh +++ b/ebos/eclwriter.hh @@ -328,8 +328,15 @@ public: blockData, aquiferData); - const auto& udq_config = schedule().getUDQConfig(reportStepNum); - udq_config.eval( reportStepNum, schedule().wellMatcher(reportStepNum), summaryState(), udqState() ); + /* + Off-by-one-fun: The reportStepNum argument corresponds to the + report step these results will be written to, whereas the argument + to UDQ function evaluation corresponds to the report step we are + currently on. + */ + auto udq_step = reportStepNum - 1; + const auto& udq_config = schedule().getUDQConfig(udq_step); + udq_config.eval( udq_step, schedule().wellMatcher(udq_step), summaryState(), udqState() ); buffer = summaryState().serialize(); }