Index: examples/wflow_rhine_sbm/wflow_sbm_NC.ini =================================================================== diff -u -rbf65fb743568cb9c44c6e4d96791dcc1c332a015 -ra102d31a70edb76290d7a7ec392483e23c948286 --- examples/wflow_rhine_sbm/wflow_sbm_NC.ini (.../wflow_sbm_NC.ini) (revision bf65fb743568cb9c44c6e4d96791dcc1c332a015) +++ examples/wflow_rhine_sbm/wflow_sbm_NC.ini (.../wflow_sbm_NC.ini) (revision a102d31a70edb76290d7a7ec392483e23c948286) @@ -41,8 +41,7 @@ [run] # either a runinfo file or a start and end-time are required #runinfo=runinfo.xml -starttime= 1995-01-31 00:00:00 -endtime= 1995-02-28 00:00:00 + # required, base timestep of the model timestepsecs = 86400 #start model with cold state Index: wflow-py/wflow/wf_DynamicFramework.py =================================================================== diff -u -r74a26d4abc5ad299215677362810eeebc9e2458b -ra102d31a70edb76290d7a7ec392483e23c948286 --- wflow-py/wflow/wf_DynamicFramework.py (.../wf_DynamicFramework.py) (revision 74a26d4abc5ad299215677362810eeebc9e2458b) +++ wflow-py/wflow/wf_DynamicFramework.py (.../wf_DynamicFramework.py) (revision a102d31a70edb76290d7a7ec392483e23c948286) @@ -652,6 +652,7 @@ # a runinfo file st = configget(self._userModel().config, 'run', 'starttime', "None") + if st == "None": rinfo_str = configget(self._userModel().config, 'run', 'runinfo', "None") rinfo = os.path.join(self._userModel().Dir, rinfo_str) @@ -668,7 +669,8 @@ self._userModel().timestepsecs = self.timestepsecs self._d_firstTimestep = 1 self._userModel()._setFirstTimeStep(self._d_firstTimestep) - self._d_lastTimestep = int(nrseconds / self.timestepsecs) + 1 + st = int(nrseconds / self.timestepsecs) + 1 + else: self.logger.info( "Not enough information in the [run] section. Need start and end time or a runinfo.xml file.... Reverting to default date/time") @@ -1942,20 +1944,34 @@ path = os.path.join(directoryPrefix, newName) assert path is not "" - if self.ncfile != "None": - retval = self.NcInput.gettimestep(self._userModel().currentTimeStep(), self.logger, var=varname) - return retval + if self._userModel()._inDynamic(): + if self.ncfile != "None": + retval = self.NcInput.gettimestep(self._userModel().currentTimeStep(), self.logger, var=varname) + return retval - if os.path.isfile(path): - mapje = readmap(path) - return mapje - else: - if verbose: - self.logger.debug("Input data (" + os.path.abspath(path) + ") for timestep not present, returning " + str(default)) - if fail: - self.logger.error("Required map: " + os.path.abspath(path) + " not found, exiting..") - sys.exit(1) - return scalar(default) + if os.path.isfile(path): + mapje = readmap(path) + return mapje + else: + if verbose: + self.logger.debug("Input data (" + os.path.abspath(path) + ") for timestep not present, returning " + str(default)) + if fail: + self.logger.error("Required map: " + os.path.abspath(path) + " not found, exiting..") + sys.exit(1) + return scalar(default) + if self._userModel()._inInitial(): + if os.path.isfile(path): + mapje = readmap(path) + return mapje + else: + if verbose: + self.logger.debug("Static input data (" + os.path.abspath(path) + ") not present, returning " + str(default)) + if fail: + self.logger.error("Required map: " + os.path.abspath(path) + " not found, exiting..") + sys.exit(1) + return scalar(default) + + elif style == 2: # Assuming they are set in memory by the API # first get basename (last bit of path) name = os.path.basename(name) Index: wflow-py/wflow/wf_netcdfio.py =================================================================== diff -u -re5747d2295c9ce7b3d0fa6009834b88b1e060369 -ra102d31a70edb76290d7a7ec392483e23c948286 --- wflow-py/wflow/wf_netcdfio.py (.../wf_netcdfio.py) (revision e5747d2295c9ce7b3d0fa6009834b88b1e060369) +++ wflow-py/wflow/wf_netcdfio.py (.../wf_netcdfio.py) (revision a102d31a70edb76290d7a7ec392483e23c948286) @@ -279,6 +279,7 @@ self.bufflst[var][bufpos, :, :] = data # Write out timestep buffer..... + if buffreset == 0 or idx == self.maxbuf - 1 or self.timesteps <= timestep: spos = idx - bufpos self.logger.debug(