19#include "pism/coupler/surface/Elevation.hh"
21#include "pism/util/Grid.hh"
22#include "pism/util/Config.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"
27#include "pism/util/Logger.hh"
44 bool limits_set =
false;
47 "* Initializing the constant-in-time surface processes model Elevation. Setting...\n");
52 m_T_min =
m_config->get_number(
"surface.elevation_dependent.T_min",
"kelvin");
53 m_T_max =
m_config->get_number(
"surface.elevation_dependent.T_max",
"kelvin");
60 m_M_min =
m_config->get_number(
"surface.elevation_dependent.M_min",
"m s^-1");
61 m_M_max =
m_config->get_number(
"surface.elevation_dependent.M_max",
"m s^-1");
82 " temperature at %.0f m a.s.l. = %.2f deg C\n"
83 " temperature at %.0f m a.s.l. = %.2f deg C\n"
84 " mass balance below %.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 at %.0f m a.s.l. = %.2f m year-1\n"
87 " mass balance above %.0f m a.s.l. = %.2f m year-1\n"
88 " equilibrium line altitude z_ELA = %.2f m a.s.l.\n",
98 m_log->message(2,
" - parameterizing the ice surface temperature 'ice_surface_temp' ... \n");
100 " ice temperature at the ice surface (T = ice_surface_temp) is piecewise-linear function\n"
101 " of surface altitude (usurf):\n"
102 " / %2.2f K for usurf < %.f m\n"
103 " T = | %5.2f K + %5.3f * (usurf - %.f m) for %.f m < usurf < %.f m\n"
104 " \\ %5.2f K for %.f m < usurf\n",
112 " - parameterizing the ice surface mass balance 'climatic_mass_balance' ... \n");
116 " - option '-climatic_mass_balance_limits' seen, limiting upper and lower bounds ... \n");
120 " surface mass balance (M = climatic_mass_balance) is piecewise-linear function\n"
121 " of surface altitue (usurf):\n"
122 " / %5.2f m year-1 for usurf < %3.f m\n"
123 " M = | %5.3f 1/a * (usurf-%.0f m) for %3.f m < usurf < %3.f m\n"
124 " \\ %5.3f 1/a * (usurf-%.0f m) for %3.f m < usurf < %3.f m\n"
125 " \\ %5.2f m year-1 for %3.f m < usurf\n",
178 for (
auto p :
m_grid->points()) {
179 const int i = p.i(), j = p.j();
181 double z = surface(i, j);
187 result(i, j) = dabdz * (z -
m_z_ELA);
190 result(i, j) = dacdz * (z -
m_z_ELA);
197 "Elevation::compute_mass_flux: HOW DID I GET HERE?");
216 for (
auto p :
m_grid->points()) {
217 const int i = p.i(), j = p.j();
219 double z = surface(i, j);
232 "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
std::shared_ptr< const Config > m_config
configuration database used by this component
const std::shared_ptr< const Grid > m_grid
grid used by this component
std::shared_ptr< const Logger > m_log
logger (for easy access)
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