PISM, A Parallel Ice Sheet Model 2.3.0-79cae578d committed by Constantine Khrulev on 2026-03-22
Loading...
Searching...
No Matches
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:

Classes

struct  ThicknessChanges
 
struct  TimesteppingInfo
 

Public Member Functions

 IceModel (std::shared_ptr< Grid > grid, const std::shared_ptr< Context > &context)
 
virtual ~IceModel ()
 
std::shared_ptr< Gridgrid () const
 Return the grid used by this model.
 
std::shared_ptr< Contextctx () const
 Return the context this model is running in.
 
void init (DiagnosticReport report_type=DIAG_NONE)
 Manage the initialization of the IceModel object.
 
IceModelTerminationReason run ()
 
IceModelTerminationReason run_to (double run_end)
 
void list_diagnostics (DiagnosticReport report_type) const
 
void write_final_output ()
 Save model state in NetCDF format.
 
const array::Scalarcalving () const
 
const array::Scalarfrontal_melt () const
 
const array::Scalarforced_retreat () const
 
const stressbalance::StressBalancestress_balance () const
 
const ocean::OceanModelocean_model () const
 
const energy::BedThermalUnitbedrock_thermal_model () const
 
const energy::EnergyModelenergy_balance_model () const
 
const YieldStressbasal_yield_stress_model () const
 
const bed::BedDefbed_deformation_model () const
 
void set_python_ocean_model (std::shared_ptr< ocean::PyOceanModel > model)
 
const Geometrygeometry () const
 
const GeometryEvolutiongeometry_evolution () const
 
double dt () const
 

Protected Types

enum  ConsistencyFlag { REMOVE_ICEBERGS , DONT_REMOVE_ICEBERGS }
 

Protected Member Functions

virtual void allocate_submodels ()
 Allocate PISM's sub-models implementing some physical processes.
 
virtual void allocate_stressbalance ()
 Decide which stress balance model to use.
 
virtual void allocate_age_model ()
 
virtual void allocate_isochrones ()
 
virtual void allocate_bed_deformation ()
 
virtual void allocate_bedrock_thermal_unit ()
 Decide which bedrock thermal unit to use.
 
virtual void allocate_energy_model ()
 
virtual void allocate_subglacial_hydrology ()
 Decide which subglacial hydrology model to use.
 
virtual void allocate_basal_yield_stress ()
 Decide which basal yield stress model to use.
 
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 model_state_setup (InputOptions input_options)
 Sets the starting values of model state variables.
 
virtual void misc_setup (InputOptions input_options, DiagnosticReport report_type)
 Miscellaneous initialization tasks plus tasks that need the fields that can come from regridding.
 
virtual void init_calving ()
 Initialize calving mechanisms.
 
virtual void init_frontal_melt ()
 
virtual void init_front_retreat ()
 
virtual void update_diagnostics (double t, double dt)
 
virtual std::map< std::string, Diagnostic::Ptrallocate_spatial_diagnostics ()
 
virtual std::map< std::string, TSDiagnostic::Ptrallocate_scalar_diagnostics ()
 
void deallocate_unused_diagnostics ()
 
void init_outputs (InputOptions options, DiagnosticReport report_type)
 
virtual std::set< std::string > output_variables (const std::string &keyword)
 Assembles a list of diagnostics corresponding to an output file size.
 
virtual std::set< VariableMetadatadiagnostic_variables (const std::set< std::string > &variable_names) const
 
virtual std::set< VariableMetadatastate_variables () const
 
std::set< VariableMetadatastate_variables_diagnostics (const std::set< std::string > &variable_names) const
 
std::set< VariableMetadatacommon_metadata () const
 
void init_final_output ()
 
virtual double step (bool do_mass_continuity, bool do_skip)
 The contents of the main PISM time-step.
 
virtual void pre_step_hook ()
 Virtual. Does nothing in IceModel. Derived classes can do more computation in each time step.
 
virtual void post_step_hook ()
 Virtual. Does nothing in IceModel. Derived classes can do more computation in each time step.
 
void reset_counters ()
 
