# SSA velocity Dirichlet B.C. ubar = np.zeros_like(thk) ubar[bc_mask == 1] = p.vel_bc * (xx[radius <= p.r_gl] / radius[radius <= p.r_gl]) ubar[bc_mask == 0] = 0 vbar = np.zeros_like(thk) vbar[bc_mask == 1] = p.vel_bc * (yy[radius <= p.r_gl] / radius[radius <= p.r_gl]) vbar[bc_mask == 0] = 0 ncfile = PISMNC.PISMDataset(options.output_filename, 'w', format='NETCDF3_CLASSIC') piktests_utils.prepare_output_file(ncfile, x, y) variables = { "thk": thk, "topg": bed, "ice_surface_temp": Ts, "climatic_mass_balance": accum, "bc_mask": bc_mask, "u_ssa_bc": ubar, "v_ssa_bc": vbar, "calving_threshold": thk_threshold } piktests_utils.write_data(ncfile, variables) ncfile.variables["calving_threshold"].units = "m"
if radius <= r_cf: thk[j, i] = MISMIP_thk(radius) # clip bed topography bed[bed < p.topg_min] = p.topg_min # Compute the grounding line radius def f(x): "floatation criterion: rho_ice/rho_ocean * thk + bed = 0" return (p.rho_ice / p.rho_ocean) * MISMIP_thk(x) + MISMIP_bed(x) r_gl = opt.bisect(f, 0, r_cf) print("grounding line radius = %.2f km" % (r_gl / 1000.0)) ncfile = PISMNC.PISMDataset(options.output_filename, 'w', format='NETCDF3_CLASSIC') piktests_utils.prepare_output_file(ncfile, x, y, include_vel_bc=False) variables = {"thk": thk, "topg": bed, "ice_surface_temp": Ts, "climatic_mass_balance": accum} piktests_utils.write_data(ncfile, variables) ncfile.close() print("Successfully created %s" % options.output_filename)
Ts = np.zeros_like(thk) + p.air_temperature # Dirichlet B.C locations bc_mask = np.zeros_like(thk) bc_mask[radius <= p.r_gl] = 1 # SSA velocity Dirichlet B.C. ubar = np.zeros_like(thk) ubar[bc_mask == 1] = p.vel_bc * (xx[radius <= p.r_gl] / radius[radius <= p.r_gl]) ubar[bc_mask == 0] = 0 vbar = np.zeros_like(thk) vbar[bc_mask == 1] = p.vel_bc * (yy[radius <= p.r_gl] / radius[radius <= p.r_gl]) vbar[bc_mask == 0] = 0 ncfile = PISMNC.PISMDataset(options.output_filename, 'w', format='NETCDF3_CLASSIC') piktests_utils.prepare_output_file(ncfile, x, y) variables = {"thk": thk, "topg": bed, "ice_surface_temp": Ts, "climatic_mass_balance": accum, "bc_mask": bc_mask, "u_ssa_bc": ubar, "v_ssa_bc": vbar} piktests_utils.write_data(ncfile, variables) ncfile.close() print "Successfully created %s" % options.output_filename
bed[bed < p.topg_min] = p.topg_min # Compute the grounding line radius def f(x): "floatation criterion: rho_ice/rho_ocean * thk + bed = 0" return (p.rho_ice / p.rho_ocean) * MISMIP_thk(x) + MISMIP_bed(x) r_gl = opt.bisect(f, 0, r_cf) print("grounding line radius = %.2f km" % (r_gl / 1000.0)) ncfile = PISMNC.PISMDataset(options.output_filename, 'w', format='NETCDF3_CLASSIC') piktests_utils.prepare_output_file(ncfile, x, y, include_vel_bc=False) variables = { "thk": thk, "topg": bed, "ice_surface_temp": Ts, "climatic_mass_balance": accum } piktests_utils.write_data(ncfile, variables) ncfile.close() print("Successfully created %s" % options.output_filename)