Loading [MathJax]/extensions/tex2jax.js
PISM, A Parallel Ice Sheet Model 2.2.2-d6b3a29ca committed by Constantine Khrulev on 2025-03-28
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages

◆ grid_name()

std::string pism::grid_name ( const File file,
const std::string &  variable_name,
units::System::Ptr  sys,
bool  piecewise_constant 
)

Return the string that describes a 2D grid present in a NetCDF file.

Here variable_name is the name of a 2D variable used to extract grid information.

We assume that a file may contain more than one grid, so the file name alone is not sufficient.

Appends ":piecewise_constant" if piecewise_constant is true.

The output has the form "input_file.nc:y:x".

Definition at line 217 of file projection.cc.

References pism::File::dimension_type(), pism::File::dimensions(), pism::RuntimeError::formatted(), pism::File::name(), PISM_ERROR_LOCATION, pism::File::read_text_attribute(), split(), X_AXIS, and Y_AXIS.

Referenced by pism::InputInterpolationYAC::define_grid(), pism::Grid::get_interpolation(), pism::InputInterpolation3D::InputInterpolation3D(), and pism::InputInterpolationYAC::InputInterpolationYAC().