Exemplo n.º 1
0
    def compute(self, grid):
        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)

        Mz = 2
        coarsening_factor = 1
        model = PISM.BlatterTestvanderVeen(grid, Mz, coarsening_factor)

        geometry = PISM.Geometry(grid)

        # low enough to make it grounded
        sea_level = -100.0

        with PISM.vec.Access(
            [geometry.ice_thickness, geometry.bed_elevation, tauc]):
            for (i, j) in grid.points():
                X = grid.x(i)
                geometry.ice_thickness[i, j] = model.H_exact(X)
                geometry.bed_elevation[i, j] = model.b_exact(X)
                tauc[i, j] = model.beta_exact(X)

        geometry.sea_level_elevation.set(sea_level)
        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