20 #include "pism/util/IceGrid.hh"
21 #include "pism/util/Vars.hh"
23 #include "pism/util/ConfigInterface.hh"
24 #include "pism/util/Mask.hh"
25 #include "pism/util/pism_options.hh"
26 #include "pism/util/error_handling.hh"
27 #include "pism/util/io/io_helpers.hh"
28 #include "pism/util/pism_utilities.hh"
29 #include "pism/util/IceModelVec2CellType.hh"
30 #include "pism/util/MaxTimestep.hh"
31 #include "pism/util/io/File.hh"
32 #include "pism/geometry/Geometry.hh"
44 m_alpha =
m_config->get_number(
"surface.force_to_thickness.alpha",
"s-1");
50 "mask specifying where to apply the force-to-thickness mechanism",
68 "* Initializing force-to-thickness mass-balance modifier...\n");
70 std::string input_file =
m_config->get_string(
"surface.force_to_thickness_file");
72 if (input_file.empty()) {
77 " alpha = %.6f year-1 for -force_to_thickness mechanism\n"
78 " alpha = %.6f year-1 in areas with target ice thickness of less than %.3f meters\n",
87 " reading target thickness 'thk' from %s ...\n"
88 " (this field will appear in output file as 'ftt_target_thk')\n",
94 "target thickness for force-to-thickness mechanism (hit this at end of run)",
96 "land_ice_thickness", 0);
103 "target thickness for force-to-thickness mechanism (wants to hit this at end of run)",
110 " reading force-to-thickness mask 'ftt_mask' from %s ...\n",
234 " updating surface mass balance using -force_to_thickness mechanism ...");
236 double ice_density =
m_config->get_number(
"constants.ice.density");
242 const int i = p.i(), j = p.j();
Makes sure that we call begin_access() and end_access() for all accessed IceModelVecs.
const units::System::Ptr m_sys
unit system used by this component
const Config::ConstPtr m_config
configuration database used by this component
const Logger::ConstPtr m_log
logger (for easy access)
const IceGrid::ConstPtr m_grid
grid used by this component
High-level PISM I/O class.
IceModelVec2CellType cell_type
IceModelVec2S ice_thickness
std::shared_ptr< const IceGrid > ConstPtr
bool grounded(int i, int j) const
"Cell type" mask. Adds convenience methods to IceModelVec2Int.
SpatialVariableMetadata & metadata(unsigned int N=0)
Returns a reference to the SpatialVariableMetadata object containing metadata for the compoment N.
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.
void regrid(const std::string &filename, RegriddingFlag flag, double default_value=0.0)
void set(double c)
Result: v[j] <- c for all j.
void define(const File &file, IO_Type default_type=PISM_DOUBLE) const
Define variables corresponding to an IceModelVec in a file opened using file.
void write(const std::string &filename) const
Combines the max. time step with the flag indicating if a restriction is active. Makes is possible to...
ForceThickness(IceGrid::ConstPtr g, std::shared_ptr< SurfaceModel > input)
const IceModelVec2S & runoff_impl() const
void write_model_state_impl(const File &output) const
The default (empty implementation).
MaxTimestep max_timestep_impl(double t) const
void define_model_state_impl(const File &output) const
The default (empty implementation).
double m_ice_free_thickness_threshold
void init_impl(const Geometry &geometry)
double m_alpha_ice_free_factor
const IceModelVec2S & mass_flux_impl() const
void adjust_mass_flux(double time, const IceModelVec2S &ice_thickness, const IceModelVec2CellType &cell_type, IceModelVec2S &result) const
const IceModelVec2S & accumulation_impl() const
IceModelVec2S m_target_thickness
const IceModelVec2S & melt_impl() const
IceModelVec2Int m_ftt_mask
void update_impl(const Geometry &geometry, double t, double dt)
IceModelVec2S::Ptr m_mass_flux
static IceModelVec2S::Ptr allocate_mass_flux(IceGrid::ConstPtr grid)
IceModelVec2S::Ptr m_melt
static IceModelVec2S::Ptr allocate_melt(IceGrid::ConstPtr grid)
IceModelVec2S::Ptr m_accumulation
std::shared_ptr< SurfaceModel > m_input_model
void dummy_accumulation(const IceModelVec2S &smb, IceModelVec2S &result)
static IceModelVec2S::Ptr allocate_accumulation(IceGrid::ConstPtr grid)
static IceModelVec2S::Ptr allocate_runoff(IceGrid::ConstPtr grid)
IceModelVec2S::Ptr m_runoff
void dummy_runoff(const IceModelVec2S &smb, IceModelVec2S &result)
void dummy_melt(const IceModelVec2S &smb, IceModelVec2S &result)
The interface of PISM's surface models.
#define PISM_ERROR_LOCATION
double convert(System::Ptr system, double input, const std::string &spec1, const std::string &spec2)
Convert a quantity from unit1 to unit2.
double min(const IceModelVec2S &input)
Finds minimum over all the values in an IceModelVec2S object. Ignores ghosts.
@ PISM_READONLY
open an existing file for reading only