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

◆ compute_vertical_levels()

std::vector< double > pism::grid::compute_vertical_levels ( double  new_Lz,
unsigned int  new_Mz,
grid::VerticalSpacing  spacing,
double  lambda 
)

Set the vertical levels in the ice according to values in Mz (number of levels), Lz (domain height), spacing (quadratic or equal) and lambda (quadratic spacing parameter).

  • When vertical_spacing == EQUAL, the vertical grid in the ice is equally spaced: zlevels[k] = k dz where dz = Lz / (Mz - 1).
  • When vertical_spacing == QUADRATIC, the spacing is a quadratic function. The intent is that the spacing is smaller near the base than near the top.

    In particular, if \(\zeta_k = k / (\mathtt{Mz} - 1)\) then zlevels[k] = Lz * (( \(\zeta_k\) / \(\lambda\)) * (1.0 + ( \(\lambda\) - 1.0) \(\zeta_k\))) where \(\lambda\) = 4. The value \(\lambda\) indicates the slope of the quadratic function as it leaves the base. Thus a value of \(\lambda\) = 4 makes the spacing about four times finer at the base than equal spacing would be.

Definition at line 879 of file Grid.cc.

References EQUAL, pism::k, PISM_ERROR_LOCATION, and QUADRATIC.

Referenced by main(), pism::grid::Parameters::Parameters(), pismv_grid_defaults(), and pism::grid::Parameters::vertical_grid_from_options().