def __init__(self, begin, end): """Initializes the model and build the core setup""" # tr_soil_GW = Residence time of the water in the soil to the GW self.params = [param("tr_soil_out", 0., 200.), # tr_GW_out = Residence time in the groundwater to # the outlet param('V0_soil', 0., 300.), # beta_soil_out = exponent that changes the form of the # flux from the soil to the outlet param("beta_soil_out", 0.3, 8.0), # ETV1 = the Volume that defines that the evaporation # is lowered because of not enough water in the soil param('ETV1', 0., 300.), # fETV0 = factor the ET is multiplied by, when water is # low param('fETV0', 0., 0.9), # Rate of snow melt param('meltrate', 0.01, 15.), # Snow_melt_temp = Temperature at which the snow melts # (needed because of averaged temp param('snow_melt_temp', -3.0, 3.0) ] self.begin = begin self.end = end # load the weather data and discharge data prec, temp, temp_min, temp_max, Q, wind, sun, \ rel_hum= self.loadPETQ() self.Q = Q # use only one core (faster when model is small cmf.set_parallel_threads(1) # Generate a cmf project with one cell for a lumped model self.project = cmf.project() p = self.project # Create a cell in the project c = p.NewCell(0, 0, 0, 1000) # Add snow storage c.add_storage("Snow", "S") cmf.Snowfall(c.snow, c) # Add the soil and groundwater layers soil = c.add_layer(2.0) # Give the storages a initial volume c.layers[0].volume = 15 # Install a calculation of the evaporation cmf.PenmanMonteithET(soil, c.transpiration) # Create an outlet self.outlet = p.NewOutlet("outlet", 10, 0, 0) # Create the meteo stations self.make_stations(prec, temp, temp_min, temp_max, wind, sun, rel_hum) self.project = p
def basic_set_up(self): """ Creates all cmf structures which are the same for all cells. :param: cell: cmf.project.NewCell() :return: None (cell is changed though) """ # Add Snow self.cell.add_storage("Snow", "S") cmf.Snowfall(self.cell.snow, self.cell) # Add layers and give them some water to start with self.cell.add_layer(2.0) self.cell.layers[0].volume = 10 self.cell.add_layer(5.0) self.cell.layers[1].volume = 40 # Create a storage for Interception I = self.cell.add_storage("Canopy", "C") # Install a connection for the ET cmf.PenmanMonteithET(self.cell.layers[0], self.cell.transpiration)
def __init__(self, begin, end): """Initializes the model and build the core setup""" # tr_soil_GW = Residence time of the water in the soil to the GW self.params = [ param('tr_soil_gw', 0., 400.), # tr_soil_fulda = residence time from soil to river param("tr_soil_out", 0., 200.), # tr_gw_upper_fulda = residence time from the upper # groundwater to the river param("tr_gw_out", 0., 650.), # V0_soil = field capacity for the soil param('V0_soil', 0., 300.), # beta_soil_GW = Changes the flux curve of the soil # to the groundwater param('beta_soil_gw', 0.3, 6.0), # beta_soil_out param("beta_soil_out", 0.3, 8.0), # ETV1 = the Volume that defines that the evaporation # is lowered because of not enough water in the soil param('ETV1', 0., 300.), # fETV0 = factor the ET is multiplied by, when water is # low param('fETV0', 0., 0.9), # Rate of snow melt param('meltrate', 0.01, 15.), # Snow_melt_temp = Temperature at which the snow melts # (needed because of averaged temp param('snow_melt_temp', -3.0, 3.0), # LAI = leaf area index param('LAI', 1., 12), # Canopy Closure param("CanopyClosure", 0., 0.9), ] self.begin = begin self.end = end # load the weather data and discharge data prec, temp, temp_min, temp_max, Q, wind, sun, \ rel_hum = self.loadPETQ() self.Q = Q # use only one core (faster when model is small cmf.set_parallel_threads(1) # Generate a cmf project with one cell for a lumped model self.project = cmf.project() p = self.project # Create a cell in the projectl_evapotranspiration c = p.NewCell(0, 0, 0, 1000) # Add snow storage c.add_storage("Snow", "S") cmf.Snowfall(c.snow, c) # Add the soil and groundwater layers soil = c.add_layer(2.0) gw_upper = c.add_layer(5.0) # Give the storages a initial volume soil.volume = 15 gw_upper.volume = 80 # Create a storage for Interception I = c.add_storage("Canopy", "C") # Install a calculation of the evaporation cmf.PenmanMonteithET(soil, c.transpiration) # Create an outlet self.outlet = p.NewOutlet("outlet", 10, 0, 0) # Create the meteo stations self.make_stations(prec, temp, temp_min, temp_max, wind, sun, rel_hum) self.project = p
def test_PenmanMonteithET(self): m = Model() cmf.PenmanMonteithET(m.layer, m.et) m(self)