Index: examples/wflow_rhine_sbm/wflow_sbm.ini =================================================================== diff -u -re2a7f11e8df532f92d0cbc7cecf86067e23a8247 -r58fb95443da77451296cbca4d6ad8fd71ae8f4da --- examples/wflow_rhine_sbm/wflow_sbm.ini (.../wflow_sbm.ini) (revision e2a7f11e8df532f92d0cbc7cecf86067e23a8247) +++ examples/wflow_rhine_sbm/wflow_sbm.ini (.../wflow_sbm.ini) (revision 58fb95443da77451296cbca4d6ad8fd71ae8f4da) @@ -54,6 +54,9 @@ #SubCatchFlowOnly = 1 origTopogLateral = 1 + +#DynamicVegetation=1 + [misc] #mapSaveInterval=365 Index: wflow-py/wflow/wf_DynamicFramework.py =================================================================== diff -u -r5a0c3b287e38dcf895f20ac9191721b2e51d91a4 -r58fb95443da77451296cbca4d6ad8fd71ae8f4da --- wflow-py/wflow/wf_DynamicFramework.py (.../wf_DynamicFramework.py) (revision 5a0c3b287e38dcf895f20ac9191721b2e51d91a4) +++ wflow-py/wflow/wf_DynamicFramework.py (.../wf_DynamicFramework.py) (revision 58fb95443da77451296cbca4d6ad8fd71ae8f4da) @@ -1437,13 +1437,13 @@ def wf_readmapClimatology(self,name,kind=1,default=0.0,verbose=1): """ - Read a climatology map. The current date/time is onverted to: - 1: a month and the file fro the current month is returend - 2: days of year and the file for the current day is implmented + Read a climatology map. The current date/time is converted to: + 1: a month and the file for the current month is returned + 2: days of year and the file for the current day is returned 3: hour of day and the file for the current hours is returned :param name: name if the mapstack - :param kind: time of the climatology + :param kind: type of the climatology :return: a map """ directoryPrefix = "" @@ -1459,6 +1459,19 @@ self.logger.warn("Climatology data (" + path + ") for timestep not present, returning " + str(default)) return scalar(default) + elif kind == 2: + yday = self.currentdatetime.timetuple().tm_yday + newName = generateNameT(name, yday) + path = os.path.join(directoryPrefix, newName) + if os.path.isfile(path): + mapje=readmap(path) + return mapje + else: + if verbose: + self.logger.warn("Climatology data (" + path + ") for timestep not present, returning " + str(default)) + + return scalar(default) + else: self.logger.error("This Kind of climatology not implemented yet: " + str(kind)) Index: wflow-py/wflow/wflow_sbm.py =================================================================== diff -u -rffb89a507e627be43baa45eb8f4daaa27d2fa1fe -r58fb95443da77451296cbca4d6ad8fd71ae8f4da --- wflow-py/wflow/wflow_sbm.py (.../wflow_sbm.py) (revision ffb89a507e627be43baa45eb8f4daaa27d2fa1fe) +++ wflow-py/wflow/wflow_sbm.py (.../wflow_sbm.py) (revision 58fb95443da77451296cbca4d6ad8fd71ae8f4da) @@ -127,7 +127,8 @@ def actEvap_SBM(RootingDepth, WTable, UStoreDepth, FirstZoneDepth, PotTrans, smoothpar): """ Actual evaporation function: - + Actual evaporation function: + - first try to get demand from the saturated zone, using the rootingdepth as a limiting factor - secondly try to get the remaining water from the unsaturated store - it uses an S-Curve the make sure roots het wet/dry gradually (basically) @@ -390,6 +391,8 @@ self.updateFile = configget(self.config, "model", "updateFile", "no_set") self.LateralMethod = int(configget(self.config, "model", "lateralmethod", "1")) + self.DynamicVegetation =int(configget(self.config, "model", "DynamicVegetation", "0")) + if self.LateralMethod == 1: self.logger.info("Applying the original topog_sbm lateral transfer formulation") elif self.LateralMethod == 2: @@ -932,7 +935,23 @@ self.Temperature = cover(self.wf_readmap(self.TEMP_mapstack, 10.0), scalar(10.0)) self.Temperature = self.Temperature + self.TempCor + # Read dynamic vegetationmaps - not tested at all.... + # Fixed parameter for now, these should become maps + if self.DynamicVegetation: + self.LAI = self.wf_readmapClimatology(os.path.join(self.Dir,self.runId,"LAI") ,kind=1, default=self.LAI, verbose=True) + self.Cmax = self.LAI * 0.467 + self.CanopyGapFraction = exp(-1.457 * self.LAI) + """ + Pitman, Rainfall interception by bracken in open habitats 1989 + throughfall coefficient + p = exp[-1.457( _+ 0.063)LAI], + (short vegetation) + Cmax - 0.467( _+ O.O04)LAI + (Talll vegetation) + Cmax = K *LAI (K == 0.2, Dickinson, 1984] + """ + # Multiply input parameters with a factor (for calibration etc) -p option in command line for k, v in multdynapars.iteritems(): estr = k + "=" + k + "*" + str(v) @@ -1056,7 +1075,8 @@ self.CumInfiltExcess = self.CumInfiltExcess + self.InfiltExcess - + # Limit rootingdepth (if set externally) + self.RootingDepth = min(self.FirstZoneThickness * 0.99, self.RootingDepth) # Determine transpiration self.ActEvap, self.FirstZoneDepth, self.UStoreDepth, self.ActEvapUStore = actEvap_SBM(self.RootingDepth, self.zi, self.UStoreDepth,