22 #include "pism/util/array/Scalar.hh"
30 auto grid = result.
grid();
32 if (fabs(lapse_rate) < 1e-12) {
38 for (
auto p = grid->points(); p; p.next()) {
39 const int i = p.i(), j = p.j();
41 result(i, j) -= lapse_rate * (surface(i,j) - reference_surface(i, j));
Makes sure that we call begin_access() and end_access() for all accessed array::Arrays.
std::shared_ptr< const Grid > grid() const
void lapse_rate_correction(const array::Scalar &surface, const array::Scalar &reference_surface, double lapse_rate, array::Scalar &result)