PISM, A Parallel Ice Sheet Model
Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Attributes | List of all members
pism::IceModel Class Reference

#include <IceModel.hh>

+ Inheritance diagram for pism::IceModel:


struct  ThicknessChanges
struct  TimesteppingInfo

Public Member Functions

 IceModel (const IceGrid::Ptr &grid, const std::shared_ptr< Context > &context)
virtual ~IceModel ()
IceGrid::Ptr grid () const
 Return the grid used by this model. More...
std::shared_ptr< Contextctx () const
 Return the context this model is running in. More...
void init ()
 Manage the initialization of the IceModel object. More...
virtual void run ()
virtual void run_to (double run_end)
virtual void save_results ()
 Save model state in NetCDF format. More...
void list_diagnostics () const
void list_diagnostics_json () const
std::map< std::string, std::vector< VariableMetadata > > describe_diagnostics () const
std::map< std::string, std::vector< VariableMetadata > > describe_ts_diagnostics () const
const IceModelVec2Scalving () const
const IceModelVec2Sfrontal_melt () const
const IceModelVec2Sforced_retreat () const
double ice_volume_temperate (double thickness_threshold) const
 Computes the temperate ice volume, in m^3. More...
double ice_volume_cold (double thickness_threshold) const
 Computes the cold ice volume, in m^3. More...
double ice_area_temperate (double thickness_threshold) const
 Computes area of basal ice which is temperate, in m^2. More...
double ice_area_cold (double thickness_threshold) const
 Computes area of basal ice which is cold, in m^2. More...
const stressbalance::StressBalancestress_balance () const
const ocean::OceanModelocean_model () const
const frontalmelt::FrontalMeltfrontalmelt_model () const
const energy::BedThermalUnitbedrock_thermal_model () const
const energy::EnergyModelenergy_balance_model () const
const Geometrygeometry () const
const GeometryEvolutiongeometry_evolution () const
double dt () const

Protected Types

enum  HistoryTreatment { OVERWRITE_HISTORY = 0 , PREPEND_HISTORY }
enum  MappingTreatment { WRITE_MAPPING = 0 , SKIP_MAPPING }

Protected Member Functions

virtual void allocate_submodels ()
 Allocate PISM's sub-models implementing some physical processes. More...
virtual void allocate_stressbalance ()
 Decide which stress balance model to use. More...
virtual void allocate_age_model ()
virtual void allocate_bed_deformation ()
virtual void allocate_bedrock_thermal_unit ()
 Decide which bedrock thermal unit to use. More...
virtual void allocate_energy_model ()
virtual void allocate_subglacial_hydrology ()
 Decide which subglacial hydrology model to use. More...
virtual void allocate_basal_yield_stress ()
 Decide which basal yield stress model to use. More...
virtual void allocate_couplers ()
virtual void allocate_geometry_evolution ()
virtual void allocate_iceberg_remover ()
virtual stressbalance::Inputs stress_balance_inputs ()
virtual energy::Inputs energy_model_inputs ()
virtual YieldStressInputs yield_stress_inputs ()
virtual void time_setup ()
 Initialize time from an input file or command-line options. More...
virtual void model_state_setup ()
 Sets the starting values of model state variables. More...
virtual void misc_setup ()
 Miscellaneous initialization tasks plus tasks that need the fields that can come from regridding. More...
virtual void init_diagnostics ()
virtual void init_calving ()
 Initialize calving mechanisms. More...
virtual void init_frontal_melt ()
virtual void init_front_retreat ()
virtual void prune_diagnostics ()
virtual void update_diagnostics (double dt)
virtual void reset_diagnostics ()
virtual void step (bool do_mass_continuity, bool do_skip)
 The contents of the main PISM time-step. More...
virtual void pre_step_hook ()
 Virtual. Does nothing in IceModel. Derived classes can do more computation in each time step. More...
virtual void post_step_hook ()
 Virtual. Does nothing in IceModel. Derived classes can do more computation in each time step. More...
void reset_counters ()
virtual void bootstrap_2d (const File &input_file)
virtual void process_options ()
virtual std::set< std::string > output_variables (const std::string &keyword)
 Assembles a list of diagnostics corresponding to an output file size. More...
virtual void compute_lat_lon ()
virtual void restart_2d (const File &input_file, unsigned int record)
 Initialize 2D model state fields managed by IceModel from a file (for re-starting). More...