virtual void bootstrap_2d (const File &input_file)
 
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).
 
virtual void initialize_2d ()
 
void define_time (const OutputFile &file, bool with_bounds=false) const
 
void define_variables (const OutputFile &file, const std::set< VariableMetadata > &variables) const
 
virtual void write_state (const OutputFile &file) const
 
void write_state_diagnostics (const OutputFile &file, const std::set< std::string > &variable_names) const
 
void write_run_stats (const OutputFile &file) const
 
void write_diagnostics (const OutputFile &file, const std::set< std::string > &variable_names) const
 Writes variables listed in variable_names to file.
 
std::string save_state_on_error (const std::string &suffix, const std::set< std::string > &additional_variables)
 
virtual void allocate_storage ()
 Allocate all Arrays defined in IceModel.
 
virtual TimesteppingInfo max_timestep (unsigned int counter)
 Use various stability criteria to determine the time step for an evolution run.
 
virtual MaxTimestep max_timestep_diffusivity ()
 Compute the maximum time step allowed by the diffusive SIA.
 
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.
 
virtual void bedrock_thermal_model_step (double t, double dt)
 
virtual void energy_step (double t, double dt)
 Manage the solution of the energy equation, and related parallel communication.
 
virtual void hydrology_step (double t, double dt)
 
virtual void combine_basal_melt_rate (const Geometry &geometry, const array::Scalar &shelf_base_mass_flux, const array::Scalar &grounded_basal_melt_rate, array::Scalar &result)
 Combine basal melt rate in grounded and floating areas.
 
void enforce_consistency_of_geometry (ConsistencyFlag flag)
 Update the surface elevation and the flow-type mask when the geometry has changed.
 
void identify_open_ocean (const array::CellType &cell_type, array::Scalar1 &result)
 
virtual void front_retreat_step (double t, double dt)
 
void compute_geometry_change (const array::Scalar &thickness, const array::Scalar &Href, const array::Scalar &thickness_old, const array::Scalar &Href_old, bool add_values, array::Scalar &output)
 
virtual void regrid ()
 Manage regridding based on user options.
 
virtual void update_fracture_density (double dt)
 
virtual double compute_temperate_base_fraction (double ice_area)
 
virtual double compute_original_ice_fraction (double ice_volume)
 
virtual void print_summary (bool tempAndAge, double dt)
 
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.
 
virtual int process_signals ()
 Catch signals -USR1, -USR2 and -TERM.
 
virtual void append_history (const std::string &string)
 Get time and user/host name and add it to the given string.
 
void init_snapshots ()
 Initializes the snapshot-saving mechanism.
 
void write_snapshot ()
 Writes a snapshot of the model state (if necessary)
 
MaxTimestep snapshots_max_timestep (double my_t)
 Computes the maximum time-step we can take and still hit all -save_times.
 
void init_scalar_diagnostics ()
 Initializes the code writing scalar time-series.
 
void scalar_diagnostics_flush_buffers ()
 Flush scalar time-series.
 
MaxTimestep scalar_diagnostics_max_timestep (double t)
 Computes the maximum time-step we can take and still hit all -scalar_times.
 
void init_spatial_diagnostics ()
 Initialize the code saving spatially-variable diagnostic quantities.
 
void write_spatial_diagnostics ()
 Write spatially-variable diagnostic quantities.
 
MaxTimestep spatial_diagnostics_max_timestep (double t)
 Computes the maximum time-step we can take and still hit all -spatial_times.
 
void init_checkpoints ()
 Initialize checkpointing (snapshot-on-wallclock-time) mechanism.
 
bool write_checkpoint ()
 Write a checkpoint (i.e. an intermediate result of a run).
 
virtual void update_viewers ()
 Update the runtime graphical viewers.
 
virtual void view_field (const array::Array *field)
 

Protected Attributes

std::string m_output_filename
 Name of the output file.
 
std::set< std::string > m_output_vars
 
std::set< VariableMetadatam_output_file_contents
 Set of variables that will be written to the output file.
 
const std::shared_ptr< Gridm_grid
 Computational grid.
 
