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/Logger.hh"
25#include "pism/util/io/IO_Flags.hh"
32 m_mass_flux(m_grid,
"effective_climatic_mass_balance"),
33 m_temperature(m_grid,
"effective_ice_surface_temp")
44 "surface mass balance (accumulation/ablation) rate, as seen by the ice dynamics code (used for restarting)")
45 .
units(
"kg m^-2 s^-1")
50 "temperature of the ice at the ice surface but below firn processes, as seen by the ice dynamics code (used for restarting)")
58 "liquid water fraction of the ice at the top surface, as seen by the ice dynamics code (used for restarting)")
60 .set_time_dependent(
true);
63 m_layer_mass->metadata().set_name(
"effective_surface_layer_mass");
66 "mass held in the surface layer, as seen by the ice dynamics code (used for restarting)")
68 .set_time_dependent(
true);
74 "thickness of the surface layer, as seen by the ice dynamics code (used for restarting)")
76 .set_time_dependent(
true);
105 m_log->message(2,
"* Reading effective surface model outputs from '%s' for re-starting...\n",
109 const unsigned int last_record = file.
nrecords() - 1;
111 v->read(file, last_record);
114 m_log->message(2,
"* Performing a 'fake' surface model time-step for bootstrapping...\n");
173 std::set<VariableMetadata> variables{};
175 for (
auto &nc_var : v->all_metadata()) {
176 variables.insert(nc_var);
const Time & time() const
std::shared_ptr< const Grid > grid() const
std::shared_ptr< const Config > m_config
configuration database used by this component
@ 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)
std::shared_ptr< const Logger > m_log
logger (for easy access)
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)
VariableMetadata & metadata(unsigned int N=0)
Returns a reference to the VariableMetadata 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
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
std::set< VariableMetadata > state_impl() const
void write_state_impl(const OutputFile &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
void init_step(M *model, const In &inputs, const Time &time)
T combine(const T &a, const T &b)
InputOptions process_input_options(MPI_Comm com, std::shared_ptr< const Config > config)