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");
53 options::RealList IST(
"-ice_surface_temp",
"ice surface temperature parameterization",
54 {-5.0, 0.0, 1325.0, 1350.0});
56 if (IST->size() != 4) {
58 " (comma-separated list of 4 numbers)");
70 "climatic mass balance parameterization",
71 {-3.0, 4.0, 1100.0, 1450.0, 1700.0});
72 if (CMB->size() != 5) {
74 " (comma-separated list of 5 numbers)");
76 m_M_min = meter_per_second(CMB[0]);
77 m_M_max = meter_per_second(CMB[1]);
86 "lower and upper limits of the climatic mass balance", {});
87 limits_set = limits.
is_set();
88 if (limits.is_set()) {
89 if (limits->size() != 2) {
91 " (a comma-separated list of 2 numbers)");
104 " temperature at %.0f m a.s.l. = %.2f deg C\n"
105 " temperature at %.0f m a.s.l. = %.2f deg C\n"
106 " mass balance below %.0f m a.s.l. = %.2f m year-1\n"
107 " mass balance at %.0f m a.s.l. = %.2f m year-1\n"
108 " mass balance at %.0f m a.s.l. = %.2f m year-1\n"
109 " mass balance above %.0f m a.s.l. = %.2f m year-1\n"
110 " equilibrium line altitude z_ELA = %.2f m a.s.l.\n",
120 m_log->message(2,
" - parameterizing the ice surface temperature 'ice_surface_temp' ... \n");
122 " ice temperature at the ice surface (T = ice_surface_temp) is piecewise-linear function\n"
123 " of surface altitude (usurf):\n"
124 " / %2.2f K for usurf < %.f m\n"
125 " T = | %5.2f K + %5.3f * (usurf - %.f m) for %.f m < usurf < %.f m\n"
126 " \\ %5.2f K for %.f m < usurf\n",
134 " - parameterizing the ice surface mass balance 'climatic_mass_balance' ... \n");
138 " - option '-climatic_mass_balance_limits' seen, limiting upper and lower bounds ... \n");
142 " surface mass balance (M = climatic_mass_balance) is piecewise-linear function\n"
143 " of surface altitue (usurf):\n"
144 " / %5.2f m year-1 for usurf < %3.f m\n"
145 " M = | %5.3f 1/a * (usurf-%.0f m) for %3.f m < usurf < %3.f m\n"
146 " \\ %5.3f 1/a * (usurf-%.0f m) for %3.f m < usurf < %3.f m\n"
147 " \\ %5.2f m year-1 for %3.f m < usurf\n",
200 for (
auto p =
m_grid->points(); p; p.next()) {
201 const int i = p.i(), j = p.j();
203 double z = surface(i, j);
209 result(i, j) = dabdz * (z -
m_z_ELA);
212 result(i, j) = dacdz * (z -
m_z_ELA);
219 "Elevation::compute_mass_flux: HOW DID I GET HERE?");
238 for (
auto p =
m_grid->points(); p; p.next()) {
239 const int i = p.i(), j = p.j();
241 double z = surface(i, j);
254 "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
static double K(double psi_x, double psi_y, double speed, double epsilon)