Index: examples/wflow_rhine_sbm2/wflow_sbm2.ini =================================================================== diff -u -r4eebd1e4de8f1a4bcc97ad344596f04d7b045a4b -r2dfd426a539a541dfe45a391781d0f46dbe1e1a0 --- examples/wflow_rhine_sbm2/wflow_sbm2.ini (.../wflow_sbm2.ini) (revision 4eebd1e4de8f1a4bcc97ad344596f04d7b045a4b) +++ examples/wflow_rhine_sbm2/wflow_sbm2.ini (.../wflow_sbm2.ini) (revision 2dfd426a539a541dfe45a391781d0f46dbe1e1a0) @@ -6,6 +6,33 @@ #Longitude=1,5 +[modelparameters] +# Format: +# name=stack,type,default,verbose[lookupmap_1],[lookupmap_2],lookupmap_n] +# example: +# RootingDepth=monthlyclim/ROOT,monthyclim,100,1 + +# - name - Name of the parameter (internal variable) +# - stack - Name of the mapstack (representation on disk or in mem) relative to case +# - type - Type of parameter (default = static) +# - default - Default value if map/tbl is not present +# - set to 1 to be verbose if a map is missing +# - lookupmap - maps to be used in the lookuptable in the case the type is statictbl + +#Possible types are:: +# - staticmap: Read at startup from map +# - statictbl: Read at startup from tbl +# - tbl: Read each timestep from tbl and at startup +# - timeseries: read map for each timestep +# - monthlyclim: read a map corresponding to the current month (12 maps in total) +# - dailyclim: read a map corresponding to the current day of the year +# - hourlyclim: read a map corresponding to the current hour of the day (24 in total) (not implemented yet) +# - tss: read a tss file and link to lookupmap (only one allowed) a map using timeinputscalar +#USatStoreLayerDepth=staticmaps/USatStoreLayerDepth.map,staticmap,0.5,1 + + + + # Define the forcings needed for the model here # the filename is either the name of the pcraster map-stack or the name of the # variable in the netcdf input file Index: wflow-py/wflow/wflow_bmi.py =================================================================== diff -u -ra789263a249b110caad796b51b01750c1c9c3f55 -r2dfd426a539a541dfe45a391781d0f46dbe1e1a0 --- wflow-py/wflow/wflow_bmi.py (.../wflow_bmi.py) (revision a789263a249b110caad796b51b01750c1c9c3f55) +++ wflow-py/wflow/wflow_bmi.py (.../wflow_bmi.py) (revision 2dfd426a539a541dfe45a391781d0f46dbe1e1a0) @@ -278,7 +278,7 @@ import wflow.wflow_sbm as wf self.name = "wflow_sbm" elif "wflow_hbv" in filename: - import wflow.wflow_sbm as wf + import wflow.wflow_hbv as wf self.name = "wflow_hbv" elif "wflow_routing" in filename: import wflow.wflow_routing as wf Index: wflow-py/wflow/wflow_sbm2.py =================================================================== diff -u -rfb1146ad4bdf7157ba384923f5a3ceebae59b170 -r2dfd426a539a541dfe45a391781d0f46dbe1e1a0 --- wflow-py/wflow/wflow_sbm2.py (.../wflow_sbm2.py) (revision fb1146ad4bdf7157ba384923f5a3ceebae59b170) +++ wflow-py/wflow/wflow_sbm2.py (.../wflow_sbm2.py) (revision 2dfd426a539a541dfe45a391781d0f46dbe1e1a0) @@ -209,6 +209,9 @@ return Snow, SnowWater, SnowMelt, RainFall + + + class WflowModel(DynamicModel): """ .. versionchanged:: 0.91 @@ -479,6 +482,8 @@ self.OutputId = self.wf_readmap(os.path.join(self.Dir,wflow_subcatch),0.0,fail=True) # location of subcatchment # Temperature correction poer cell to add + + self.TempCor = self.wf_readmap( self.Dir + configget(self.config, "model", "TemperatureCorrectionMap", "staticmaps/wflow_tempcor.map"), 0.0) @@ -652,6 +657,16 @@ self.SoilWaterCapacity = self.SoilThickness * (self.thetaS - self.thetaR) + + self.USatLayers = 3 + self.UStoreLayerThickness= [] + self.UStoreLayerDepth= [] + for n in arange(0,self.USatLayers + 1): + self.UStoreLayerThickness.append(self.SoilMinThickness * 1.0/self.USatLayers) + self.UStoreLayerDepth.append(cover(0.0)) + + + # limit roots to top 99% of first zone self.RootingDepth = min(self.SoilThickness * 0.99, self.RootingDepth) @@ -829,6 +844,8 @@ self.SnowWater = self.ZeroMap self.TSoil = self.ZeroMap + 10.0 self.CanopyStorage = self.ZeroMap + + if self.NoLowerZone: self.LowerZoneStorage = 0.0 else: @@ -863,6 +880,13 @@ self.GWScale = (self.DemMax - self.DrainageBase) / self.SoilThickness / self.RunoffGeneratingGWPerc + def UnSatTransFer(self): + """ + Moves water through the unsaturated sone + :return: + """ + + def dynamic(self): """ Stuf that is done for each timestep of the model @@ -1032,6 +1056,25 @@ self.SoilInfiltExceeded = self.SoilInfiltExceeded + scalar(self.InfiltCapSoil * soilInfRedu < SoilInf) InfiltSoil = min(MaxInfiltSoil, UStoreCapacity) + + SumThickness = self.ZeroMap + # Go from bottom to top + for n in arange(0,len(self.UStoreLayerThickness) + 1)[::-1]: + SumThickness = self.UStoreLayerThickness[n] + SumThickness + self.ZiLayer = ifthen(self.zi <= SumThickness,self.ZeroMap + n) + + for n in arange(0,len(self.UStoreLayerThickness) + 1): + if n == 0: + DownWard = InfiltSoil + L = ifthenelse(self.ZiLayer < n, self.UStoreLayerDepth[n],) + XXXXXXXXXXXXX + XXXXXXXXXXXXX + self.UStoreLayerDepth[n] = self.UStoreLayerDepth[n] + DownWard + KsLayer = self.KsatVer * exp(-self.zi/self.f) * (self.UStoreLayerDepth[n] /((L)*(self.thetaS-self.thetaR)))**self.c + DownWard = min(self.UStoreLayerDepth[n],KsLayer) + self.UStoreLayerDepth[n] = self.UStoreLayerDepth[n] - DownWard + + self.UStoreDepth = self.UStoreDepth + InfiltSoil UStoreCapacity = UStoreCapacity - InfiltSoil self.AvailableForInfiltration = self.AvailableForInfiltration - InfiltSoil