def test_run(self): entity = gpd.read_file(self.rgi_file).iloc[0] gdir = oggm.GlacierDirectory(entity, base_dir=self.testdir) gis.define_glacier_region(gdir, entity=entity) gis.glacier_masks(gdir) centerlines.compute_centerlines(gdir) centerlines.initialize_flowlines(gdir) centerlines.compute_downstream_line(gdir) centerlines.compute_downstream_bedshape(gdir) centerlines.catchment_area(gdir) centerlines.catchment_intersections(gdir) centerlines.catchment_width_geom(gdir) centerlines.catchment_width_correction(gdir) # Climate tasks -- only data IO and tstar interpolation! tasks.process_dummy_cru_file(gdir, seed=0) tasks.local_t_star(gdir) tasks.mu_star_calibration(gdir) # Inversion tasks tasks.prepare_for_inversion(gdir) # We use the default parameters for this run tasks.mass_conservation_inversion(gdir) tasks.filter_inversion_output(gdir) # Final preparation for the run tasks.init_present_time_glacier(gdir) # check that calving happens in the real context as well tasks.run_constant_climate(gdir, bias=0, nyears=100) with xr.open_dataset(gdir.get_filepath('model_diagnostics')) as ds: assert ds.calving_m3.max() > 10
tasks.compute_centerlines(gdir) tasks.initialize_flowlines(gdir) tasks.compute_downstream_line(gdir) tasks.compute_downstream_bedshape(gdir) tasks.catchment_area(gdir) tasks.catchment_intersections(gdir) tasks.catchment_width_geom(gdir) tasks.catchment_width_correction(gdir) tasks.process_cru_data(gdir) tasks.mu_candidates(gdir) tasks.compute_ref_t_stars([gdir]) tasks.distribute_t_stars([gdir]) tasks.apparent_mb(gdir) tasks.prepare_for_inversion(gdir) tasks.volume_inversion(gdir, glen_a=cfg.A, fs=0) tasks.filter_inversion_output(gdir) tasks.init_present_time_glacier(gdir) df = utils.glacier_characteristics([gdir], path=False) reset = True seed = 0 tasks.random_glacier_evolution(gdir, nyears=800, seed=0, y0=2000, filesuffix='_2000_def', reset=reset) tasks.random_glacier_evolution(gdir,