IceCompModel Class Reference

#include <iceCompModel.hh>

Inheritance diagram for IceCompModel:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 IceCompModel (IceGrid &g, NCConfigVariable &config, NCConfigVariable &overrides, int mytest)
virtual ~IceCompModel ()
virtual PetscErrorCode set_grid_defaults ()
 Set default values of grid parameters.
virtual PetscErrorCode setFromOptions ()
 Read runtime (command line) options and alter the corresponding parameters or flags as appropriate.
virtual PetscErrorCode createVecs ()
 Allocate all IceModelVecs defined in IceModel.
virtual PetscErrorCode init_physics ()
 Initialize some physical parameters.
virtual PetscErrorCode set_vars_from_options ()
 Sets starting values of model state variables using command-line options.
PetscErrorCode reportErrors ()

Protected Member Functions

void mapcoords (const PetscInt i, const PetscInt j, PetscScalar &x, PetscScalar &y, PetscScalar &r)
virtual PetscErrorCode additionalAtStartTimestep ()
 Virtual. Does nothing in IceModel. Derived classes can do more computation in each time step.
virtual PetscErrorCode additionalAtEndTimestep ()
 Virtual. Does nothing in IceModel. Derived classes can do more computation in each time step.
PetscErrorCode computeGeometryErrors (PetscScalar &gvolexact, PetscScalar &gareaexact, PetscScalar &gdomeHexact, PetscScalar &volerr, PetscScalar &areaerr, PetscScalar &gmaxHerr, PetscScalar &gavHerr, PetscScalar &gmaxetaerr, PetscScalar &centerHerr)
virtual PetscErrorCode summary (bool tempAndAge, bool useHomoTemp)
PetscErrorCode initTestABCDEH ()
PetscErrorCode getCompSourcesTestCDH ()
PetscErrorCode fillSolnTestABCDH ()
PetscErrorCode fillSolnTestE ()
PetscErrorCode computeBasalVelocityErrors (PetscScalar &exactmaxspeed, PetscScalar &gmaxvecerr, PetscScalar &gavvecerr, PetscScalar &gmaxuberr, PetscScalar &gmaxvberr)
virtual PetscScalar basalVelocitySIA (PetscScalar x, PetscScalar y, PetscScalar H, PetscScalar T, PetscScalar alpha, PetscScalar mu, PetscScalar min_T) const
 Reimplement IceModel.basalVelocitySIA(), for Test E. Gives zero SIA-type sliding in other tests.
PetscErrorCode initTestL ()
PetscErrorCode fillSolnTestL ()
virtual PetscErrorCode temperatureStep (PetscScalar *vertSacrCount, PetscScalar *bulgeCount)
 Takes a semi-implicit time-step for the temperature equation.
PetscErrorCode initTestFG ()
PetscErrorCode getCompSourcesTestFG ()
PetscErrorCode fillSolnTestFG ()
PetscErrorCode computeTemperatureErrors (PetscScalar &gmaxTerr, PetscScalar &gavTerr)
PetscErrorCode computeBasalTemperatureErrors (PetscScalar &gmaxTerr, PetscScalar &gavTerr, PetscScalar &centerTerr)
PetscErrorCode computeSigmaErrors (PetscScalar &gmaxSigmaerr, PetscScalar &gavSigmaerr)
PetscErrorCode computeSurfaceVelocityErrors (PetscScalar &gmaxUerr, PetscScalar &gavUerr, PetscScalar &gmaxWerr, PetscScalar &gavWerr)
PetscErrorCode initTestK ()
PetscErrorCode fillSolnTestK ()
PetscErrorCode computeIceBedrockTemperatureErrors (PetscScalar &gmaxTerr, PetscScalar &gavTerr, PetscScalar &gmaxTberr, PetscScalar &gavTberr)

Protected Attributes

ThermoGlenArrIcetgaIce
PetscTruth exactOnly
int testname
IceModelVec2S vHexactL
IceModelVec3 SigmaComp3

Private Attributes

PetscScalar f
PetscTruth bedrock_is_ice_forK

Static Private Attributes

static const PetscScalar ablationRateOutside = 0.02
static const PetscScalar Ggeo = 0.042
static const PetscScalar ST = 1.67e-5
static const PetscScalar Tmin = 223.15
static const PetscScalar LforFG = 750000
static const PetscScalar ApforG = 200

Detailed Description

Definition at line 37 of file iceCompModel.hh.


Constructor & Destructor Documentation

