PISM, A Parallel Ice Sheet Model
stable v1.2 committed by Constantine Khrulev on 2020-02-11 20:24:05 -0900
|
Go to the documentation of this file.
20 #include "pism/util/pism_utilities.hh"
21 #include "pism/util/Time.hh"
22 #include "pism/util/Vars.hh"
23 #include "pism/util/IceGrid.hh"
24 #include "pism/util/ConfigInterface.hh"
32 const unsigned int WIDE_STENCIL =
m_config->get_number(
"grid.max_stencil_width");
36 "m",
"m",
"bedrock_altitude", 0);
40 "m",
"m",
"bedrock_altitude", 0);
44 "m s-1",
"mm year-1",
"tendency_of_bedrock_altitude", 0);
81 this->
init_impl(opts, ice_thickness, sea_level_elevation);
89 this->
bootstrap_impl(bed_elevation, bed_uplift, ice_thickness, sea_level_elevation);
100 (void) ice_thickness;
101 (void) sea_level_elevation;
106 double t,
double dt) {
107 this->
update_impl(ice_thickness, sea_level_elevation, t, dt);
113 (void) ice_thickness;
114 (void) sea_level_elevation;
120 " reading bed topography and uplift from %s ... \n",
129 m_config->get_number(
"bootstrapping.defaults.bed"));
131 m_config->get_number(
"bootstrapping.defaults.uplift"));
146 std::string uplift_file =
m_config->get_string(
"bed_deformation.bed_uplift_file");
147 if (not uplift_file.empty()) {
149 " reading bed uplift from %s ... \n",
150 uplift_file.c_str());
154 std::string correction_file =
m_config->get_string(
"bed_deformation.bed_topography_delta_file");
155 if (not correction_file.empty()) {
167 m_log->message(2,
" Adding a bed topography correction read in from %s...\n",
172 topg_delta.
set_attrs(
"internal",
"bed topography correction",
173 "meters",
"meters",
"", 0);
183 bed.
add(-1, bed_last, result);
185 result.
scale(1.0 / dt);
188 double compute_load(
double bed,
double ice_thickness,
double sea_level,
189 double ice_density,
double ocean_density) {
192 ice_load = ice_thickness,
193 ocean_depth = std::max(sea_level - bed, 0.0),
194 ocean_load = (ocean_density / ice_density) * ocean_depth;
197 return ice_load > ocean_load ? ice_load : 0.0;
211 ice_density = config->get_number(
"constants.ice.density"),
212 ocean_density = config->get_number(
"constants.sea_water.density");
217 const int i = p.i(), j = p.j();
221 sea_level_elevation(i, j),
222 ice_density, ocean_density);
virtual void add(double alpha, const IceModelVec &x)
Result: v <- v + alpha * x. Calls VecAXPY.
IceModelVec2S m_topg
current bed elevation
void update(const IceModelVec2S &ice_thickness, const IceModelVec2S &sea_level_elevation, double t, double dt)
virtual void define(const File &nc, IO_Type default_type=PISM_DOUBLE) const
Define variables corresponding to an IceModelVec in a file opened using file.
void set_attrs(const std::string &pism_intent, const std::string &long_name, const std::string &units, const std::string &glaciological_units, const std::string &standard_name, unsigned int component)
Sets NetCDF attributes of an IceModelVec object.
High-level PISM I/O class.
void regrid(const std::string &filename, RegriddingFlag flag, double default_value=0.0)
std::shared_ptr< const IceGrid > ConstPtr
void read(const std::string &filename, unsigned int time)
void compute_uplift(const IceModelVec2S &bed, const IceModelVec2S &bed_last, double dt, IceModelVec2S &result)
Compute bed uplift (dt is in seconds).
const Config::ConstPtr m_config
configuration database used by this component
IceModelVec2S m_topg_last
bed elevation at the time of the last update
virtual void copy_from(const IceModelVec &source)
Result: v <- source. Leaves metadata alone but copies values in Vec. Uses VecCopy.
const IceGrid::ConstPtr m_grid
grid used by this component
virtual void init_impl(const InputOptions &opts, const IceModelVec2S &ice_thickness, const IceModelVec2S &sea_level_elevation)
Initialize from the context (input file and the "variables" database).
virtual void apply_topg_offset(const std::string &filename)
virtual void regrid(const std::string &module_name, IceModelVec &variable, RegriddingFlag flag=NO_REGRID_WITHOUT_REGRID_VARS)
virtual DiagnosticList diagnostics_impl() const
void create(IceGrid::ConstPtr grid, const std::string &name, IceModelVecKind ghostedp, int width=1)
static Ptr wrap(const IceModelVec2S &input)
void init(const InputOptions &opts, const IceModelVec2S &ice_thickness, const IceModelVec2S &sea_level_elevation)
const IceModelVec2S & uplift() const
Makes sure that we call begin_access() and end_access() for all accessed IceModelVecs.
virtual void update_impl(const IceModelVec2S &ice_thickness, const IceModelVec2S &sea_level_elevation, double t, double dt)=0
void bootstrap(const IceModelVec2S &bed_elevation, const IceModelVec2S &bed_uplift, const IceModelVec2S &ice_thickness, const IceModelVec2S &sea_level_elevation)
Initialize using provided bed elevation and uplift.
void write(const std::string &filename) const
virtual void write_model_state_impl(const File &output) const
The default (empty implementation).
std::shared_ptr< const Config > ConstPtr
virtual void define_model_state_impl(const File &output) const
The default (empty implementation).
const IceModelVec2S & bed_elevation() const
IceGrid::ConstPtr grid() const
std::map< std::string, Diagnostic::Ptr > DiagnosticList
BedDef(IceGrid::ConstPtr g)
double compute_load(double bed, double ice_thickness, double sea_level, double ice_density, double ocean_density)
virtual void scale(double alpha)
Result: v <- v * alpha. Calls VecScale.
virtual void bootstrap_impl(const IceModelVec2S &bed_elevation, const IceModelVec2S &bed_uplift, const IceModelVec2S &ice_thickness, const IceModelVec2S &sea_level_elevation)
IceModelVec2S m_uplift
bed uplift rate
const Logger::ConstPtr m_log
logger (for easy access)
A class defining a common interface for most PISM sub-models.