19 #include <gsl/gsl_math.h>
21 #include "pism/icemodel/IceEISModel.hh"
23 #include "pism/util/Context.hh"
24 #include "pism/util/Grid.hh"
26 #include "pism/coupler/ocean/Constant.hh"
27 #include "pism/coupler/ocean/Initialization.hh"
29 #include "pism/coupler/SeaLevel.hh"
30 #include "pism/coupler/ocean/sea_level/Initialization.hh"
32 #include "pism/coupler/surface/EISMINTII.hh"
33 #include "pism/coupler/surface/Initialization.hh"
35 #include "pism/earth/BedDef.hh"
40 std::shared_ptr<Context> context,
42 :
IceModel(
g, context), m_experiment(experiment) {
55 auto ocean = std::make_shared<ocean::Constant>(
m_grid);
61 auto sea_level = std::make_shared<ocean::sea_level::SeaLevel>(
m_grid);
71 auto grid = result.
grid();
78 dx61 = (2.0 *
L) / 60;
81 for (
auto p = grid->points(); p; p.next()) {
82 const int i = p.i(), j = p.j();
84 const double nsd = i * grid->dx(), ewd = j * grid->dy();
85 if ((nsd >= (27 - 1) * dx61) && (nsd <= (35 - 1) * dx61) &&
86 (ewd >= (31 - 1) * dx61) && (ewd <= (61 - 1) * dx61)) {
87 result(i,j) = 1000.0 -
std::max(0.0, slope * (ewd -
L) * cos(M_PI * (nsd -
L) / w));
98 auto grid = result.
grid();
100 const double slope = 250.0;
101 const double w = 150.0e3;
104 for (
auto p = grid->points(); p; p.next()) {
105 const int i = p.i(), j = p.j();
107 const double nsd = i * grid->dx(), ewd = j * grid->dy();
108 result(i,j) = fabs(slope * sin(M_PI * ewd / w) + slope * cos(M_PI * nsd / w));
115 "initializing variables from EISMINT II experiment %c formulas... \n",
149 "EISMINT II mode does not support bootstrapping");
High-level PISM I/O class.
array::Scalar1 sea_level_elevation
array::Scalar2 ice_thickness
array::Scalar2 bed_elevation
void bootstrap_2d(const File &input_file)
IceEISModel(std::shared_ptr< Grid > g, std::shared_ptr< Context > ctx, char experiment)
std::map< std::string, const Component * > m_submodels
the list of sub-models, for writing model states and obtaining diagnostics
std::shared_ptr< ocean::OceanModel > m_ocean
std::shared_ptr< surface::SurfaceModel > m_surface
const Logger::Ptr m_log
Logger.
std::shared_ptr< ocean::sea_level::SeaLevel > m_sea_level
const std::shared_ptr< Grid > m_grid
Computational grid.
std::shared_ptr< bed::BedDef > m_beddef
static RuntimeError formatted(const ErrorLocation &location, const char format[],...) __attribute__((format(printf
build a RuntimeError with a formatted message
Makes sure that we call begin_access() and end_access() for all accessed array::Arrays.
std::shared_ptr< const Grid > grid() const
void set(double c)
Result: v[j] <- c for all j.
#define PISM_ERROR_LOCATION
double max(const array::Scalar &input)
Finds maximum over all the values in an array::Scalar object. Ignores ghosts.
bool ocean(int M)
An ocean cell (floating ice or ice-free).
void generate_trough_topography(array::Scalar &result)
void generate_mound_topography(array::Scalar &result)