IceCompModel ( IceGrid g,
NCConfigVariable config,
NCConfigVariable overrides,
int  mytest 
)
virtual ~IceCompModel (  )  [virtual]

Definition at line 41 of file iceCompModel.hh.


Member Function Documentation

PetscErrorCode additionalAtEndTimestep (  )  [protected, virtual]

Virtual. Does nothing in IceModel. Derived classes can do more computation in each time step.

Reimplemented from IceModel.

Definition at line 880 of file iceCompModel.cc.

References IceGrid.com, exactOnly, fillSolnTestABCDH(), fillSolnTestE(), fillSolnTestFG(), fillSolnTestK(), fillSolnTestL(), IceModel.grid, testname, and verbPrintf().

PetscErrorCode additionalAtStartTimestep (  )  [protected, virtual]

Virtual. Does nothing in IceModel. Derived classes can do more computation in each time step.

Reimplemented from IceModel.

Definition at line 849 of file iceCompModel.cc.

References IceGrid.com, IceModel.config, IceModel.dt_force, exactOnly, NCConfigVariable.get(), getCompSourcesTestCDH(), getCompSourcesTestFG(), IceModel.grid, secpera, testname, and verbPrintf().

PetscScalar basalVelocitySIA ( PetscScalar  x,
PetscScalar  y,
PetscScalar  H,
PetscScalar  T,
PetscScalar  alpha,
PetscScalar  mu,
PetscScalar  min_T 
) const [protected, virtual]

Reimplement IceModel.basalVelocitySIA(), for Test E. Gives zero SIA-type sliding in other tests.

Reimplemented from IceModel.

Definition at line 329 of file iceCompModel.cc.

References pi, IceFlowLaw.rho, IceModel.standard_gravity, testname, tgaIce, x, and y.

PetscErrorCode computeBasalTemperatureErrors ( PetscScalar &  gmaxTerr,
PetscScalar &  gavTerr,
PetscScalar &  centerTerr 
) [protected]
PetscErrorCode computeBasalVelocityErrors ( PetscScalar &  exactmaxspeed,
PetscScalar &  gmaxvecerr,
PetscScalar &  gavvecerr,
PetscScalar &  gmaxuberr,
PetscScalar &  gmaxvberr 
) [protected]
PetscErrorCode computeGeometryErrors ( PetscScalar &  gvolexact,
PetscScalar &  gareaexact,
PetscScalar &  gdomeHexact,
PetscScalar &  volerr,
PetscScalar &  areaerr,
PetscScalar &  gmaxHerr,
PetscScalar &  gavHerr,
PetscScalar &  gmaxetaerr,
PetscScalar &  centerHerr 
) [protected]
PetscErrorCode computeIceBedrockTemperatureErrors ( PetscScalar &  gmaxTerr,
PetscScalar &  gavTerr,
PetscScalar &  gmaxTberr,
PetscScalar &  gavTberr 
) [protected]
PetscErrorCode computeSigmaErrors ( PetscScalar &  gmaxSigmaerr,
PetscScalar &  gavSigmaerr 
) [protected]
PetscErrorCode computeSurfaceVelocityErrors ( PetscScalar &  gmaxUerr,
PetscScalar &  gavUerr,
PetscScalar &  gmaxWerr,
PetscScalar &  gavWerr 
) [protected]
PetscErrorCode computeTemperatureErrors ( PetscScalar &  gmaxTerr,
PetscScalar &  gavTerr 
) [protected]
PetscErrorCode createVecs (  )  [virtual]

Allocate all IceModelVecs defined in IceModel.

This procedure allocates the memory used to store model state, diagnostic and work vectors and sets metadata.

Default values should not be set here; please use set_vars_from_options().

All the memory allocated here is freed by IceModelVecs' destructors.

Reimplemented from IceModel.

Definition at line 71 of file iceCompModel.cc.

References IceModel.acab, IceModel.artm, IceModelVec3.create(), IceModelVec2S.create(), IceModel.grid, IceModelVec.set_attr(), IceModelVec.set_attrs(), SigmaComp3, and vHexactL.

PetscErrorCode fillSolnTestABCDH (  )  [protected]
PetscErrorCode fillSolnTestE (  )  [protected]
PetscErrorCode fillSolnTestFG (  )  [protected]
PetscErrorCode fillSolnTestK (  )  [protected]
PetscErrorCode fillSolnTestL (  )  [protected]
PetscErrorCode getCompSourcesTestCDH (  )  [protected]
PetscErrorCode getCompSourcesTestFG (  )  [protected]
PetscErrorCode init_physics (  )  [virtual]

