PISM, A Parallel Ice Sheet Model stable 0.4.1779
Public Member Functions | Protected Member Functions | Protected Attributes

PISMComponent Class Reference

A class defining a common interface for most PISM sub-models. More...

#include <PISMComponent.hh>

Inheritance diagram for PISMComponent:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 PISMComponent (IceGrid &g, const NCConfigVariable &conf)
virtual ~PISMComponent ()
virtual PetscErrorCode init (PISMVars &vars)=0
virtual void add_vars_to_output (string, set< string > &)
 Adds more variable names to result (to let sub-models respect -o_size or -save_size).
virtual PetscErrorCode define_variables (set< string >, const NCTool &, nc_type)
virtual PetscErrorCode write_variables (set< string >, string)
virtual void get_diagnostics (map< string, PISMDiagnostic * > &)
 Add pointers to available diagnostic quantities to a dictionary.

Protected Member Functions

virtual PetscErrorCode find_pism_input (string &filename, bool &regrid, int &start)
 Finds PISM's input (-i or -boot_file) file using command-line options.

Protected Attributes

IceGrid & grid
const NCConfigVariable & config

Detailed Description

A class defining a common interface for most PISM sub-models.

PISM's model components and their interface

We've found that many sub-models in PISM share some tasks: they need to be "initialized", "updated", asked for diagnostic quantities, asked to write the model state...

PISMComponent and its derived classes were created to have a common interface for PISM sub-models, such as surface, atmosphere, ocean and bed deformation models.

There are two kinds of PISM's components:

The main difference is that diagnostic components do not need to know the model time to perform an update, while time-stepping ones need to know the time-step to update for (usually given as the t_years, dt_years pair defining the (t_years, t_years + dt_years) interval) and may impose restrictions on a time-step that is possible at a given time during a run.

Initialization

PISMComponent::init() should contain all the initialization code, preferably including memory-allocation. This makes it possible to separate the PISM initialization stage at which the choice of a sub-model is made from its own initialization, so we can avoid initializing a sub-model just to throw it away.

Many PISM sub-models read data from the same file the rest of PISM reads from. PISMComponent::find_pism_input() checks -i and -boot_file command-line options and simplifies finding this file.

Writing to an output file

A PISM component needs to implement the following I/O methods:

