Index: wflow-py/wflow/wflow_routing.py =================================================================== diff -u -r0a996083c3c5b90ef18ddb21d7ed115648e79807 -r5ad32c678c988e1737702a66b461c575c33441ff --- wflow-py/wflow/wflow_routing.py (.../wflow_routing.py) (revision 0a996083c3c5b90ef18ddb21d7ed115648e79807) +++ wflow-py/wflow/wflow_routing.py (.../wflow_routing.py) (revision 5ad32c678c988e1737702a66b461c575c33441ff) @@ -187,6 +187,7 @@ self.SSSF = False setglobaloption("unittrue") + self.inflowTss = "/intss/Inflow.tss" self.logger.info("running for " + str(self.nrTimeSteps()) + " timesteps") @@ -196,7 +197,7 @@ 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") - + self.Tslice = int(configget(self.config, "model", "Tslice", "1")) self.sCatch = int(configget(self.config, "model", "sCatch", "0")) self.intbl = configget(self.config, "model", "intbl", "intbl") self.timestepsecs = int(configget(self.config, "model", "timestepsecs", "86400")) @@ -208,6 +209,7 @@ self.MaxUpdMult = float(configget(self.config, "model", "MaxUpdMult", "1.3")) self.MinUpdMult = float(configget(self.config, "model", "MinUpdMult", "0.7")) self.UpFrac = float(configget(self.config, "model", "UpFrac", "0.8")) + self.SubCatchFlowOnly = int(configget(self.config, 'model', 'SubCatchFlowOnly', '0')) WIMaxScale = float(configget(self.config, 'model', 'WIMaxScale', '0.8')) @@ -222,8 +224,11 @@ wflow_gauges = configget(self.config, "model", "wflow_gauges", "staticmaps/wflow_gauges.map") wflow_inflow = configget(self.config, "model", "wflow_inflow", "staticmaps/wflow_inflow.map") wflow_riverwidth = configget(self.config, "model", "wflow_riverwidth", "staticmaps/wflow_riverwidth.map") + 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) @@ -243,6 +248,7 @@ self.LandUse = cover(self.LandUse, nominal(ordinal(subcatch) > 0)) self.Soil = readmap(os.path.join(self.Dir,wflow_soil)) self.Soil = cover(self.Soil, nominal(ordinal(subcatch) > 0)) + self.OutputLoc = readmap(os.path.join(self.Dir,wflow_gauges)) # location of output gauge(s) self.InflowLoc = pcrut.readmapSave(os.path.join(self.Dir,wflow_inflow), 0.0) # location abstractions/inflows. self.RiverWidth = pcrut.readmapSave(os.path.join(self.Dir,wflow_riverwidth), 0.0) @@ -339,17 +345,21 @@ self.DCL = drainlength * max(1.0, self.RiverLengthFac) self.DCL = max(self.DCL, self.RiverLength) # m + 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) # However, in the main river we have real flow so set the width to the # width of the river self.Bw = ifthenelse(self.River, self.RiverWidth, self.Bw) - riverslopecor = drainlength / self.DCL + #riverslopecor = drainlength / self.DCL #report(riverslopecor,"cor.map") #report(self.Slope * riverslopecor,"slope.map") - self.AlpTerm = pow((self.N / (sqrt(self.Slope * riverslopecor))), self.Beta) + self.AlpTerm = pow((self.N / (sqrt(self.SlopeDCL))), self.Beta) # power for Alpha self.AlpPow = (2.0 / 3.0) * self.Beta # initial approximation for Alpha @@ -377,7 +387,9 @@ 'self.xl', 'self.yl', 'self.DCL', - 'self.Bw'] + 'self.Bw', + 'self.Slope', + 'self.SlopeDCL'] return lst @@ -432,15 +444,18 @@ "Step: " + str(int(self.thestep + self._d_firstTimeStep)) + "/" + str(int(self._d_nrTimeSteps))) self.thestep = self.thestep + 1 - self.Precipitation = cover(self.wf_readmap(self.P_mapstack, 0.0), scalar(0.0)) + self.InwaterForcing = cover(self.wf_readmap(self.IW_mapstack, 1.0), scalar(0.0)) + + if self.thestep > 28: + self.InwaterForcing = cover(0.0) #self.Inflow=cover(self.wf_readmap(self.Inflow),0) if (os.path.exists(self.caseName + self.inflowTss)): self.Inflow = cover(timeinputscalar(self.caseName + self.inflowTss, nominal(self.InflowLoc)), 0) else: self.Inflow = cover(self.wf_readmap(self.Inflow_mapstack, 0.0,verbose=False),0) # The MAx here may lead to watbal error. Howvere, if inwaterMMM becomes < 0, the kinematic wave becomes very slow...... - self.InwaterMM = max(0.0,self.ExfiltWater + self.ExcessWater + self.SubCellRunoff + self.SubCellGWRunoff + self.RunoffOpenWater + self.BaseFlow - Reinfilt - self.ActEvapOpenWater) + self.InwaterMM = max(0.0,self.InwaterForcing) self.Inwater = self.InwaterMM * self.ToCubic # m3/s self.Inwater = self.Inwater + self.Inflow # Add abstractions/inflows in m^3/sec