#fsp = Fsc(mg, input_file_string) precip = PrecipitationDistribution(input_file=input_file_string) #load the Fastscape module too, to allow direct comparison fsp = Fsc(mg, input_file_string) try: #raise NameError mg = copy.deepcopy(mg_mature) except NameError: print('building a new grid...') out_interval = 50000. last_trunc = time_to_run #we use this to trigger taking an output plot #run to a steady state: #We're going to cheat by running Fastscape SP for the first part of the solution for (interval_duration, rainfall_rate) in precip.yield_storm_interstorm_duration_intensity(): if rainfall_rate != 0.: mg.at_node['water__volume_flux_in'].fill(rainfall_rate) mg = fr.route_flow() #print 'Area: ', numpy.max(mg.at_node['drainage_area']) mg,_,_ = sp.erode(mg, interval_duration, Q_if_used='water__volume_flux', K_if_used='K_values') #add uplift mg.at_node['topographic__elevation'][mg.core_nodes] += uplift*interval_duration this_trunc = precip.elapsed_time//out_interval if this_trunc != last_trunc: #a new loop round print('made it to loop ', out_interval*this_trunc) last_trunc=this_trunc mg_mature = copy.deepcopy(mg) else: