Index: wflow-py/wflow/wflow_lintul.py =================================================================== diff -u -rc8e2fba98b7e0b0d9062e2dba1cba046ce931bab -rf9a67f43fd202fe232f1e8fdba72deef767f4bf7 --- wflow-py/wflow/wflow_lintul.py (.../wflow_lintul.py) (revision c8e2fba98b7e0b0d9062e2dba1cba046ce931bab) +++ wflow-py/wflow/wflow_lintul.py (.../wflow_lintul.py) (revision f9a67f43fd202fe232f1e8fdba72deef767f4bf7) @@ -873,7 +873,6 @@ configfile="wflow_lintul.ini" _lastTimeStep = 150 _firstTimeStep = 0 - fewsrun = False runinfoFile = "runinfo.xml" timestepsecs=86400 wflow_cloneMap = 'wflow_subcatch.map' @@ -896,9 +895,6 @@ pcrut.usage(msg) for o, a in opts: - if o == '-F': - runinfoFile = a - fewsrun = True if o == '-C': caseName = a if o == '-R': runId = a if o == '-c': configfile = a @@ -910,18 +906,9 @@ if (len(opts) <=1): usage() - if fewsrun: - ts = getTimeStepsfromRuninfo(runinfoFile, timestepsecs) - starttime = getStartTimefromRuninfo(runinfoFile) - if (ts): - _lastTimeStep = ts - _firstTimeStep = 1 - else: - print "Failed to get timesteps from runinfo file: " + runinfoFile - exit(2) - else: - starttime = dt.datetime(1990,01,01) + starttime = dt.datetime(1990,01,01) + myModel = WflowModel(wflow_cloneMap, caseName,runId,configfile) dynModelFw = wf_DynamicFramework(myModel, _lastTimeStep,firstTimestep=_firstTimeStep,datetimestart=starttime) Index: wflow-py/wflow/wflow_sbm_old.py =================================================================== diff -u -r193933c8d2de92c0b013f3d1dbee4cbf60e21c33 -rf9a67f43fd202fe232f1e8fdba72deef767f4bf7 --- wflow-py/wflow/wflow_sbm_old.py (.../wflow_sbm_old.py) (revision 193933c8d2de92c0b013f3d1dbee4cbf60e21c33) +++ wflow-py/wflow/wflow_sbm_old.py (.../wflow_sbm_old.py) (revision f9a67f43fd202fe232f1e8fdba72deef767f4bf7) @@ -29,11 +29,7 @@ [-c configfile][-T last_step][-S first_step][-s seconds][-W][-E][-N][-U discharge] [-P parameter multiplication][-X][-f][-I][-i tbl_dir][-x subcatchId][-u updatecols] [-p inputparameter multiplication][-l loglevel] - - -F: if set wflow is expected to be run by FEWS. It will determine - the timesteps from the runinfo.xml file and save the output initial - conditions to an alternate location. Also set fewsrun=1 in the .ini file! - + -X: save state at the end of the run over the initial conditions at the start -f: Force overwrite of existing results @@ -344,9 +340,6 @@ self.logger.info("Saving initial conditions over start conditions...") self.wf_suspend(self.SaveDir + "/instate/") - if self.fewsrun: - self.logger.info("Saving initial conditions for FEWS...") - self.wf_suspend(self.Dir + "/outstate/") def parameters(self): @@ -450,7 +443,6 @@ # Set and get defaults from ConfigFile here ################################### self.Tslice = int(configget(self.config, "model", "Tslice", "1")) self.reinit = int(configget(self.config, "run", "reinit", "0")) - self.fewsrun = int(configget(self.config, "run", "fewsrun", "0")) self.OverWriteInit = int(configget(self.config, "model", "OverWriteInit", "0")) self.updating = int(configget(self.config, "model", "updating", "0")) self.updateFile = configget(self.config, "model", "updateFile", "no_set") @@ -1526,7 +1518,6 @@ _lastTimeStep = 1 _firstTimeStep = 0 LogFileName = "wflow.log" - fewsrun = False runinfoFile = "runinfo.xml" timestepsecs = 86400 wflow_cloneMap = 'wflow_subcatch.map' @@ -1548,9 +1539,6 @@ pcrut.usage(msg) for o, a in opts: - if o == '-F': - runinfoFile = a - fewsrun = True if o == '-C': caseName = a if o == '-R': runId = a if o == '-c': configfile = a @@ -1562,17 +1550,8 @@ if o == '-f': _NoOverWrite = 0 if o == '-l': exec "loglevel = logging." + a - if fewsrun: - ts = getTimeStepsfromRuninfo(runinfoFile, timestepsecs) - starttime = getStartTimefromRuninfo(runinfoFile) - if (ts): - _lastTimeStep = ts - _firstTimeStep = 1 - else: - print "Failed to get timesteps from runinfo file: " + runinfoFile - exit(2) - else: - starttime = dt.datetime(1990,01,01) + + starttime = dt.datetime(1990,01,01) if _lastTimeStep < _firstTimeStep: print "The starttimestep (" + str(_firstTimeStep) + ") is smaller than the last timestep (" + str( Index: wflow-py/wflow/wflow_snow.py =================================================================== diff -u -r2e4b13843097b6d76d6b830c4a1df423225b9cfd -rf9a67f43fd202fe232f1e8fdba72deef767f4bf7 --- wflow-py/wflow/wflow_snow.py (.../wflow_snow.py) (revision 2e4b13843097b6d76d6b830c4a1df423225b9cfd) +++ wflow-py/wflow/wflow_snow.py (.../wflow_snow.py) (revision f9a67f43fd202fe232f1e8fdba72deef767f4bf7) @@ -33,10 +33,7 @@ wflow_snow [-h][-v level][-F runinfofile][-L logfile][-C casename][-R runId] [-c configfile][-T timesteps][-s seconds][-W][-E][-N][-U discharge] [-P parameter multiplication] --F: if set wflow is expected to be run by FEWS. It will determine - the timesteps from the runinfo.xml file and save the output initial - conditions to an alternate location. The runinfo.xml file should be located - in the inmaps directory of the case. + -X: save state at the end of the run over the initial conditions at the start -f: Force overwrite of existing results -T: Set last timestep @@ -215,9 +212,7 @@ self.wf_suspend(self.SaveDir + "/instate/") - if self.fewsrun: - self.logger.info("Saving initial conditions for FEWS...") - self.wf_suspend(self.Dir + "/outstate/") + report(self.sumprecip,self.SaveDir + "/outsum/sumprecip.map") report(self.sumtemp,self.SaveDir + "/outsum/sumtemp.map") @@ -250,7 +245,6 @@ self.Tslice = int(configget(self.config,"model","Tslice","1")) self.interpolMethod = configget(self.config,"model","InterpolationMethod","inv") self.reinit = int(configget(self.config,"run","reinit","0")) - self.fewsrun = int(configget(self.config,"run","fewsrun","0")) self.OverWriteInit = int(configget(self.config,"model","OverWriteInit","0")) self.MassWasting = int(configget(self.config,"model","MassWasting","0")) self.sCatch = int(configget(self.config,"model","sCatch","0")) @@ -468,7 +462,7 @@ configfile="wflow_pack.ini" _lastTimeStep = 10 _firstTimeStep = 1 - fewsrun=False + runinfoFile="runinfo.xml" timestepsecs=86400 wflow_cloneMap = 'wflow_subcatch.map' @@ -479,15 +473,12 @@ ## Main model starts here ######################################################################## try: - opts, args = getopt.getopt(sys.argv[1:], 'Mc:QXS:F:hC:Ii:T:NR:u:s:P:p:Xx:U:f') + opts, args = getopt.getopt(sys.argv[1:], 'Mc:QXS:hC:Ii:T:NR:u:s:P:p:Xx:U:f') except getopt.error, msg: pcrut.usage(msg) for o, a in opts: - if o == '-F': - runinfoFile = a - fewsrun = True if o == '-P': exec "multpars =" + a print "WARN: -P Does not work at the moment" @@ -503,10 +494,7 @@ if o == '-h': usage() if o == '-f': NoOverWrite = 1 - - if fewsrun: - _lastTimeStep = wflow_adapt.getTimeStepsfromRuninfo(runinfoFile) * 86400/timestepsecs - _firstTimeStep = 1 + myModel = WflowModel(wflow_cloneMap, caseName,runId,configfile) dynModelFw = wf_DynamicFramework(myModel, _lastTimeStep,firstTimestep=_firstTimeStep)