Ejemplo n.º 1
0
def test_raise_kwargs_error():
    mg = RasterModelGrid((5, 5))
    soilTh = mg.add_zeros('node', 'soil__depth')
    z = mg.add_zeros('node', 'topographic__elevation')
    BRz = mg.add_zeros('node', 'bedrock__elevation')
    z += mg.node_x.copy()
    BRz += mg.node_x / 2.
    soilTh[:] = z - BRz
    expweath = ExponentialWeatherer(mg)
    with pytest.raises(TypeError):
        DepthDependentDiffuser(mg, diffusivity=1)

    DDdiff = DepthDependentDiffuser(mg)

    with pytest.raises(TypeError):
        DDdiff.soilflux(2., bad_var=1)
def test_raise_kwargs_error():
    mg = RasterModelGrid((5, 5))
    soilTh = mg.add_zeros("node", "soil__depth")
    z = mg.add_zeros("node", "topographic__elevation")
    BRz = mg.add_zeros("node", "bedrock__elevation")
    z += mg.node_x.copy()
    BRz += mg.node_x / 2.0
    soilTh[:] = z - BRz
    ExponentialWeatherer(mg)
    with pytest.raises(TypeError):
        DepthDependentDiffuser(mg, diffusivity=1)

    DDdiff = DepthDependentDiffuser(mg)

    with pytest.raises(TypeError):
        DDdiff.soilflux(2.0, bad_var=1)
            pass

    #now, the hillslope evolution processes

    #weathering
    weatheringrate.calc_soil_prod_rate()

    hog.set_soil_production_rate_on_hard_layer(soil_production_rate)

    mg.at_node['soil_production__rate'][channel_nodes] = 0

    hog.weather_blocks(soil_production_rate, max_block_weathering_rate,
                       underlying_soil_depth, soil_depth, timestep)

    #flux
    hillslopeflux.soilflux(timestep)

    mg.at_node['topographic__elevation'][channel_nodes] = mg.at_node[
        'bedrock__elevation'][channel_nodes]
    mg.at_node['soil__depth'][channel_nodes] = 0

    mg.at_node['bedrock__elevation'][baselevel_node] -= bl_drop * timestep

    #sum bedrock and soil to get topographic elevation
    mg.at_node['topographic__elevation'][:] = mg.at_node[
        'bedrock__elevation'] + mg.at_node['soil__depth']

    #get block locations
    block_sizes[:] = 0
    block_sizes[hog.block_locations] = hog.block_sizes