def test_atmosphere_elevation_change_scale(self): "Modifier 'elevation_change': scaling" config.set_string("atmosphere.elevation_change.precipitation.method", "scale") model = PISM.AtmosphereUniform(self.grid) modifier = PISM.AtmosphereElevationChange(self.grid, model) modifier.init(self.geometry) # change surface elevation self.geometry.ice_surface_elevation.shift(self.dz) # check that the temperature and precipitation changed accordingly modifier.update(self.geometry, 0, 1) C = config.get_number( "atmosphere.precip_exponential_factor_for_temperature") dT = -self.precip_dTdz * self.dz / 1000.0 P = sample(model.mean_precipitation()) dP = np.exp(C * dT) * P - P check_modifier(model, modifier, T=self.dT, P=dP, ts=[0.5], Ts=[self.dT], Ps=[dP])
def test_atmosphere_elevation_change_shift(self): "Modifier 'elevation_change': lapse rate" config.set_string("atmosphere.elevation_change.precipitation.method", "shift") model = PISM.AtmosphereUniform(self.grid) modifier = PISM.AtmosphereElevationChange(self.grid, model) modifier.init(self.geometry) # change surface elevation self.geometry.ice_surface_elevation.shift(self.dz) # check that the temperature changed accordingly modifier.update(self.geometry, 0, 1) check_modifier(model, modifier, T=self.dT, P=self.dP, ts=[0.5], Ts=[self.dT], Ps=[self.dP])