Index: wflow-py/wflow/wflow_bmi.py =================================================================== diff -u -rfef6928683af218c4b3e7a26df6599dfe2add99d -rfcf326dea6943346002741f0ca020df89f7b03fa --- wflow-py/wflow/wflow_bmi.py (.../wflow_bmi.py) (revision fef6928683af218c4b3e7a26df6599dfe2add99d) +++ wflow-py/wflow/wflow_bmi.py (.../wflow_bmi.py) (revision fcf326dea6943346002741f0ca020df89f7b03fa) @@ -109,13 +109,30 @@ self.dynModel._wf_shutdown() self.bmilogger.debug("finalize: shutting down bmi") + def update(self, dt): """ Return type string, compatible with numpy. - Propagate the model dt seconds or ( if dt == -1) one timestep + Propagate the model dt timesteps """ + + nrsteps = int(dt) + self.bmilogger.debug("update: dt = " + str(dt)) + self.bmilogger.debug("update: update " + str(nrsteps) + " timesteps.") + if nrsteps >= 1: + self.dynModel._runDynamic(self.currenttimestep, self.currenttimestep + nrsteps -1) + self.currenttimestep = self.currenttimestep + nrsteps + else: + self.bmilogger.debug("Update: nothing done, number of steps < 1") + + def update_as_it_should_be(self, dt): + """ + Return type string, compatible with numpy. + Propagate the model dt timesteps + """ # TODO: fix dt = -1 problem, what do we want here? #curstep = self.dynModel.wf_ + if dt == -1: self.bmilogger.debug("update: dt = " + str(dt)) self.bmilogger.debug("update: update default, 1 timestep") @@ -125,7 +142,7 @@ nrsteps = int(dt/self.dynModel.DT.timeStepSecs) self.bmilogger.debug("update: dt = " + str(dt)) self.bmilogger.debug("update: update " + str(nrsteps) + " timesteps.") - if nrsteps > 1: + if nrsteps >= 1: self.dynModel._runDynamic(self.currenttimestep, self.currenttimestep + nrsteps -1) self.currenttimestep = self.currenttimestep + nrsteps else: