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.
22 #include "pism/util/io/File.hh"
31 #include "pism/util/Time.hh"
46 unsigned int record = 0;
48 std::string input_filename = config->get_string(
"input.file");
50 bool bootstrap = config->get_flag(
"input.bootstrap") and (not input_filename.empty());
51 bool restart = (not config->get_flag(
"input.bootstrap")) and (not input_filename.empty());
56 }
else if (bootstrap) {
65 if (not input_filename.empty()) {
69 unsigned int last_record = input_file.
nrecords();
70 if (last_record > 0) {
83 : m_grid(
g), m_config(
g->ctx()->config()), m_sys(
g->ctx()->unit_system()),
84 m_log(
g->ctx()->log()) {
157 auto regrid_file =
m_config->get_string(
"input.regrid.file");
160 if (regrid_file.empty()) {
166 if (((not regrid_vars.empty()) and
member(m.
get_string(
"short_name"), regrid_vars)) or
170 " %s: regridding '%s' from file '%s' ...\n",
172 m.
get_string(
"short_name").c_str(), regrid_file.c_str());
Combines the max. time step with the flag indicating if a restriction is active. Makes is possible to...
High-level PISM I/O class.
void regrid(const std::string &filename, RegriddingFlag flag, double default_value=0.0)
virtual MaxTimestep max_timestep_impl(double t) const
std::shared_ptr< const IceGrid > ConstPtr
const Config::ConstPtr m_config
configuration database used by this component
Component(IceGrid::ConstPtr g)
virtual DiagnosticList diagnostics_impl() const
const IceGrid::ConstPtr m_grid
grid used by this component
void write_model_state(const File &output) const
Write model state variables to an output file.
virtual void regrid(const std::string &module_name, IceModelVec &variable, RegriddingFlag flag=NO_REGRID_WITHOUT_REGRID_VARS)
IceGrid::ConstPtr grid() const
RegriddingFlag
This flag determines whether a variable is read from the -regrid_file file even if it is not listed a...
std::set< std::string > set_split(const std::string &input, char separator)
Transform a separator-separated list (a string) into a set of strings.
DiagnosticList diagnostics() const
MaxTimestep max_timestep(double t) const
Reports the maximum time-step the model can take at time t.
@ REGRID_WITHOUT_REGRID_VARS
@ PISM_READONLY
open an existing file for reading only
std::shared_ptr< const Config > ConstPtr
InputOptions process_input_options(MPI_Comm com, Config::ConstPtr config)
virtual TSDiagnosticList ts_diagnostics_impl() const
virtual void write_model_state_impl(const File &output) const
The default (empty implementation).
bool member(const std::string &string, const std::set< std::string > &set)
std::map< std::string, Diagnostic::Ptr > DiagnosticList
Abstract class for reading, writing, allocating, and accessing a DA-based PETSc Vec (2D and 3D fields...
TSDiagnosticList ts_diagnostics() const
virtual void define_model_state_impl(const File &output) const
The default (empty implementation).
SpatialVariableMetadata & metadata(unsigned int N=0)
Returns a reference to the SpatialVariableMetadata object containing metadata for the compoment N.
std::map< std::string, TSDiagnostic::Ptr > TSDiagnosticList
const Logger::ConstPtr m_log
logger (for easy access)
void define_model_state(const File &output) const
Define model state variables in an output file.
unsigned int nrecords() const
Get the number of records. Uses the length of an unlimited dimension.