PISMComponent Class Reference

An abstract class intended to simplify creating basic surface, snow, atmosphere, ocean... models for PISM. 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 PetscErrorCode max_timestep (PetscReal, PetscReal &dt_years)
 Reports the maximum time-step the model can take at t_years. Sets dt_years to -1 if any time-step is OK.
virtual PetscErrorCode write_model_state (PetscReal, PetscReal, string)
 Writes fields that were read from an input file and are necessary for restarting.
virtual PetscErrorCode write_diagnostic_fields (PetscReal, PetscReal, string)
 Updates the model and writes all the internal fields (for testing and debugging).
virtual PetscErrorCode write_fields (set< string >, PetscReal, PetscReal, string)
virtual PetscErrorCode update (PetscReal, PetscReal)
 Update a model, if necessary.

Protected Member Functions

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

Protected Attributes

IceGridgrid
const NCConfigVariableconfig
PetscReal t
 Last time used as an argument for the update() method.
PetscReal dt
 Lasr time-step used as an argument for the update() method.

Detailed Description

An abstract class intended to simplify creating basic surface, snow, atmosphere, ocean... models for PISM.

Definition at line 31 of file PISMComponent.hh.


Constructor & Destructor Documentation

PISMComponent ( IceGrid g,
const NCConfigVariable conf 
)

Definition at line 22 of file PISMComponent.cc.

References dt, and t.

virtual ~PISMComponent (  )  [virtual]

Definition at line 34 of file PISMComponent.hh.


Member Function Documentation

PetscErrorCode find_pism_input ( string &  filename,
LocalInterpCtx *&  lic,
bool &  regrid,
int &  start 
) [protected, virtual]

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

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

Parameters:
filename name of the file found
lic local interp. context
regrid specifies whether regridding is necessary
start "start" to use when reading from filename

Definition at line 32 of file PISMComponent.cc.

References NCTool.close(), IceGrid.com, NCTool.get_dim_length(), PISMIO.get_grid_info_2d(), grid, vnreport.nc, and NCTool.open_for_reading().

Referenced by PSConstant.init(), PAYearlyCycle.init(), PALapseRates.init(), and PAConstant.init().

virtual PetscErrorCode init ( PISMVars vars  )  [pure virtual]
virtual PetscErrorCode max_timestep ( PetscReal  ,
PetscReal &  dt_years 
) [virtual]

Reports the maximum time-step the model can take at t_years. Sets dt_years to -1 if any time-step is OK.

Reimplemented in PAForcing, and PSForceThickness.

Definition at line 40 of file PISMComponent.hh.

Referenced by PSForceThickness.max_timestep(), PAForcing.max_timestep(), and IceModel.step().

virtual PetscErrorCode update ( PetscReal  ,
PetscReal   
) [virtual]

Update a model, if necessary.

Reimplemented in PAYearlyCycle, PA_SeaRISE_Greenland, PAForcing, PSLocalMassBalance, PISMBedDef, PBPointwiseIsostasy, PBLingleClark, and PA_EISMINT_Greenland.

Definition at line 62 of file PISMComponent.hh.

Referenced by PSLocalMassBalance.update().

virtual PetscErrorCode write_diagnostic_fields ( PetscReal  ,
PetscReal  ,
string   
) [virtual]

Updates the model and writes all the internal fields (for testing and debugging).

Reimplemented in PAConstant, PAYearlyCycle, PAForcing, POForcing, PISMSurfaceModel, PSDummy, PSConstant, and PSForceThickness.

Definition at line 51 of file PISMComponent.hh.

Referenced by PISMSurfaceModel.write_diagnostic_fields(), PAForcing.write_diagnostic_fields(), and writePCCStateAtTimes().

virtual PetscErrorCode write_fields ( set< string >  ,
PetscReal  ,
PetscReal  ,
string   
) [virtual]

Writes requested couplings fields to file and/or asks an attached model to do so.

Reimplemented in PAConstant, PAYearlyCycle, PAForcing, PISMSurfaceModel, and PSDummy.

Definition at line 57 of file PISMComponent.hh.

Referenced by IceModel.write_extras(), PISMSurfaceModel.write_fields(), and PAForcing.write_fields().

virtual PetscErrorCode write_model_state ( PetscReal  ,
PetscReal  ,
string   
) [virtual]

Writes fields that were read from an input file and are necessary for restarting.

Reimplemented in PAConstant, PAYearlyCycle, PAForcing, PALapseRates, PISMSurfaceModel, PSDummy, PSConstant, and PSForceThickness.

Definition at line 45 of file PISMComponent.hh.

Referenced by IceModel.dumpToFile(), PISMSurfaceModel.write_model_state(), PAForcing.write_model_state(), and IceModel.write_snapshot().


Member Data Documentation

const NCConfigVariable& config [protected]
PetscReal dt [protected]
IceGrid& grid [protected]
PetscReal t [protected]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Defines
Generated by  doxygen 1.6.2-20100124