usage = \ """ %s -i IN.nc [-o file.nc] where: -i IN.nc is input file in NetCDF format: contains PISM-written model state notes: * -i is required """ % (sys.argv[0]) PISM.show_usage_check_req_opts(context.com, sys.argv[0], ["-i"], usage) bootfile = PISM.optionsString("-i", "input file") output_file = PISM.optionsString("-o", "output file", default="tauc2tillphi_" + os.path.basename(bootfile)) verbosity = PISM.optionsInt("-verbose", "verbosity level", default=2) PISM.set_config_from_options(context.com, config) grid = PISM.IceGrid.FromFile(context.ctx, bootfile, ["enthalpy", "temp"], PISM.XY_PERIODIC) enthalpyconverter = PISM.EnthalpyConverter(config) if PISM.getVerbosityLevel() > 3: enthalpyconverter.viewConstants(PETSc.Viewer.STDOUT()) if PISM.OptionBool("-ssa_glen", "SSA flow law Glen exponent"): B_schoof = 3.7e8 # Pa s^{1/3}; hardness config.set_string("ssa_flow_law", "isothermal_glen") config.set_double("ice_softness", pow(B_schoof, -config.get_double("Glen_exponent"))) else: config.set_string("ssa_flow_law", "gpbld") surface = PISM.model.createIceSurfaceVec(grid)