Initialize some physical parameters.

This is the place for all non-trivial initialization of physical parameters. ("Non-trivial" means that the initialization requires more than just setting a value of a parameter. Such trivial changes can go here too, or earlier.) Also, this is the good place to set those parameters that a user should not be able to override using a command-line option.

This method is called after memory allocation but before filling any of IceModelVecs because all the physical parameters should be initialized before setting up the coupling or filling model-state variables.

In the base class IceModel we just initialize the IceFlowLaw and the EnthalpyConverter.

Reimplemented from IceModel.

Definition at line 205 of file iceCompModel.cc.

References bedrock_is_ice_forK, IceFlowLaw.c_p, IceGrid.com, IceModel.config, IceModel.EC, f, NCConfigVariable.get(), NCConfigVariable.get_string(), IceModel.grid, IceModel.ice, ICE_ARR, IceModel.iceFactory, IceFlowLawIsPatersonBuddCold(), IceFlowLaw.k, PISMOptionsIsSet(), IceFlowLaw.rho, NCVariable.set(), IceFlowLawFactory.setType(), testname, tgaIce, and verbPrintf().

PetscErrorCode initTestABCDEH (  )  [protected]
PetscErrorCode initTestFG (  )  [protected]
PetscErrorCode initTestK (  )  [protected]
PetscErrorCode initTestL (  )  [protected]
void mapcoords ( const PetscInt  i,
const PetscInt  j,
PetscScalar &  x,
PetscScalar &  y,
PetscScalar &  r 
) [protected]
PetscErrorCode reportErrors (  ) 
PetscErrorCode set_grid_defaults (  )  [virtual]

Set default values of grid parameters.

Derived classes (IceCompModel, for example) reimplement this to change the grid initialization when no -i option is set.

Reimplemented from IceModel.

Definition at line 91 of file iceCompModel.cc.

References IceGrid.bed_vertical_spacing, IceGrid.com, EQUAL, IceModel.grid, IceGrid.ice_vertical_spacing, IceGrid.Lbz, IceGrid.Lx, IceGrid.Ly, IceGrid.Lz, IceGrid.Mbz, IceGrid.periodicity, QUADRATIC, testname, and XY_PERIODIC.

PetscErrorCode set_vars_from_options (  )  [virtual]

Sets starting values of model state variables using command-line options.

Sets starting values of model state variables using command-line options and (possibly) a bootstrapping file.

In the base class there is only one case: bootstrapping.

Reimplemented from IceModel.

Definition at line 270 of file iceCompModel.cc.

References IceGrid.com, IceModel.config, NCConfigVariable.get(), IceModel.grid, initTestABCDEH(), initTestFG(), initTestK(), initTestL(), IceModelVec.set(), IceModel.setEnth3FromT3_ColdIce(), SigmaComp3, stop_if_set(), testname, IceModel.vbmr, verbPrintf(), IceModel.vHmelt, IceModel.vtillphi, and IceModel.vuplift.

PetscErrorCode setFromOptions (  )  [virtual]

Read runtime (command line) options and alter the corresponding parameters or flags as appropriate.

A critical principle of this procedure is that it will not alter IceModel parameters and flags unless the user sets an option to do so. Thus this base class setFromOptions() can be called by a derived class after the derived class has set its own defaults for base class parameters and flags.

Also, this procedure should not allocate memory or create new objects using the new operator.

In fact this procedure only reads the majority of the options. Some are read in initFromOptions(), writeFiles(), and setStartRunEndYearsFromOptions(), among other places.

Note there are no options to directly set dx, dy, dz, Lbz, and year as the user should not directly set these grid parameters. There are, however, options for directly setting Mx, My, Mz, Mbz and also Lx, Ly, Lz.

Note that additional options are read by PISM{Atmosphere|Surface|Ocean}Model instances, including -pdd... and -d?forcing options.

Reimplemented from IceModel.

Definition at line 145 of file iceCompModel.cc.

References IceModel.allowAboveMelting, IceGrid.com, IceModel.config, exactOnly, IceModel.grid, PISMOptionsIsSet(), IceModel.reportPATemps, NCVariable.set(), NCConfigVariable.set_flag(), NCVariable.set_string(), testname, and verbPrintf().

PetscErrorCode summary ( bool  tempAndAge,
bool  useHomoTemp 
) [protected, virtual]

Reimplemented from IceModel.

Definition at line 929 of file iceCompModel.cc.

PetscErrorCode temperatureStep ( PetscScalar *  vertSacrCount,
PetscScalar *  bulgeCount 
) [protected, virtual]

