Index: wflow-py/wflow/wflow_sbm.py =================================================================== diff -u -ra4fcc956f58390dd7b3709349b53060838e8aa11 -rb1767106ac9c9dccca2d2ad84581809714db3b2f --- wflow-py/wflow/wflow_sbm.py (.../wflow_sbm.py) (revision a4fcc956f58390dd7b3709349b53060838e8aa11) +++ wflow-py/wflow/wflow_sbm.py (.../wflow_sbm.py) (revision b1767106ac9c9dccca2d2ad84581809714db3b2f) @@ -1130,9 +1130,13 @@ ########################################################################## #self.ExfiltWaterFrac = sCurve(self.FirstZoneDepth, a=self.FirstZoneCapacity, c=5.0) - self.ExfiltWater=ifthenelse (self.FirstZoneDepth - self.FirstZoneCapacity > 0 , self.FirstZoneDepth - self.FirstZoneCapacity , 0.0) + + self.ExfiltWaterFrac = sCurve(self.FirstZoneDepth, a=self.FirstZoneCapacity, c=5.0) + self.ExfiltWater = self.ExfiltWaterFrac * (self.FirstZoneDepth - self.FirstZoneCapacity) + #self.ExfiltWater=ifthenelse (self.FirstZoneDepth - self.FirstZoneCapacity > 0 , self.FirstZoneDepth - self.FirstZoneCapacity , 0.0) self.FirstZoneDepth = self.FirstZoneDepth - self.ExfiltWater + # Re-determine UStoreCapacity UStoreCapacity = self.FirstZoneCapacity - self.FirstZoneDepth - self.UStoreDepth #Determine capilary rise @@ -1160,7 +1164,8 @@ else: Reinfilt = self.ZeroMap - self.InwaterMM = self.ExfiltWater + self.ExcessWater + self.SubCellRunoff + self.SubCellGWRunoff + self.RunoffOpenWater + self.BaseFlow - Reinfilt - self.ActEvapOpenWater + # 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.Inwater = self.InwaterMM * self.ToCubic # m3/s self.ExfiltWaterCubic = self.ExfiltWater * self.ToCubic