std::shared_ptr< Configm_config
 Configuration flags and parameters.
 
std::shared_ptr< Contextm_ctx
 Execution context.
 
const units::System::Ptr m_sys
 Unit system.
 
std::shared_ptr< Loggerm_log
 Logger.
 
std::shared_ptr< Timem_time
 Time manager.
 
std::shared_ptr< OutputWriterm_output_writer
 
std::shared_ptr< OutputWriterm_snapshot_writer
 
std::shared_ptr< OutputWriterm_spatial_writer
 
VariableMetadata m_output_global_attributes
 stores global attributes saved in a PISM output file
 
std::string m_output_history
 
std::map< std::string, const Component * > m_submodels
 the list of sub-models, for writing model states and obtaining diagnostics
 
std::unique_ptr< hydrology::Hydrologym_subglacial_hydrology
 
std::shared_ptr< YieldStressm_basal_yield_stress_model
 
std::shared_ptr< array::Forcingm_surface_input_for_hydrology
 
std::shared_ptr< energy::BedThermalUnitm_btu
 
std::shared_ptr< energy::EnergyModelm_energy_model
 
std::shared_ptr< AgeModelm_age_model
 
std::shared_ptr< Isochronesm_isochrones
 
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
 
array::Scalar2 m_basal_yield_stress
 ghosted
 
array::Scalar m_basal_melt_rate
 rate of production of basal meltwater (ice-equivalent); no ghosts
 
array::Scalar m_bedtoptemp
 temperature at the top surface of the bedrock thermal layer
 
std::shared_ptr< FractureDensitym_fracture
 
array::Scalar2 m_velocity_bc_mask
 mask to determine Dirichlet boundary locations for the sliding velocity
 
array::Vector2 m_velocity_bc_values
 Dirichlet boundary velocities.
 
array::Scalar1 m_ice_thickness_bc_mask
 Mask prescribing locations where ice thickness is held constant.
 
double m_dt
 mass continuity time step, s
 
double m_t_TempAge
 time of last update for enthalpy/temperature
 
double m_dt_TempAge
 enthalpy/temperature and age time-steps
 
unsigned int m_skip_countdown
 
std::string m_adaptive_timestep_reason
 
std::string m_stdout_flags
 
unsigned int m_step_counter
 
std::vector< std::shared_ptr< array::Scalar2 > > m_work2d
 
std::shared_ptr< stressbalance::StressBalancem_stress_balance
 
ThicknessChanges m_thickness_change
 
std::set< array::Array * > m_model_state
 
std::map< std::string, Diagnostic::Ptrm_available_spatial_diagnostics
 Available spatially-variable diagnostics.
 
std::map< std::string, TSDiagnostic::Ptrm_available_scalar_diagnostics
 Available scalar diagnostics.
 
std::string m_snapshots_filename
 
std::shared_ptr< OutputFilem_snapshot_file
 
bool m_split_snapshots
 
std::vector< doublem_snapshot_times
 
unsigned int m_current_snapshot
 
std::set< std::string > m_snapshot_vars
 
std::set< VariableMetadatam_snapshot_file_contents
 set of variables that will be written to snapshot files
 
std::shared_ptr< OutputFilem_scalar_file
 file to write scalar time-series to
 
std::shared_ptr< std::vector< double > > m_scalar_times
 requested times for scalar time-series
 
std::set< std::string > m_scalar_vars
 
std::string m_spatial_filename
 
std::vector< doublem_spatial_times
 
unsigned int m_next_spatial_index
 
double m_last_spatial_time
 
std::set< std::string > m_spatial_vars
 
std::set< VariableMetadatam_spatial_file_contents
 set of variables that will be written to extra files
 
std::shared_ptr< OutputFilem_spatial_file
 
std::string m_checkpoint_filename
 
double m_last_checkpoint_time
 
std::set< std::string > m_checkpoint_vars
 
std::set< VariableMetadatam_checkpoint_file_contents
 set of variables that will be written to checkpoint files
 
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 = 4
 

Private Attributes

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 121 of file IceModel.hh.


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