19 #include "pism/coupler/surface/ISMIP6Climate.hh"
21 #include "pism/util/Grid.hh"
22 #include "pism/coupler/util/options.hh"
23 #include "pism/util/io/io_helpers.hh"
24 #include "pism/geometry/Geometry.hh"
25 #include "pism/util/array/Forcing.hh"
30 ISMIP6::ISMIP6(std::shared_ptr<const Grid> grid, std::shared_ptr<atmosphere::AtmosphereModel> input)
32 m_mass_flux_reference(m_grid,
"climatic_mass_balance"),
33 m_temperature_reference(m_grid,
"ice_surface_temp"),
34 m_surface_reference(m_grid,
"usurf")
45 .
long_name(
"reference surface mass balance rate")
51 auto smb_max =
m_config->get_number(
"surface.given.smb_max",
"kg m-2 second-1");
74 unsigned int buffer_size =
m_config->get_number(
"input.forcing.buffer_size");
80 std::make_shared<array::Forcing>(
m_grid, file,
"climatic_mass_balance_anomaly",
85 .long_name(
"surface mass balance rate anomaly")
87 .output_units(
"kg m-2 year-1");
92 std::make_shared<array::Forcing>(
m_grid, file,
"climatic_mass_balance_gradient",
97 .long_name(
"surface mass balance rate elevation lapse rate")
98 .units(
"kg m-2 s-1 m-1")
99 .output_units(
"kg m-2 year-1 m-1");
104 std::make_shared<array::Forcing>(
m_grid, file,
"ice_surface_temp_anomaly",
109 .long_name(
"ice surface temperature anomaly")
115 std::make_shared<array::Forcing>(
m_grid, file,
"ice_surface_temp_gradient",
120 .long_name(
"ice surface temperature elevation lapse rate")
121 .units(
"Kelvin m-1");
129 m_log->message(2,
"* Initializing the ISMIP6 surface model...\n");
133 auto reference_filename =
m_config->get_string(
"surface.ismip6.reference_file");
187 for (
auto p =
m_grid->points(); p; p.next()) {
188 const int i = p.i(), j = p.j();
190 SMB(i, j) = SMB_ref(i, j) + aSMB(i, j) + dSMBdz(i, j) * (h(i, j) - h_ref(i, j));
191 T(i, j) = T_ref(i, j) + aT(i, j) + dTdz(i, j) * (h(i, j) - h_ref(i, j));
const Config::ConstPtr m_config
configuration database used by this component
const Logger::ConstPtr m_log
logger (for easy access)
const std::shared_ptr< const Grid > m_grid
grid used by this component
High-level PISM I/O class.
array::Scalar2 ice_surface_elevation
Combines the max. time step with the flag indicating if a restriction is active. Makes is possible to...
Makes sure that we call begin_access() and end_access() for all accessed array::Arrays.
void regrid(const std::string &filename, io::Default default_value)
SpatialVariableMetadata & metadata(unsigned int N=0)
Returns a reference to the SpatialVariableMetadata object containing metadata for the compoment N.
void average(double t, double dt)
void update(double t, double dt)
Read some data to make sure that the interval (t, t + dt) is covered.
2D time-dependent inputs (for climate forcing, etc)
array::Scalar m_mass_flux_reference
const array::Scalar & mass_flux_impl() const
std::shared_ptr< array::Forcing > m_mass_flux_anomaly
const array::Scalar & temperature_impl() const
void update_impl(const Geometry &geometry, double t, double dt)
const array::Scalar & accumulation_impl() const
std::shared_ptr< array::Scalar > m_temperature
std::shared_ptr< array::Scalar > m_mass_flux
void init_impl(const Geometry &geometry)
std::shared_ptr< array::Forcing > m_temperature_anomaly
std::shared_ptr< array::Forcing > m_temperature_gradient
const array::Scalar & melt_impl() const
MaxTimestep max_timestep_impl(double t) const
const array::Scalar & runoff_impl() const
array::Scalar m_temperature_reference
std::shared_ptr< array::Forcing > m_mass_flux_gradient
array::Scalar m_surface_reference
ISMIP6(std::shared_ptr< const Grid > g, std::shared_ptr< atmosphere::AtmosphereModel > input)
static std::shared_ptr< array::Scalar > allocate_mass_flux(std::shared_ptr< const Grid > grid)
void dummy_accumulation(const array::Scalar &smb, array::Scalar &result)
std::shared_ptr< array::Scalar > m_melt
static std::shared_ptr< array::Scalar > allocate_temperature(std::shared_ptr< const Grid > grid)
std::shared_ptr< array::Scalar > m_runoff
void dummy_melt(const array::Scalar &smb, array::Scalar &result)
std::shared_ptr< array::Scalar > m_accumulation
void dummy_runoff(const array::Scalar &smb, array::Scalar &result)
The interface of PISM's surface models.
double min(const array::Scalar &input)
Finds minimum over all the values in an array::Scalar object. Ignores ghosts.
@ PISM_READONLY
open an existing file for reading only