19#include "pism/coupler/surface/Elevation.hh"
21#include "pism/util/Grid.hh"
22#include "pism/util/ConfigInterface.hh"
23#include "pism/util/error_handling.hh"
24#include "pism/util/pism_options.hh"
25#include "pism/util/MaxTimestep.hh"
26#include "pism/geometry/Geometry.hh"
43 bool limits_set =
false;
46 "* Initializing the constant-in-time surface processes model Elevation. Setting...\n");
51 m_T_min =
m_config->get_number(
"surface.elevation_dependent.T_min",
"kelvin");
52 m_T_max =
m_config->get_number(
"surface.elevation_dependent.T_max",
"kelvin");
59 m_M_min =
m_config->get_number(
"surface.elevation_dependent.M_min",
"m s^-1");
60 m_M_max =
m_config->get_number(
"surface.elevation_dependent.M_max",
"m s^-1");
81 " temperature at %.0f m a.s.l. = %.2f deg C\n"
82 " temperature at %.0f m a.s.l. = %.2f deg C\n"
83 " mass balance below %.0f m a.s.l. = %.2f m year-1\n"
84 " mass balance at %.0f m a.s.l. = %.2f m year-1\n"
85 " mass balance at %.0f m a.s.l. = %.2f m year-1\n"
86 " mass balance above %.0f m a.s.l. = %.2f m year-1\n"
87 " equilibrium line altitude z_ELA = %.2f m a.s.l.\n",
97 m_log->message(2,
" - parameterizing the ice surface temperature 'ice_surface_temp' ... \n");
99 " ice temperature at the ice surface (T = ice_surface_temp) is piecewise-linear function\n"
100 " of surface altitude (usurf):\n"
101 " / %2.2f K for usurf < %.f m\n"
102 " T = | %5.2f K + %5.3f * (usurf - %.f m) for %.f m < usurf < %.f m\n"
103 " \\ %5.2f K for %.f m < usurf\n",
111 " - parameterizing the ice surface mass balance 'climatic_mass_balance' ... \n");
115 " - option '-climatic_mass_balance_limits' seen, limiting upper and lower bounds ... \n");
119 " surface mass balance (M = climatic_mass_balance) is piecewise-linear function\n"
120 " of surface altitue (usurf):\n"
121 " / %5.2f m year-1 for usurf < %3.f m\n"
122 " M = | %5.3f 1/a * (usurf-%.0f m) for %3.f m < usurf < %3.f m\n"
123 " \\ %5.3f 1/a * (usurf-%.0f m) for %3.f m < usurf < %3.f m\n"
124 " \\ %5.2f m year-1 for %3.f m < usurf\n",
177 for (
auto p =
m_grid->points(); p; p.next()) {
178 const int i = p.i(), j = p.j();
180 double z = surface(i, j);
186 result(i, j) = dabdz * (z -
m_z_ELA);
189 result(i, j) = dacdz * (z -
m_z_ELA);
196 "Elevation::compute_mass_flux: HOW DID I GET HERE?");
215 for (
auto p =
m_grid->points(); p; p.next()) {
216 const int i = p.i(), j = p.j();
218 double z = surface(i, j);
231 "Elevation::compute_temperature: HOW DID I GET HERE?");
const units::System::Ptr m_sys
unit system used by this component
std::shared_ptr< const Grid > grid() const
const Config::ConstPtr m_config
configuration database used by this component
const Logger::ConstPtr m_log
logger (for easy access)
const std::shared_ptr< const Grid > m_grid
grid used by this component
array::Scalar2 ice_surface_elevation
Combines the max. time step with the flag indicating if a restriction is active. Makes is possible to...
void failed()
Indicates a failure of a parallel section.
Makes sure that we call begin_access() and end_access() for all accessed array::Arrays.
void scale(double alpha)
Result: v <- v * alpha. Calls VecScale.
void compute_temperature(const array::Scalar &surface, array::Scalar &result) const
const array::Scalar & temperature_impl() const
void compute_mass_flux(const array::Scalar &surface, array::Scalar &result) const
void init_impl(const Geometry &geometry)
std::shared_ptr< array::Scalar > m_mass_flux
void update_impl(const Geometry &geometry, double t, double dt)
Elevation(std::shared_ptr< const Grid > grid, std::shared_ptr< atmosphere::AtmosphereModel > input)
virtual const array::Scalar & accumulation_impl() const
std::shared_ptr< array::Scalar > m_temperature
virtual const array::Scalar & runoff_impl() const
virtual const array::Scalar & melt_impl() const
const array::Scalar & mass_flux_impl() const
MaxTimestep max_timestep_impl(double t) const
static std::shared_ptr< array::Scalar > allocate_mass_flux(std::shared_ptr< const Grid > grid)
void dummy_accumulation(const array::Scalar &smb, array::Scalar &result)
std::shared_ptr< array::Scalar > m_melt
static std::shared_ptr< array::Scalar > allocate_temperature(std::shared_ptr< const Grid > grid)
std::shared_ptr< array::Scalar > m_runoff
void dummy_melt(const array::Scalar &smb, array::Scalar &result)
std::shared_ptr< array::Scalar > m_accumulation
void dummy_runoff(const array::Scalar &smb, array::Scalar &result)
The interface of PISM's surface models.
#define PISM_ERROR_LOCATION