21 #include "pism/util/IceGrid.hh"
22 #include "pism/coupler/util/options.hh"
23 #include "pism/util/io/io_helpers.hh"
24 #include "pism/geometry/Geometry.hh"
31 m_mass_flux_reference(m_grid,
"climatic_mass_balance",
WITHOUT_GHOSTS),
32 m_temperature_reference(m_grid,
"ice_surface_temp",
WITHOUT_GHOSTS),
44 "reference surface mass balance rate",
45 "kg m-2 s-1",
"kg m-2 year-1",
46 "land_ice_surface_specific_mass_balance_flux", 0);
48 auto smb_max =
m_config->get_number(
"surface.given.smb_max",
"kg m-2 second-1");
53 "reference surface altitude",
54 "m",
"m",
"surface_altitude", 0);
60 "reference temperature",
61 "Kelvin",
"Kelvin",
"", 0);
71 unsigned int buffer_size =
m_config->get_number(
"input.forcing.buffer_size");
78 "climatic_mass_balance_anomaly",
84 "surface mass balance rate anomaly",
85 "kg m-2 s-1",
"kg m-2 year-1",
93 "climatic_mass_balance_gradient",
99 "surface mass balance rate elevation lapse rate",
100 "kg m-2 s-1 m-1",
"kg m-2 year-1 m-1",
107 "ice_surface_temp_anomaly",
113 "ice surface temperature anomaly",
114 "Kelvin",
"Kelvin",
"", 0);
120 "ice_surface_temp_gradient",
126 "ice surface temperature elevation lapse rate",
127 "Kelvin m-1",
"Kelvin m-1",
"", 0);
136 m_log->message(2,
"* Initializing the ISMIP6 surface model...\n");
140 auto reference_filename =
m_config->get_string(
"surface.ismip6.reference_file");
193 &
SMB, &SMB_ref, &aSMB, &dSMBdz,
194 &T, &T_ref, &aT, &dTdz};
197 const int i = p.i(), j = p.j();
199 SMB(i, j) = SMB_ref(i, j) + aSMB(i, j) + dSMBdz(i, j) * (h(i, j) - h_ref(i, j));
200 T(i, j) = T_ref(i, j) + aT(i, j) + dTdz(i, j) * (h(i, j) - h_ref(i, j));
Makes sure that we call begin_access() and end_access() for all accessed IceModelVecs.
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.
IceModelVec2S ice_surface_elevation
std::shared_ptr< const IceGrid > ConstPtr
static std::shared_ptr< IceModelVec2T > ForcingField(IceGrid::ConstPtr grid, const File &file, const std::string &short_name, const std::string &standard_name, int max_buffer_size, bool periodic, InterpolationType interpolation_type=PIECEWISE_CONSTANT)
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.
A class for storing and accessing 2D time-series (for climate forcing)
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_time_independent(bool flag)
Set the time independent flag for all variables corresponding to this IceModelVec instance.
Combines the max. time step with the flag indicating if a restriction is active. Makes is possible to...
const IceModelVec2S & runoff_impl() const
std::shared_ptr< IceModelVec2T > m_temperature_anomaly
IceModelVec2S m_temperature_reference
std::shared_ptr< IceModelVec2T > m_temperature_gradient
const IceModelVec2S & mass_flux_impl() const
const IceModelVec2S & temperature_impl() const
void update_impl(const Geometry &geometry, double t, double dt)
std::shared_ptr< IceModelVec2T > m_mass_flux_anomaly
std::shared_ptr< IceModelVec2T > m_mass_flux_gradient
void init_impl(const Geometry &geometry)
IceModelVec2S m_surface_reference
MaxTimestep max_timestep_impl(double t) const
const IceModelVec2S & melt_impl() const
IceModelVec2S::Ptr m_mass_flux
ISMIP6(IceGrid::ConstPtr g, std::shared_ptr< atmosphere::AtmosphereModel > input)
IceModelVec2S::Ptr m_temperature
IceModelVec2S m_mass_flux_reference
const IceModelVec2S & accumulation_impl() const
static IceModelVec2S::Ptr allocate_mass_flux(IceGrid::ConstPtr grid)
IceModelVec2S::Ptr m_melt
IceModelVec2S::Ptr m_accumulation
static IceModelVec2S::Ptr allocate_temperature(IceGrid::ConstPtr grid)
void dummy_accumulation(const IceModelVec2S &smb, IceModelVec2S &result)
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.
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