virtual void initialize_2d ()
virtual void save_variables (const File &file, OutputKind kind, const std::set< std::string > &variables, double time, IO_Type default_diagnostics_type=PISM_FLOAT)
virtual void define_model_state (const File &file)
virtual void write_model_state (const File &file)
virtual void write_metadata (const File &file, MappingTreatment mapping_flag, HistoryTreatment history_flag)
 Write time-independent metadata to a file. More...
virtual void write_mapping (const File &file)
virtual void write_run_stats (const File &file)
virtual void define_diagnostics (const File &file, const std::set< std::string > &variables, IO_Type default_type)
virtual void write_diagnostics (const File &file, const std::set< std::string > &variables)
 Writes variables listed in vars to filename, using nctype to write fields stored in dedicated IceModelVecs. More...
virtual void allocate_storage ()
 Allocate all IceModelVecs defined in IceModel. More...
virtual TimesteppingInfo max_timestep (unsigned int counter)
 Use various stability criteria to determine the time step for an evolution run. More...
virtual MaxTimestep max_timestep_diffusivity ()
 Compute the maximum time step allowed by the diffusive SIA. More...
virtual unsigned int skip_counter (double input_dt, double input_dt_diffusivity)
 Compute the skip counter using "long" (usually determined using the CFL stability criterion) and "short" (typically determined using the diffusivity-based stability criterion) time step lengths. More...
virtual void bedrock_thermal_model_step ()
virtual void energy_step ()
 Manage the solution of the energy equation, and related parallel communication. More...
virtual void hydrology_step ()
virtual void combine_basal_melt_rate (const Geometry &geometry, const IceModelVec2S &shelf_base_mass_flux, const IceModelVec2S &grounded_basal_melt_rate, IceModelVec2S &result)
 Combine basal melt rate in grounded and floating areas. More...
void enforce_consistency_of_geometry (ConsistencyFlag flag)
 Update the surface elevation and the flow-type mask when the geometry has changed. More...
virtual void front_retreat_step ()
void compute_geometry_change (const IceModelVec2S &thickness, const IceModelVec2S &Href, const IceModelVec2S &thickness_old, const IceModelVec2S &Href_old, bool add_values, IceModelVec2S &output)
virtual void regrid ()
 Manage regridding based on user options. More...
virtual void update_fracture_density ()
virtual double compute_temperate_base_fraction (double ice_area)
virtual double compute_original_ice_fraction (double ice_volume)
virtual void print_summary (bool tempAndAge)
virtual void print_summary_line (bool printPrototype, bool tempAndAge, double delta_t, double volume, double area, double meltfrac, double max_diffusivity)
 Print a line to stdout which summarizes the state of the modeled ice sheet at the end of the time step. More...
virtual int process_signals ()
 Catch signals -USR1, -USR2 and -TERM. More...
virtual void prepend_history (const std::string &string)
 Get time and user/host name and add it to the given string. More...
virtual void update_run_stats ()
void init_snapshots ()
 Initializes the snapshot-saving mechanism. More...
void write_snapshot ()
 Writes a snapshot of the model state (if necessary) More...
MaxTimestep save_max_timestep (double my_t)
 Computes the maximum time-step we can take and still hit all -save_times. More...
void init_timeseries ()
 Initializes the code writing scalar time-series. More...
void flush_timeseries ()
 Flush scalar time-series. More...
MaxTimestep ts_max_timestep (double my_t)
 Computes the maximum time-step we can take and still hit all -ts_times. More...
void init_extras ()
 Initialize the code saving spatially-variable diagnostic quantities. More...
void write_extras ()
 Write spatially-variable diagnostic quantities. More...
MaxTimestep extras_max_timestep (double my_t)
 Computes the maximum time-step we can take and still hit all -extra_times. More...
void init_backups ()
 Initialize the backup (snapshot-on-wallclock-time) mechanism. More...
void write_backup ()
 Write a backup (i.e. an intermediate result of a run). More...
virtual void update_viewers ()
 Update the runtime graphical viewers. More...
virtual void view_field (const IceModelVec *field)

Protected Attributes

const IceGrid::Ptr m_grid
 Computational grid. More...
const Config::Ptr m_config
 Configuration flags and parameters. More...
const std::shared_ptr< Contextm_ctx
 Execution context. More...
const units::System::Ptr m_sys
 Unit system. More...
const Logger::Ptr m_log
 Logger. More...
const Time::Ptr m_time
 Time manager. More...