Why are all these methods needed? In PISM we separate defining and writing NetCDF variables because defining all the NetCDF variables before writing data is a lot faster than defining a variable, writing it, defining the second variable, etc. (See The NetCDF Users' Guide for a technical explanation.)

Within IceModel the following steps are done to write 2D and 3D fields to an output file:

Restricting time-steps

Implement PISMComponent_TS::max_timestep() to affect PISM's adaptive time-stepping mechanism.

Definition at line 93 of file PISMComponent.hh.


Constructor & Destructor Documentation

PISMComponent ( IceGrid &  g,
const NCConfigVariable &  conf 
) [inline]

Definition at line 95 of file PISMComponent.hh.

virtual ~PISMComponent ( ) [inline, virtual]

Definition at line 97 of file PISMComponent.hh.


Member Function Documentation

virtual void add_vars_to_output ( string  ,
set< string > &   
) [inline, virtual]
virtual PetscErrorCode define_variables ( set< string ,
const NCTool &  ,
nc_type   
) [inline, virtual]
PetscErrorCode find_pism_input ( string filename,
bool regrid,
int &  start 
) [protected, virtual]

Finds PISM's input (-i or -boot_file) file using command-line options.

This might be useful since coupling fields are usually in the file IceModel uses to initialize from.

Parameters:
filenamename of the file found
regridspecifies whether regridding is necessary
start"start" to use when reading from filename

Definition at line 26 of file PISMComponent.cc.

References grid, and vnreport::nc.

Referenced by PSExternal_ALR::init(), PSConstantPIK::init(), PSConstant::init(), PAYearlyCycle::init(), PAConstant::init(), PISMDefaultYieldStress::init(), and PISMConstantYieldStress::init().

virtual void get_diagnostics ( map< string, PISMDiagnostic * > &  ) [inline, virtual]
virtual PetscErrorCode init ( PISMVars &  vars) [pure virtual]
virtual PetscErrorCode write_variables ( set< string ,
string   
) [inline, virtual]

Member Data Documentation

const NCConfigVariable& config [protected]
IceGrid& grid [protected]

Definition at line 126 of file PISMComponent.hh.

Referenced by PBPointwiseIsostasy::allocate(), PBLingleClark::allocate(), SSB_Modifier::allocate(), SSA::allocate(), SIAFD::allocate(), SIA_Sliding::allocate(), ShallowStressBalance::allocate(), PISMStressBalance::allocate(), PISMBedThermalUnit::allocate(), PISMDefaultYieldStress::allocate(), PISMConstantYieldStress::allocate(), SSAFD::allocate_fd(), SSAFEM::allocate_fem(), SSAFEM_Forward::allocate_ksp(), SSAFEM_Forward::assemble_DomainNorm_matrix(), SSAFD::assemble_matrix(), SSAFD::assemble_rhs(), SSAFEM_Forward::assemble_T_rhs(), SSAFEM_Forward::assemble_TStarA_rhs(), SSAFEM_Forward::assemble_TStarB_rhs(), PISMDefaultYieldStress::basal_material_yield_stress(), PISMDefaultYieldStress::basal_water_pressure(), BTU_Verification::bootstrap(), BTU_Test::bootstrap(), PISMBedThermalUnit::bootstrap(), SIAFD::compute_3d_horizontal_velocity(), SSA::compute_basal_frictional_heating(), SSA::compute_D2(), SIAFD::compute_diffusive_flux(), SIAFD::compute_diffusivity(), SSA::compute_driving_stress(), SSAFD::compute_hardav_staggered(), SIAFD::compute_I(), SSAFEM::compute_local_function(), SSAFEM::compute_local_jacobian(), SSA::compute_maximum_velocity(), SSAFD::compute_nuH_norm(), SSAFD::compute_nuH_staggered(), SSA::compute_principal_strain_rates(), SSBM_Trivial::compute_sigma(), SIAFD::compute_sigma(), SIAFD::compute_surface_gradient(), SIA_Sliding::compute_surface_gradient(), PISMStressBalance::compute_vertical_velocity(), PBLingleClark::correct_topg(), SSAFEM_Forward::domainIP(), SSAFEM_Forward::domainIP_core(), find_pism_input(), SSA::get_diagnostics(), SIAFD::get_diagnostics(), PISMStressBalance::get_diagnostics(), PISMDefaultYieldStress::get_diagnostics(), PISMBedThermalUnit::get_upward_geothermal_flux(), SIAFD::grainSizeVostok(), PSElevation::ice_surface_mass_flux(), PSForceThickness::ice_surface_mass_flux(), PSElevation::ice_surface_temperature(), PSConstantPIK::ice_surface_temperature(), PA_EISMINT_Greenland::init(), PSTYieldStress::init(), PISMBedDef::init(), PBPointwiseIsostasy::init(), PBLingleClark::init(), PSExternal_ALR::init(), PSExternal::init(), PSElevation::init(), PSConstantPIK::init(), POdSLforcing::init(), PAdTforcing::init(), PSdTforcing::init(), POConstantPIK::init(), PSForceThickness::init(), PSTemperatureIndex::init(), PSConstant::init(), PSSimple::init(), POConstant::init(), PA_SeaRISE_Greenland::init(), PAYearlyCycle::init(), PALapseRates::init(), PSLapseRates::init(), PADirectForcing::init(), PSDirectForcing::init(), PAForcing::init(), PAConstant::init(), SSAFEM::init(), SSAFD::init(), SSA::init(), SIAFD::init(), PISMBedThermalUnit::init(), PISMDefaultYieldStress::init(), PISMConstantYieldStress::init(), PSTYieldStress::init_till_phi(), PAForcing::mean_annual_temp(), PAForcing::mean_precip(), PAdTforcing::PAdTforcing(), PBLingleClark::PBLingleClark(), PBPointwiseIsostasy::PBPointwiseIsostasy(), PISMBedDef::PISMBedDef(), PISMBedDef::pismbeddef_allocate(), PISMConstantYieldStress::PISMConstantYieldStress(), PISMDefaultYieldStress::PISMDefaultYieldStress(), POdSLforcing::POdSLforcing(), PSdTforcing::PSdTforcing(), SSAFEM_Forward::rangeIP_core(), PISMBedThermalUnit::regrid(), PISMDefaultYieldStress::regrid(), PISMConstantYieldStress::regrid(), PSExternal::run(), SSAFEM::setup(), POConstantPIK::shelf_base_mass_flux(), POConstantPIK::shelf_base_temperature(), POConstant::shelf_base_temperature(), SSAFEM::solve(), SSAFD::solve(), SSAFEM_Forward::solveF_core(), SSAFEM_Forward::solveT(), SSAFEM_Forward::solveTStar(), SSAFD::SSAFD(), SSAFEM::SSAFEM(), SIAFD::surface_gradient_eta(), SIA_Sliding::surface_gradient_eta(), SIAFD::surface_gradient_haseloff(), SIA_Sliding::surface_gradient_haseloff(), SIAFD::surface_gradient_mahaffy(), SIA_Sliding::surface_gradient_mahaffy(), PISMDefaultYieldStress::topg_to_phi(), PBLingleClark::transfer_from_proc0(), PBLingleClark::transfer_to_proc0(), PA_EISMINT_Greenland::update(), PBLingleClark::update(), PSExternal::update(), PSTemperatureIndex::update(), PA_SeaRISE_Greenland::update(), SSBM_Trivial::update(), SSA::update(), SIAFD::update(), SIA_Sliding::update(), PISMBedThermalUnit::update(), PSExternal::update_acab(), PSExternal_ALR::update_artm(), PSExternal::update_artm(), PSTemperatureIndex::update_internal(), SSAFD::update_nuH_viewers(), PSExternal::wait(), PSExternal::write_coupling_fields(), PSElevation::write_variables(), POConstantPIK::write_variables(), POConstant::write_variables(), PAYearlyCycle::write_variables(), PAForcing::write_variables(), PAConstant::write_variables(), SSAFD::writeSSAsystemMatlab(), PBLingleClark::~PBLingleClark(), PSExternal::~PSExternal(), SSA::~SSA(), and SSAFD::~SSAFD().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines