本文整理汇总了Python中PISM.compute_grounded_cell_fraction方法的典型用法代码示例。如果您正苦于以下问题:Python PISM.compute_grounded_cell_fraction方法的具体用法?Python PISM.compute_grounded_cell_fraction怎么用?Python PISM.compute_grounded_cell_fraction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PISM
的用法示例。
在下文中一共展示了PISM.compute_grounded_cell_fraction方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: grounded_cell_fraction_test
# 需要导入模块: import PISM [as 别名]
# 或者: from PISM import compute_grounded_cell_fraction [as 别名]
def grounded_cell_fraction_test():
# allocation
grid = allocate_grid(ctx)
ice_thickness, bed_topography, surface, mask, gl_mask, gl_mask_x, gl_mask_y, _ = allocate_storage(grid)
bed_topography.set(0.0)
# initialization
sea_level = 500.0
for L in [0.0, 0.25, 0.5, 0.75, 1.0]:
init(mu, L, sea_level, ice_thickness, "box")
compute_mask(sea_level, bed_topography, ice_thickness, mask, surface)
# computation of gl_mask
PISM.compute_grounded_cell_fraction(ice_density, ocean_density, sea_level,
ice_thickness, bed_topography, mask, gl_mask,
gl_mask_x, gl_mask_y)
# inspection / comparison
print("L = %f" % L)
print_vec(mask)
print_vec(gl_mask_x)
print_vec(gl_mask_y)
print_vec(gl_mask)
示例2: new_grounded_cell_fraction_test
# 需要导入模块: import PISM [as 别名]
# 或者: from PISM import compute_grounded_cell_fraction [as 别名]
def new_grounded_cell_fraction_test():
# allocation
grid = allocate_grid(ctx)
ice_thickness, bed_topography, _, _, gl_mask, _, _, sea_level = allocate_storage(grid)
# initialization
bed_topography.set(0.0)
sl = 500.0
sea_level.set(sl)
for L in [0.0, 0.25, 0.5, 0.75, 1.0]:
init(mu, L, sl, ice_thickness, "box")
# computation of gl_mask
PISM.compute_grounded_cell_fraction(ice_density, ocean_density,
sea_level,
ice_thickness,
bed_topography,
gl_mask)
# inspection / comparison
print("L = %f" % L)
print_vec(gl_mask)