Takes a semi-implicit time-step for the temperature equation.

This method should be kept because it is worth having alternative physics, and so that older results can be reproduced. In particular, this method is documented by papers [BBL,BBssasliding]. The new browser page BOMBPROOF, PISM's numerical scheme for conservation of energy essentially documents the cold-ice-BOMBPROOF method here, but the newer enthalpy-based method is slightly different and (we hope) a superior implementation of the conservation of energy principle.

The conservation of energy equation written in terms of temperature is

\[ \rho c_p(T) \frac{dT}{dt} = k \frac{\partial^2 T}{\partial z^2} + \Sigma,\]

where $T(t,x,y,z)$ is the temperature of the ice. This equation is the shallow approximation of the full 3D conservation of energy. Note $dT/dt$ stands for the material derivative, so advection is included. Here $\rho$ is the density of ice, $c_p$ is its specific heat, and $k$ is its conductivity. Also $\Sigma$ is the volume strain heating (with SI units of $J/(\text{s} \text{m}^3) = \text{W}\,\text{m}^{-3}$).

We handle horizontal advection explicitly by first-order upwinding. We handle vertical advection implicitly by centered differencing when possible, and retreat to implicit first-order upwinding when necessary. There is a CFL condition for the horizontal explicit upwinding [MortonMayers]. We report any CFL violations, but they are designed to not occur.

The vertical conduction term is always handled implicitly (i.e. by backward Euler).

We work from the bottom of the column upward in building the system to solve (in the semi-implicit time-stepping scheme). The excess energy above pressure melting is converted to melt-water, and that a fraction of this melt water is transported to the ice base according to the scheme in excessToFromBasalMeltLayer().

The method uses equally-spaced calculation but the methods getValColumn(), setValColumn() interpolate back-and-forth from this equally-spaced calculational grid to the (usually) non-equally spaced storage grid.

An instance of tempSystemCtx is used to solve the tridiagonal system set-up here.

In this procedure four scalar fields are modified: vHmelt, vbmr, Tb3, and Tnew3. But vbmr and Tb3 will never need to communicate ghosted values (horizontal stencil neighbors). The ghosted values for T3 are updated from the values in Tnew3 in the communication done by energyStep(). There is a diffusion model for vHmelt in diffuseHmelt() which does communication for vHmelt.

The (older) scheme cold-ice-BOMBPROOF, implemented here, is very reliable, but there is still an extreme and rare fjord situation which causes trouble. For example, it occurs in one column of ice in one fjord perhaps only once in a 200ka simulation of the whole sheet, in my (ELB) experience modeling the Greenland ice sheet. It causes the discretized advection bulge to give temperatures below that of the coldest ice anywhere, a continuum impossibility. So as a final protection there is a "bulge limiter" which sets the temperature to the surface temperature of the column minus the bulge maximum (15 K) if it is below that level. The number of times this occurs is reported as a "BPbulge" percentage.

Reimplemented from IceModel.

Definition at line 33 of file iCMthermo.cc.

References IceModelVec.add(), IceModel.Sigma3, SigmaComp3, and testname.


Member Data Documentation

const PetscScalar ablationRateOutside = 0.02 [static, private]

Definition at line 117 of file iceCompModel.hh.

Referenced by fillSolnTestFG(), getCompSourcesTestFG(), and initTestFG().

const PetscScalar ApforG = 200 [static, private]
PetscTruth bedrock_is_ice_forK [private]
PetscTruth exactOnly [protected]
PetscScalar f [private]
const PetscScalar Ggeo = 0.042 [static, private]

Definition at line 120 of file iceCompModel.hh.

Referenced by initTestABCDEH(), initTestFG(), and initTestL().

const PetscScalar LforFG = 750000 [static, private]
IceModelVec3 SigmaComp3 [protected]
const PetscScalar ST = 1.67e-5 [static, private]

Definition at line 121 of file iceCompModel.hh.

Referenced by computeBasalTemperatureErrors(), fillSolnTestFG(), and initTestFG().

int testname [protected]
ThermoGlenArrIce* tgaIce [protected]
const PetscScalar Tmin = 223.15 [static, private]

Definition at line 122 of file iceCompModel.hh.

Referenced by computeBasalTemperatureErrors(), fillSolnTestFG(), and initTestFG().

IceModelVec2S vHexactL [protected]

Definition at line 84 of file iceCompModel.hh.

Referenced by computeGeometryErrors(), createVecs(), fillSolnTestL(), and initTestL().


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