init_elev = inputs.read_float("init_elev") uplift_perstep = inputs.read_float("uplift_rate") * dt rock_stress_param = inputs.read_float("rock_density") * 9.81 mg = RasterModelGrid(nrows, ncols, dx) # create the fields in the grid mg.add_zeros("topographic__elevation", at="node") z = mg.zeros(at="node") + init_elev mg["node"]["topographic__elevation"] = z + np.random.rand(len(z)) / 1000. # make some surface load stresses in a field to test mg.at_node["surface_load__stress"] = np.zeros(nrows * ncols, dtype=float) # instantiate: gf = gFlex(mg, "./coupled_SP_gflex_params.txt") fsp = FastscapeEroder(mg, "./coupled_SP_gflex_params.txt") sp = StreamPowerEroder(mg, "./coupled_SP_gflex_params.txt") fr = FlowAccumulator(mg, flow_director="D8") # perform the loop: elapsed_time = 0. # total time in simulation while elapsed_time < time_to_run: print(elapsed_time) if elapsed_time + dt > time_to_run: print("Short step!") dt = time_to_run - elapsed_time mg = fr.run_one_step() # mg = fsp.erode(mg) mg, _, _ = sp.erode( mg,
init_elev = inputs.read_float('init_elev') uplift_perstep = inputs.read_float('uplift_rate')*dt rock_stress_param = inputs.read_float('rock_density')*9.81 mg = RasterModelGrid(nrows, ncols, dx) #create the fields in the grid mg.add_zeros('topographic__elevation', at='node') z = mg.zeros(at='node') + init_elev mg['node'][ 'topographic__elevation'] = z + np.random.rand(len(z))/1000. #make some surface load stresses in a field to test mg.at_node['surface_load__stress'] = np.zeros(nrows*ncols, dtype=float) #instantiate: gf = gFlex(mg, './coupled_SP_gflex_params.txt') fsp = FastscapeEroder(mg, './coupled_SP_gflex_params.txt') sp = StreamPowerEroder(mg, './coupled_SP_gflex_params.txt') fr = FlowRouter(mg) #perform the loop: elapsed_time = 0. #total time in simulation while elapsed_time < time_to_run: print(elapsed_time) if elapsed_time+dt>time_to_run: print("Short step!") dt = time_to_run - elapsed_time mg = fr.route_flow() #mg = fsp.erode(mg) mg,_,_ = sp.erode(mg, dt, node_drainage_areas='drainage_area', slopes_at_nodes='topographic__steepest_slope') mg.at_node['surface_load__stress'] = (mg.at_node['topographic__elevation']+1000)*rock_stress_param
init_elev = inputs.read_float("init_elev") uplift_perstep = inputs.read_float("uplift_rate") * dt rock_stress_param = inputs.read_float("rock_density") * 9.81 mg = RasterModelGrid((nrows, ncols), xy_spacing=dx) # create the fields in the grid mg.add_zeros("topographic__elevation", at="node") z = mg.zeros(at="node") + init_elev mg["node"]["topographic__elevation"] = z + np.random.rand(len(z)) / 1000. # make some surface load stresses in a field to test mg.at_node["surface_load__stress"] = np.zeros(nrows * ncols, dtype=float) # instantiate: gf = gFlex(mg, "./coupled_SP_gflex_params.txt") fsp = FastscapeEroder(mg, "./coupled_SP_gflex_params.txt") sp = StreamPowerEroder(mg, "./coupled_SP_gflex_params.txt") fr = FlowAccumulator(mg, flow_director="D8") # perform the loop: elapsed_time = 0. # total time in simulation while elapsed_time < time_to_run: print(elapsed_time) if elapsed_time + dt > time_to_run: print("Short step!") dt = time_to_run - elapsed_time mg = fr.run_one_step() # mg = fsp.erode(mg) mg, _, _ = sp.erode( mg,
init_elev = inputs.read_float('init_elev') mg = RasterModelGrid(nrows, ncols, dx) #create the fields in the grid mg.create_node_array_zeros('topographic__elevation') z = mg.create_node_array_zeros() + init_elev mg['node']['topographic__elevation'] = z + np.random.rand(len(z)) / 1000. #make some surface load stresses in a field to test mg.at_node['surface_load__stress'] = np.zeros(nrows * ncols, dtype=float) square_qs = mg.at_node['surface_load__stress'].view().reshape((nrows, ncols)) square_qs[10:40, 10:40] += 1.e6 #instantiate: gf = gFlex(mg, './AW_gflex_params.txt') #perform the loop: elapsed_time = 0. #total time in simulation while elapsed_time < time_to_run: print elapsed_time if elapsed_time + dt > time_to_run: print "Short step!" dt = time_to_run - elapsed_time gf.flex_lithosphere() elapsed_time += dt pylab.figure(1) im = imshow_node_grid(mg, 'topographic__elevation') # display a colored image pylab.figure(2)
init_elev = inputs.read_float('init_elev') mg = RasterModelGrid(nrows, ncols, dx) #create the fields in the grid mg.create_node_array_zeros('topographic__elevation') z = mg.create_node_array_zeros() + init_elev mg['node'][ 'topographic__elevation'] = z + np.random.rand(len(z))/1000. #make some surface load stresses in a field to test mg.at_node['surface_load__stress'] = np.zeros(nrows*ncols, dtype=float) square_qs = mg.at_node['surface_load__stress'].view().reshape((nrows,ncols)) square_qs[10:40, 10:40] += 1.e6 #instantiate: gf = gFlex(mg, './AW_gflex_params.txt') #perform the loop: elapsed_time = 0. #total time in simulation while elapsed_time < time_to_run: print elapsed_time if elapsed_time+dt>time_to_run: print "Short step!" dt = time_to_run - elapsed_time gf.flex_lithosphere() elapsed_time += dt pylab.figure(1) im = imshow_node_grid(mg, 'topographic__elevation') # display a colored image pylab.figure(2)