|
PISM, A Parallel Ice Sheet Model stable 0.4.1779
|
A class defining a common interface for most PISM sub-models. More...
#include <PISMComponent.hh>

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 ®rid, int &start) |
| Finds PISM's input (-i or -boot_file) file using command-line options. | |
Protected Attributes | |
| IceGrid & | grid |
| const NCConfigVariable & | config |
A class defining a common interface for most PISM sub-models.
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.
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.
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:
Implement PISMComponent_TS::max_timestep() to affect PISM's adaptive time-stepping mechanism.
Definition at line 93 of file PISMComponent.hh.
| 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.
Adds more variable names to result (to let sub-models respect -o_size or -save_size).
Keyword can be one of "small", "medium" or "big".
Reimplemented in PISMBedThermalUnit, PISMStressBalance, SSA, PISMDefaultYieldStress, PISMConstantYieldStress, PAConstant, PAYearlyCycle, PAForcing, POConstant, POConstantPIK, PSDummy, PSSimple, PSConstant, PSTemperatureIndex, PSForceThickness, PSConstantPIK, PSElevation, PSExternal, PSExternal_ALR, PISMBedDef, PDirectForcing< PISMAtmosphereModel >, PDirectForcing< PISMSurfaceModel >, Modifier< PISMAtmosphereModel >, Modifier< PISMSurfaceModel >, and Modifier< PISMOceanModel >.
Definition at line 106 of file PISMComponent.hh.
Referenced by PSForceThickness::add_vars_to_output(), PSTemperatureIndex::add_vars_to_output(), PSSimple::add_vars_to_output(), PAForcing::add_vars_to_output(), PISMStressBalance::add_vars_to_output(), IceModel::set_output_size(), and writePCCStateAtTimes().
| virtual PetscErrorCode define_variables | ( | set< string > | , |
| const NCTool & | , | ||
| nc_type | |||
| ) | [inline, virtual] |
Defines requested couplings fields to file and/or asks an attached model to do so.
Reimplemented in PISMBedThermalUnit, SSA, PISMDefaultYieldStress, PISMConstantYieldStress, PAConstant, PAYearlyCycle, PAForcing, POConstant, POConstantPIK, PISMSurfaceModel, PSDummy, PSConstant, PSTemperatureIndex, PSForceThickness, PSConstantPIK, PSElevation, PSExternal, PISMBedDef, PDirectForcing< PISMAtmosphereModel >, PDirectForcing< PISMSurfaceModel >, Modifier< PISMAtmosphereModel >, Modifier< PISMSurfaceModel >, and Modifier< PISMOceanModel >.
Definition at line 110 of file PISMComponent.hh.
Referenced by PISMSurfaceModel::define_variables(), PAForcing::define_variables(), and IceModel::write_variables().
| 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.
| filename | name of the file found |
| regrid | specifies 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] |
Add pointers to available diagnostic quantities to a dictionary.
Reimplemented in PISMStressBalance, SIAFD, SSA, PISMDefaultYieldStress, PISMSurfaceModel, PSDummy, PSConstant, PSConstantPIK, PSElevation, PSExternal, Modifier< PISMAtmosphereModel >, Modifier< PISMSurfaceModel >, and Modifier< PISMOceanModel >.
Definition at line 120 of file PISMComponent.hh.
Referenced by PISMSurfaceModel::get_diagnostics(), PISMStressBalance::get_diagnostics(), and IceModel::init_diagnostics().
| virtual PetscErrorCode init | ( | PISMVars & | vars | ) | [pure virtual] |
Implemented in PISMBedThermalUnit, PISMStressBalance, ShallowStressBalance, SIA_Sliding, SIAFD, SSA, SSAFD, SSAFEM, SSB_Modifier, SSBM_Trivial, PISMDefaultYieldStress, PISMConstantYieldStress, PSDirectForcing, PADirectForcing, PSLapseRates, PALapseRates, PAConstant, PAYearlyCycle, PA_SeaRISE_Greenland, PAForcing, POConstant, POConstantPIK, PISMSurfaceModel, PSDummy, PSSimple, PSConstant, PSTemperatureIndex, PSForceThickness, PSConstantPIK, PSdTforcing, PAdTforcing, POdSLforcing, PSElevation, PSExternal, PSExternal_ALR, PISMBedDef, PBPointwiseIsostasy, PBLingleClark, PSTYieldStress, and PA_EISMINT_Greenland.
Referenced by POdSLforcing::init(), PAdTforcing::init(), PSSimple::init(), PISMSurfaceModel::init(), PALapseRates::init(), PAForcing::init(), IceModel::init_couplers(), main(), and IceModel::model_state_setup().
Writes requested couplings fields to file and/or asks an attached model to do so.
Reimplemented in PISMBedThermalUnit, PISMStressBalance, SSA, PISMDefaultYieldStress, PISMConstantYieldStress, PAConstant, PAYearlyCycle, PAForcing, POConstant, POConstantPIK, PISMSurfaceModel, PSDummy, PSConstant, PSTemperatureIndex, PSForceThickness, PSConstantPIK, PSElevation, PSExternal, PISMBedDef, PDirectForcing< PISMAtmosphereModel >, PDirectForcing< PISMSurfaceModel >, Modifier< PISMAtmosphereModel >, Modifier< PISMSurfaceModel >, and Modifier< PISMOceanModel >.
Definition at line 116 of file PISMComponent.hh.
Referenced by PISMSurfaceModel::write_variables(), PAForcing::write_variables(), PISMStressBalance::write_variables(), IceModel::write_variables(), and writePCCStateAtTimes().
const NCConfigVariable& config [protected] |
Definition at line 127 of file PISMComponent.hh.
Referenced by PBLingleClark::allocate(), SIAFD::allocate(), SSAFEM::allocate_fem(), SSAFD::assemble_matrix(), SSAFD::assemble_rhs(), PISMDefaultYieldStress::basal_material_yield_stress(), SIAFD::compute_diffusive_flux(), SSA::compute_driving_stress(), SSAFD::compute_nuH_staggered(), SSBM_Trivial::compute_sigma(), SIAFD::compute_sigma(), SIAFD::compute_surface_gradient(), SIA_Sliding::compute_surface_gradient(), POConstantPIK::init(), PSTemperatureIndex::init(), POConstant::init(), PAYearlyCycle::init(), PAForcing::init(), SSAFD::init(), SSA::init(), SIAFD::init(), SIA_Sliding::init(), PISMBedThermalUnit::init(), PISMDefaultYieldStress::init(), PISMConstantYieldStress::init(), PA_SeaRISE_Greenland::mean_precip(), PISMDefaultYieldStress::PISMDefaultYieldStress(), PSForceThickness::PSForceThickness(), PSTemperatureIndex::PSTemperatureIndex(), SSAFEM::setup(), POConstantPIK::shelf_base_mass_flux(), POConstant::shelf_base_mass_flux(), POConstantPIK::shelf_base_temperature(), POConstant::shelf_base_temperature(), SSAFEM::solve(), SSAFD::solve(), SSA::SSA(), PAYearlyCycle::temp_snapshot(), PBPointwiseIsostasy::update(), PBLingleClark::update(), PSTemperatureIndex::update(), PA_SeaRISE_Greenland::update(), SIAFD::update(), SIA_Sliding::update(), and PSTemperatureIndex::update_internal().
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().
1.7.3