def compute(self, grid, Mz, coarsening_factor): tauc = PISM.IceModelVec2S(grid, "tauc", PISM.WITHOUT_GHOSTS) tauc.set(0.0) enthalpy = PISM.IceModelVec3(grid, "enthalpy", PISM.WITHOUT_GHOSTS, grid.z()) enthalpy.set(0.0) model = PISM.BlatterTestHalfar(grid, Mz, coarsening_factor) geometry = PISM.Geometry(grid) with PISM.vec.Access(geometry.ice_thickness): for (i, j) in grid.points(): geometry.ice_thickness[i, j] = model.H_exact(grid.x(i)) geometry.bed_elevation.set(0.0) geometry.sea_level_elevation.set(0) geometry.ensure_consistency(0.0) model.init() inputs = PISM.StressBalanceInputs() inputs.geometry = geometry inputs.basal_yield_stress = tauc inputs.enthalpy = enthalpy model.update(inputs, True) return model