本文整理汇总了Python中PISM.set_config_from_options方法的典型用法代码示例。如果您正苦于以下问题:Python PISM.set_config_from_options方法的具体用法?Python PISM.set_config_from_options怎么用?Python PISM.set_config_from_options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PISM
的用法示例。
在下文中一共展示了PISM.set_config_from_options方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: pow
# 需要导入模块: import PISM [as 别名]
# 或者: from PISM import set_config_from_options [as 别名]
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)