本文整理汇总了Python中PISM.getVerbosityLevel方法的典型用法代码示例。如果您正苦于以下问题:Python PISM.getVerbosityLevel方法的具体用法?Python PISM.getVerbosityLevel怎么用?Python PISM.getVerbosityLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PISM
的用法示例。
在下文中一共展示了PISM.getVerbosityLevel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __call__
# 需要导入模块: import PISM [as 别名]
# 或者: from PISM import getVerbosityLevel [as 别名]
def __call__(self, message, verbosity):
"""Saves the message to our internal log string and writes the string out to the file."""
if self.rank == 0 and PISM.getVerbosityLevel() >= verbosity:
timestamp = time.strftime('%Y-%m-%d %H:%M:%S')
self.log = "%s%s: %s" % (self.log, timestamp, message)
d = PISM.netCDF.Dataset(self.filename, 'a')
d.__setattr__(self.attr, self.log)
d.close()
self.com.barrier()
示例2: initPhysics
# 需要导入模块: import PISM [as 别名]
# 或者: from PISM import getVerbosityLevel [as 别名]
def initPhysics(self):
config = self.config
self.basal = PISM.IceBasalResistancePlasticLaw(
config.get("plastic_regularization") / PISM.secpera,
config.get_flag("do_pseudo_plastic_till"),
config.get("pseudo_plastic_q"),
config.get("pseudo_plastic_uthreshold") / PISM.secpera);
if PISM.optionsIsSet("-ssa_glen"):
self.ice = PISM.CustomGlenIce(self.grid.com,"",config)
B_schoof = 3.7e8; # Pa s^{1/3}; hardness
self.ice.setHardness(B_schoof)
else:
self.ice = PISM.GPBLDIce(self.grid.com, "", config)
self.ice.setFromOptions()
self.enthalpyconverter = PISM.EnthalpyConverter(config)
if PISM.getVerbosityLevel() >3:
self.enthalpyconverter.viewConstants(PETSc.Viewer.STDOUT())
示例3: pow
# 需要导入模块: import PISM [as 别名]
# 或者: from PISM import getVerbosityLevel [as 别名]
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)
thickness = PISM.model.createIceThicknessVec(grid)
bed = PISM.model.createBedrockElevationVec(grid)
enthalpy = PISM.model.createEnthalpyVec(grid)
ice_mask = PISM.model.createIceMaskVec(grid)
v = [surface, thickness, bed, enthalpy, ice_mask]