PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800

◆ sum_columns()

void pism::array::sum_columns ( const Array3D data,
double  A,
double  B,
Scalar output 
)

Sum a 3-D vector in the Z direction to create a 2-D vector.

Note that this sums up all the values in a column, including ones above the ice. This may or may not be what you need. Also, take a look at IceModel::compute_ice_enthalpy(PetscScalar &result) in iMreport.cc.

As for the difference between array::Array2D and array::Scalar, the former can store fields with more than 1 "degree of freedom" per grid point (such as 2D fields on the "staggered" grid, with the first degree of freedom corresponding to the i-offset and second to j-offset).

array::Scalar is just array::Array2D with "dof == 1", and array::Vector is array::Array2D with "dof == 2". (Plus some extra methods, of course.)

Either one of array::Array2D and array::Scalar would work in this case.

Computes output = A*output + B*sum_columns(input) + C

See also
https://github.com/pism/pism/issues/229

Definition at line 190 of file Array3D.cc.

References pism::fem::column(), pism::array::Array3D::get_column(), pism::array::Array::grid(), and pism::k.

Referenced by pism::icebin::IBIceModel::energy_step().