Index: wflow-py/Sandbox/wflow_topoflex/wflow_topoflex.py =================================================================== diff -u -r878b2936e851fa3890ca517ade8a9effe1c6c63a -r950bf9d5ed116fcdf860b2ead9550d54523fb1f2 --- wflow-py/Sandbox/wflow_topoflex/wflow_topoflex.py (.../wflow_topoflex.py) (revision 878b2936e851fa3890ca517ade8a9effe1c6c63a) +++ wflow-py/Sandbox/wflow_topoflex/wflow_topoflex.py (.../wflow_topoflex.py) (revision 950bf9d5ed116fcdf860b2ead9550d54523fb1f2) @@ -509,7 +509,8 @@ # TODO: change rainfall .tss files into grids self.wf_updateparameters() # read the temperature map for each step (see parameters()) - self.logger.debug("Step: "+str(int(self.thestep + self._d_firstTimeStep))+"/"+str(int(self._d_nrTimeSteps))) + self.logger.debug("Step: " + str(int(self.currentStep)) + "/" + str(int(self._d_nrTimeSteps))) + self.thestep = self.thestep + 1 self.Si_t = copylist(self.Si) Index: wflow-py/wflow/wf_DynamicFramework.py =================================================================== diff -u -r2c1871f08cd7f185412a558a3b0e4faa4ebd224c -r950bf9d5ed116fcdf860b2ead9550d54523fb1f2 --- wflow-py/wflow/wf_DynamicFramework.py (.../wf_DynamicFramework.py) (revision 2c1871f08cd7f185412a558a3b0e4faa4ebd224c) +++ wflow-py/wflow/wf_DynamicFramework.py (.../wf_DynamicFramework.py) (revision 950bf9d5ed116fcdf860b2ead9550d54523fb1f2) @@ -269,20 +269,16 @@ self._addMethodToClass(self.wf_updateparameters) self._addAttributeToClass("ParamType",self.ParamType) - - self._userModel()._setNrTimeSteps(lastTimeStep - firstTimestep + 1) - if firstTimestep == 0: - self._d_firstTimestep = 1 - else: - self._d_firstTimestep = firstTimestep - self._userModel()._setFirstTimeStep(self._d_firstTimestep) + #self._userModel()._setNrTimeSteps(lastTimeStep - firstTimestep + 1) + self._userModel()._setNrTimeSteps(lastTimeStep + 1) + self._d_firstTimestep = 1 + self._userModel()._setFirstTimeStep(1) self._d_lastTimestep = lastTimeStep self.APIDebug = 0 self._userModel().currentdatetime = self.currentdatetime + self._userModel()._setCurrentTimeStep(firstTimestep) - - def wf_updateparameters(self): """ Update the model Parameters (can be used in static and dynamic part of the model) Index: wflow-py/wflow/wflow_hbv.py =================================================================== diff -u -re27d0afdd07a07f344b793be87029591128be64c -r950bf9d5ed116fcdf860b2ead9550d54523fb1f2 --- wflow-py/wflow/wflow_hbv.py (.../wflow_hbv.py) (revision e27d0afdd07a07f344b793be87029591128be64c) +++ wflow-py/wflow/wflow_hbv.py (.../wflow_hbv.py) (revision 950bf9d5ed116fcdf860b2ead9550d54523fb1f2) @@ -686,10 +686,9 @@ :var self.ToCubic: Mutiplier to convert mm to m^3/s for fluxes """ - self.logger.debug("Step: "+str(int(self.thestep + self._d_firstTimeStep))+"/"+str(int(self._d_nrTimeSteps))) + self.logger.debug("Step: " + str(int(self.currentStep)) + "/" + str(int(self._d_nrTimeSteps))) self.thestep = self.thestep + 1 - self.wf_updateparameters() # read forcing an dynamic parameters #self.Precipitation=cover(self.wf_readmap(self.P_mapstack,0.0),0.0) * self.Pcorr Index: wflow-py/wflow/wflow_routing.py =================================================================== diff -u -r5146577206d9aab9bde79b912dbe038515b57bb7 -r950bf9d5ed116fcdf860b2ead9550d54523fb1f2 --- wflow-py/wflow/wflow_routing.py (.../wflow_routing.py) (revision 5146577206d9aab9bde79b912dbe038515b57bb7) +++ wflow-py/wflow/wflow_routing.py (.../wflow_routing.py) (revision 950bf9d5ed116fcdf860b2ead9550d54523fb1f2) @@ -135,18 +135,17 @@ This function is specific for each model and **must** be present. - :var self.SurfaceRunoff: Surface runoff in the kin-wave resrvoir [m^3/s] - :var self.WaterLevel: Water level in the kin-wave resrvoir [m] - """ + :var self.SurfaceRunoff: Surface runoff in the kin-wave resrvoir [m^3/s] + :var self.WaterLevel: Water level in the kin-wave resrvoir [m] + """ states = ['SurfaceRunoff', 'WaterLevel'] return states - def supplyCurrentTime(self): """ - gets the current time in seconds after the start of the run - """ + gets the current time in seconds after the start of the run + """ return self.currentTimeStep() * self.timestepsecs @@ -163,7 +162,6 @@ self.logger.info("Saving initial conditions for FEWS...") self.wf_suspend(self.Dir + "/outstate/") - def initial(self): """ Initial part of the model, executed only once. Reads all static data from disk @@ -187,7 +185,6 @@ self.inflowTss = "/intss/Inflow.tss" self.logger.info("running for " + str(self.nrTimeSteps()) + " timesteps") - # Set and get defaults from ConfigFile here ################################### self.reinit = int(configget(self.config, "model", "reinit", "0")) self.fewsrun = int(configget(self.config, "model", "fewsrun", "0")) @@ -224,8 +221,6 @@ wflow_landuse = configget(self.config, "model", "wflow_landuse", "staticmaps/wflow_landuse.map") wflow_soil = configget(self.config, "model", "wflow_soil", "staticmaps/wflow_soil.map") - - # 2: Input base maps ######################################################## subcatch = ordinal(readmap(os.path.join(self.Dir,wflow_subcatch))) # Determines the area of calculations (all cells > 0) subcatch = ifthen(subcatch > 0, subcatch) @@ -258,7 +253,6 @@ self.Inflow_mapstack = self.Dir + configget(self.config, "inputmapstacks", "Inflow", "/inmaps/IF") # timeseries for rainfall "/inmaps/IF" # in/outflow locations (abstractions) - self.Latitude = ycoordinate(boolean(self.Altitude)) self.Longitude = xcoordinate(boolean(self.Altitude)) @@ -311,7 +305,6 @@ #self.DistToUpdPt = ldddist(self.TopoLdd,boolean(cover(self.OutputId,0.0)),1) #* self.reallength/celllength() - # Initializing of variables self.logger.info("Initializing of model variables..") self.TopoLdd = lddmask(self.TopoLdd, boolean(self.TopoId)) @@ -344,8 +337,6 @@ self.SlopeDCL = self.Slope * self.reallength/self.DCL - - # water depth (m) # set width for kinematic wave to cell width for all cells self.Bw = detdrainwidth(self.TopoLdd, self.xl, self.yl) @@ -361,7 +352,6 @@ self.AlpPow = (2.0 / 3.0) * self.Beta # initial approximation for Alpha - self.logger.info("Saving summary maps...") if self.updating: @@ -390,7 +380,6 @@ return lst - def resume(self): if self.reinit == 1: @@ -401,8 +390,6 @@ self.logger.info("Setting initial conditions from state files") self.wf_resume(os.path.join(self.Dir,"instate")) - - P = self.Bw + (2.0 * self.WaterLevel) self.Alpha = self.AlpTerm * pow(P, self.AlpPow) self.OldSurfaceRunoff = self.SurfaceRunoff @@ -411,10 +398,8 @@ # Determine initial kinematic wave volume self.KinWaveVolume = self.WaterLevel * self.Bw * self.DCL self.OldKinWaveVolume = self.KinWaveVolume - self.SurfaceRunoffMM = self.SurfaceRunoff * self.QMMConv - def dynamic(self): """ Stuf that is done for each timestep @@ -437,10 +422,8 @@ :var self.ToCubic: Mutiplier to convert mm to m^3/s for fluxes """ - self.logger.debug( - "Step: " + str(int(self.thestep + self._d_firstTimeStep)) + "/" + str(int(self._d_nrTimeSteps))) + self.logger.debug("Step: " + str(int(self.currentStep)) + "/" + str(int(self._d_nrTimeSteps))) self.thestep = self.thestep + 1 - self.InwaterForcing = cover(self.wf_readmap(self.IW_mapstack, 1.0), scalar(0.0)) if self.thestep > 28: @@ -593,9 +576,6 @@ dynModelFw._runResume() dynModelFw._runDynamic(_firstTimeStep, _lastTimeStep) dynModelFw._runSuspend() - - fp = open(caseName + "/" + runId + "/runinfo/configofrun.ini", 'wb') - myModel.config.write(fp) dynModelFw._wf_shutdown() Index: wflow-py/wflow/wflow_sbm.py =================================================================== diff -u -re27d0afdd07a07f344b793be87029591128be64c -r950bf9d5ed116fcdf860b2ead9550d54523fb1f2 --- wflow-py/wflow/wflow_sbm.py (.../wflow_sbm.py) (revision e27d0afdd07a07f344b793be87029591128be64c) +++ wflow-py/wflow/wflow_sbm.py (.../wflow_sbm.py) (revision 950bf9d5ed116fcdf860b2ead9550d54523fb1f2) @@ -966,10 +966,8 @@ :var self.ToCubic: Mutiplier to convert mm to m^3/s for fluxes """ - - self.logger.debug( - "Step: " + str(int(self.thestep + self._d_firstTimeStep)) + "/" + str(int(self._d_nrTimeSteps))) + "Step: " + str(int(self.currentStep)) + "/" + str(int(self._d_nrTimeSteps))) self.thestep = self.thestep + 1 # Read forcing data and dynamic parameters