Index: wflow-py/wflow/wflow_bmi.py =================================================================== diff -u -r78b81240834b72259fab14b4081f2b9cf0cd44ec -r77194d628eb5380f03db806ed483bb4d10ac2676 --- wflow-py/wflow/wflow_bmi.py (.../wflow_bmi.py) (revision 78b81240834b72259fab14b4081f2b9cf0cd44ec) +++ wflow-py/wflow/wflow_bmi.py (.../wflow_bmi.py) (revision 77194d628eb5380f03db806ed483bb4d10ac2676) @@ -3,7 +3,7 @@ import os import logging -#TODO: Set log level also ini to be able to make quiet runs +#TODO: Set log level also ini to be able to make quiet or non-quiet runs #TODO: set re-init in the ini file to be able to make cold start runs #TODO: Rework framework to get rid of max timesteps shit @@ -15,7 +15,8 @@ - the configfile wih be a full path - we define the case from the basedir of the configfile """ - retval = 0; + retval = 0 + self.currenttimestep = 1 wflow_cloneMap = 'wflow_subcatch.map' datadir = os.path.dirname(configfile) inifile = os.path.basename(configfile) @@ -54,10 +55,19 @@ def update(self, dt): """ Return type string, compatible with numpy. + Propagate the model one timestep? """ - pass + #curstep = self.dynModel.wf_ + if dt == -1: + self.dynModel._runDynamic(self.currenttimestep, self.currenttimestep) + self.currentTime = self.currenttimestep + 1 + else: + nrsteps = int(dt/self.dynModel.timestepsecs) + self.dynModel._runDynamic(self.currenttimestep, self.currenttimestep + nrsteps -1) + self.currentTime = self.currenttimestep + nrsteps + def get_var_count(self): """ Return number of variables