23 #include "pism/util/ConfigInterface.hh"
24 #include "pism/util/error_handling.hh"
48 inline bool icy(
int M) {
73 config.
get_number(
"constants.sea_water.density");
82 if (threshold < 0.0) {
99 inline void compute(
double sea_level,
double bed,
double thickness,
100 int *out_mask,
double *out_surface)
const {
101 const double hgrounded = bed + thickness;
102 const double hfloating = sea_level +
m_alpha*thickness;
105 is_floating = (hfloating > hgrounded),
109 double surface_result;
112 surface_result = hfloating;
120 surface_result = hgrounded;
129 if (out_surface != NULL) {
130 *out_surface = surface_result;
133 if (out_mask != NULL) {
134 *out_mask = mask_result;
138 inline int mask(
double sea_level,
double bed,
double thickness)
const {
140 compute(sea_level, bed, thickness, &result, NULL);
144 inline double surface(
double sea_level,
double bed,
double thickness)
const {
146 compute(sea_level, bed, thickness, NULL, &result);
double get_number(const std::string &name, UseFlag flag=REMEMBER_THIS_USE) const
A class for storing and accessing PISM configuration flags and parameters.
double m_icefree_thickness
void compute_mask(const array::Scalar &sea_level, const array::Scalar &bed, const array::Scalar &thickness, array::Scalar &result) const
void compute(double sea_level, double bed, double thickness, int *out_mask, double *out_surface) const
void set_icefree_thickness(double threshold)
GeometryCalculator(const Config &config)
int mask(double sea_level, double bed, double thickness) const
double surface(double sea_level, double bed, double thickness) const
void compute(const array::Scalar &sea_level, const array::Scalar &bed, const array::Scalar &thickness, array::Scalar &out_mask, array::Scalar &out_surface) const
void compute_surface(const array::Scalar &sea_level, const array::Scalar &bed, const array::Scalar &thickness, array::Scalar &result) const
static RuntimeError formatted(const ErrorLocation &location, const char format[],...) __attribute__((format(printf
build a RuntimeError with a formatted message
#define PISM_ERROR_LOCATION
bool icy(int M)
Ice-filled cell (grounded or floating).
bool ice_free_land(int M)
bool ice_free_ocean(int M)
bool grounded(int M)
Grounded cell (grounded ice or ice-free).
bool ice_free(int M)
Ice-free cell (grounded or ocean).
bool ocean(int M)
An ocean cell (floating ice or ice-free).