当前位置: 首页>>代码示例>>Python>>正文


Python PISM.getVerbosityLevel方法代码示例

本文整理汇总了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()
开发者ID:crodehacke,项目名称:PISMcr,代码行数:11,代码来源:logging.py

示例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())
开发者ID:matthiasmengel,项目名称:pism,代码行数:21,代码来源:ssa_forward.py

示例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]
开发者ID:crodehacke,项目名称:PISMcr,代码行数:33,代码来源:tauc2tillphi.py


注:本文中的PISM.getVerbosityLevel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。