Index: wflow-py/wflow/wflow_sbm.py =================================================================== diff -u -r6d5806cc85b89b7449a13ae676eef3a205b05f61 -re59c94fdbbee6d4f398f9e2d764e4f6450228ed7 --- wflow-py/wflow/wflow_sbm.py (.../wflow_sbm.py) (revision 6d5806cc85b89b7449a13ae676eef3a205b05f61) +++ wflow-py/wflow/wflow_sbm.py (.../wflow_sbm.py) (revision e59c94fdbbee6d4f398f9e2d764e4f6450228ed7) @@ -898,6 +898,7 @@ self.wf_updateparameters() self.Precipitation = max(0.0,self.Precipitation) + # NB This may interfere with lintul link if hasattr(self,"LAI"): # Sl must also be defined ##TODO: add MAXLAI and CWf @@ -908,7 +909,10 @@ min(0.25,cover(self.Ewet/max(0.0001,self.Precipitation),0.0)), 0.0) if hasattr(self,'MAXLAI') and hasattr(self,'CWf'): # Adjust rootinggdepth - self.ActRootingDept = self.CWf * (self.RootingDepth * self.LAI/self.MAXLAI) + ((1- self.CWf) * self.RootingDepth) + self.ActRootingDept = self.CWf * (self.RootingDepth * self.LAI/max(0.001,self.MAXLAI))\ + + ((1- self.CWf) * self.RootingDepth) + else: + self.ActRootingDept = self.RootingDepth @@ -1028,7 +1032,7 @@ self.CumInfiltExcess = self.CumInfiltExcess + self.InfiltExcess # Limit rootingdepth (if set externally) - self.RootingDepth = min(self.FirstZoneThickness * 0.99, self.RootingDepth) + self.ActRootingDept = min(self.FirstZoneThickness * 0.99, self.ActRootingDept) # Determine transpiration # Split between bare soil and vegetation @@ -1039,7 +1043,7 @@ # Linear reduction of soil moisture evaporation based on deficit self.soilevap = self.potsoilevap * min(1.0, self.SaturationDeficit/self.FirstZoneCapacity) - self.Transpiration, self.FirstZoneDepth, self.UStoreDepth, self.ActEvapUStore = actEvap_SBM(self.RootingDepth, + self.Transpiration, self.FirstZoneDepth, self.UStoreDepth, self.ActEvapUStore = actEvap_SBM(self.ActRootingDept, self.zi, self.UStoreDepth, self.FirstZoneDepth, self.PotTrans, @@ -1078,8 +1082,9 @@ MaxCapFlux = max(0.0, min(Ksat, self.ActEvapUStore, UStoreCapacity, self.FirstZoneDepth)) # No capilary flux is roots are in water, max flux if very near to water, lower flux if distance is large - CapFluxScale = ifthenelse(self.zi > self.RootingDepth, - self.CapScale / (self.CapScale + self.zi - self.RootingDepth) * self.timestepsecs/self.basetimestep, 0.0) + CapFluxScale = ifthenelse(self.zi > self.ActRootingDept, + self.CapScale / (self.CapScale + self.zi - self.ActRootingDept) *\ + self.timestepsecs/self.basetimestep, 0.0) self.CapFlux = MaxCapFlux * CapFluxScale # Determine Ksat at base @@ -1170,7 +1175,7 @@ else: self.reinfiltwater = self.ZeroMap - self.RootZonSoilMoisture = self.UStoreDepth * max(1.0, self.RootingDepth/self.zi) + self.RootZonSoilMoisture = self.UStoreDepth * max(1.0, self.ActRootingDept/self.zi) # The Max here may lead to watbal error. However, if inwaterMMM becomes < 0, the kinematic wave becomes very slow...... if self.reInfilt: self.InwaterMM = self.ExfiltWater + self.ExcessWater + self.SubCellRunoff + \ @@ -1288,7 +1293,7 @@ # Determine Soil moisture profile # 1: average volumetric soil in total unsat store self.SMVol = (cover(self.UStoreDepth/self.zi,0.0) + self.thetaR) * (self. thetaS - self.thetaR) - self.SMRootVol = (cover(self.UStoreDepth/min(self.RootingDepth,self.zi),0.0) + self.thetaR) * (self. thetaS - self.thetaR) + self.SMRootVol = (cover(self.UStoreDepth/min(self.ActRootingDept,self.zi),0.0) + self.thetaR) * (self. thetaS - self.thetaR) # 2: ########################################################################## # water balance ###########################################