const int m_wide_stencil
VariableMetadata m_output_global_attributes
 stores global attributes saved in a PISM output file More...
VariableMetadata m_run_stats
 run statistics More...
std::map< std::string, const Component * > m_submodels
 the list of sub-models, for writing model states and obtaining diagnostics More...
std::unique_ptr< hydrology::Hydrologym_subglacial_hydrology
std::shared_ptr< YieldStressm_basal_yield_stress_model
std::shared_ptr< IceModelVec2Tm_surface_input_for_hydrology
std::shared_ptr< AgeModelm_age_model
std::shared_ptr< calving::IcebergRemoverm_iceberg_remover
std::shared_ptr< calving::FloatKillm_float_kill_calving
std::shared_ptr< calving::CalvingAtThicknessm_thickness_threshold_calving
std::shared_ptr< calving::EigenCalvingm_eigen_calving
std::shared_ptr< calving::HayhurstCalvingm_hayhurst_calving
std::shared_ptr< calving::vonMisesCalvingm_vonmises_calving
std::shared_ptr< PrescribedRetreatm_prescribed_retreat
std::unique_ptr< ScalarForcingm_calving_rate_factor
std::shared_ptr< FrontRetreatm_front_retreat
std::shared_ptr< surface::SurfaceModelm_surface
std::shared_ptr< ocean::OceanModelm_ocean
std::shared_ptr< frontalmelt::FrontalMeltm_frontal_melt
std::shared_ptr< ocean::sea_level::SeaLevelm_sea_level
std::shared_ptr< bed::BedDefm_beddef
Geometry m_geometry
std::unique_ptr< GeometryEvolutionm_geometry_evolution
bool m_new_bed_elevation
IceModelVec2S m_basal_yield_stress
 ghosted More...
IceModelVec2S m_basal_melt_rate
 rate of production of basal meltwater (ice-equivalent); no ghosts More...
IceModelVec2S m_bedtoptemp
 temperature at the top surface of the bedrock thermal layer More...
std::shared_ptr< FractureDensitym_fracture
IceModelVec2Int m_velocity_bc_mask
 mask to determine Dirichlet boundary locations for the sliding velocity More...
IceModelVec2V m_velocity_bc_values
 Dirichlet boundary velocities. More...
IceModelVec2Int m_ice_thickness_bc_mask
 Mask prescribing locations where ice thickness is held constant. More...
double m_dt
 mass continuity time step, s More...
double t_TempAge
 time of last update for enthalpy/temperature More...
double dt_TempAge
 enthalpy/temperature and age time-steps More...
unsigned int m_skip_countdown
std::string m_adaptive_timestep_reason
std::string m_stdout_flags
std::vector< std::shared_ptr< IceModelVec2S > > m_work2d
std::shared_ptr< stressbalance::StressBalancem_stress_balance
ThicknessChanges m_thickness_change
std::set< IceModelVec * > m_model_state
std::map< std::string, Diagnostic::Ptrm_diagnostics
 Requested spatially-variable diagnostics. More...
std::map< std::string, TSDiagnostic::Ptrm_ts_diagnostics
 Requested scalar diagnostics. More...
std::set< std::string > m_output_vars
std::string m_snapshots_filename
bool m_save_snapshots
bool m_snapshots_file_is_ready
bool m_split_snapshots
std::vector< double > m_snapshot_times
std::set< std::string > m_snapshot_vars
unsigned int m_current_snapshot
std::string m_ts_filename
 file to write scalar time-series to More...
std::shared_ptr< std::vector< double > > m_ts_times
 requested times for scalar time-series More...
std::set< std::string > m_ts_vars
bool m_save_extra
bool m_extra_file_is_ready
bool m_split_extra
std::string m_extra_filename
std::vector< double > m_extra_times
unsigned int m_next_extra
double m_last_extra
std::set< std::string > m_extra_vars
VariableMetadata m_extra_bounds
std::unique_ptr< Filem_extra_file
std::string m_backup_filename
double m_last_backup_time
std::set< std::string > m_backup_vars
double m_timestep_hit_multiples_last_time
std::map< std::string, std::vector< std::shared_ptr< petsc::Viewer > > > m_viewers

Static Protected Attributes

static const int m_n_work2d = 3

Private Attributes

VariableMetadata m_timestamp
double m_start_time

Detailed Description

The base class for PISM. Contains all essential variables, parameters, and flags for modelling an ice sheet.

Definition at line 111 of file IceModel.hh.

The documentation for this class was generated from the following files: