20 #include "pism/coupler/surface/Initialization.hh"
21 #include "pism/util/error_handling.hh"
22 #include "pism/util/io/File.hh"
23 #include "pism/coupler/util/init_step.hh"
24 #include "pism/util/Context.hh"
31 m_mass_flux(m_grid,
"effective_climatic_mass_balance"),
32 m_temperature(m_grid,
"effective_ice_surface_temp")
43 "surface mass balance (accumulation/ablation) rate, as seen by the ice dynamics code (used for restarting)")
49 "temperature of the ice at the ice surface but below firn processes, as seen by the ice dynamics code (used for restarting)")
57 "liquid water fraction of the ice at the top surface, as seen by the ice dynamics code (used for restarting)")
59 .set_time_independent(
false);
62 m_layer_mass->metadata().set_name(
"effective_surface_layer_mass");
65 "mass held in the surface layer, as seen by the ice dynamics code (used for restarting)")
67 .set_time_independent(
false);
73 "thickness of the surface layer, as seen by the ice dynamics code (used for restarting)")
75 .set_time_independent(
false);
104 m_log->message(2,
"* Reading effective surface model outputs from '%s' for re-starting...\n",
108 const unsigned int last_record = file.
nrecords() - 1;
110 v->read(file, last_record);
113 m_log->message(2,
"* Performing a 'fake' surface model time-step for bootstrapping...\n");
const Time & time() const
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)
@ REGRID_WITHOUT_REGRID_VARS
const std::shared_ptr< const Grid > m_grid
grid used by this component
void regrid(const std::string &module_name, array::Array &variable, RegriddingFlag flag=NO_REGRID_WITHOUT_REGRID_VARS)
unsigned int nrecords() const
Get the number of records. Uses the length of an unlimited dimension.
High-level PISM I/O class.
void copy_from(const Array2D< T > &source)
SpatialVariableMetadata & metadata(unsigned int N=0)
Returns a reference to the SpatialVariableMetadata object containing metadata for the compoment N.
void init_impl(const Geometry &geometry)
const array::Scalar & accumulation_impl() const
void update_impl(const Geometry &geometry, double t, double dt)
std::vector< array::Array * > m_variables
const array::Scalar & temperature_impl() const
const array::Scalar & melt_impl() const
const array::Scalar & mass_flux_impl() const
void write_model_state_impl(const File &output) const
The default (empty implementation).
InitializationHelper(std::shared_ptr< const Grid > g, std::shared_ptr< SurfaceModel > in)
const array::Scalar & runoff_impl() const
const array::Scalar & layer_mass_impl() const
array::Scalar m_mass_flux
void define_model_state_impl(const File &output) const
The default (empty implementation).
const array::Scalar & layer_thickness_impl() const
const array::Scalar & liquid_water_fraction_impl() const
array::Scalar m_temperature
static std::shared_ptr< array::Scalar > allocate_runoff(std::shared_ptr< const Grid > grid)
std::shared_ptr< array::Scalar > m_melt
std::shared_ptr< array::Scalar > m_layer_thickness
static std::shared_ptr< array::Scalar > allocate_accumulation(std::shared_ptr< const Grid > grid)
static std::shared_ptr< array::Scalar > allocate_melt(std::shared_ptr< const Grid > grid)
std::shared_ptr< array::Scalar > m_runoff
static std::shared_ptr< array::Scalar > allocate_layer_thickness(std::shared_ptr< const Grid > grid)
std::shared_ptr< SurfaceModel > m_input_model
static std::shared_ptr< array::Scalar > allocate_layer_mass(std::shared_ptr< const Grid > grid)
std::shared_ptr< array::Scalar > m_layer_mass
std::shared_ptr< array::Scalar > m_accumulation
std::shared_ptr< array::Scalar > m_liquid_water_fraction
static std::shared_ptr< array::Scalar > allocate_liquid_water_fraction(std::shared_ptr< const Grid > grid)
The interface of PISM's surface models.
#define PISM_ERROR_LOCATION
@ PISM_READONLY
open an existing file for reading only
InputOptions process_input_options(MPI_Comm com, Config::ConstPtr config)
void init_step(M *model, const Geometry &geometry, const Time &time)