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

PDDrandMassBalance Class Reference

An alternative PDD implementation which simulates a random process to get the number of PDDs. More...

#include <localMassBalance.hh>

Inheritance diagram for PDDrandMassBalance:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 PDDrandMassBalance (const NCConfigVariable &myconfig, bool repeatable)
virtual ~PDDrandMassBalance ()
 repeatable==true to seed with zero every time.
virtual PetscErrorCode getNForTemperatureSeries (PetscScalar t, PetscScalar dt, PetscInt &N)
virtual PetscScalar getPDDSumFromTemperatureTimeSeries (PetscScalar pddStdDev, PetscScalar pddThresholdTemp, PetscScalar t, PetscScalar dt_series, PetscScalar *T, PetscInt N)
 Compute the expected number of positive degree days from the input temperature time-series.

Protected Attributes

gsl_rng * pddRandGen

Detailed Description

An alternative PDD implementation which simulates a random process to get the number of PDDs.

Uses a GSL random number generator. Significantly slower because new random numbers are generated for each grid point.

The way the number of positive degree-days are used to produce a surface mass balance is identical to the base class PDDMassBalance.

Note:
  • A more realistic pattern for the variability of surface melting might have correlation with appropriate spatial and temporal ranges.

Definition at line 162 of file localMassBalance.hh.


Constructor & Destructor Documentation

PDDrandMassBalance ( const NCConfigVariable &  myconfig,
bool  repeatable 
)

Initializes the random number generator (RNG). The RNG is GSL's recommended default, which seems to be "mt19937" and is DIEHARD (whatever that means ...). Seed with wall clock time in seconds in non-repeatable case, and with 0 in repeatable case.

Definition at line 248 of file localMassBalance.cc.

References pddRandGen.

~PDDrandMassBalance ( ) [virtual]

repeatable==true to seed with zero every time.

Definition at line 255 of file localMassBalance.cc.

References pddRandGen.


Member Function Documentation

PetscErrorCode getNForTemperatureSeries ( PetscScalar  t,
PetscScalar  dt,
PetscInt &  N 
) [virtual]

We need to compute simulated random temperature each actual day, or at least as close as we can reasonably get. Output N is number of days or number of days plus one.

Thus this method ignores config.get("pdd_max_temperature_evals_per_year"), which is used in the base class PDDMassBalance.

Implementation of getPDDSumFromTemperatureTimeSeries() requires returned N >= 2, so we guarantee that.

Reimplemented from PDDMassBalance.

Definition at line 274 of file localMassBalance.cc.

PetscScalar getPDDSumFromTemperatureTimeSeries ( PetscScalar  pddStdDev,
PetscScalar  pddThresholdTemp,
PetscScalar  t,
PetscScalar  dt_series,
PetscScalar *  T,
PetscInt  N 
) [virtual]

Compute the expected number of positive degree days from the input temperature time-series.

Reimplemented from PDDMassBalance.

Definition at line 283 of file localMassBalance.cc.

References pddRandGen.


Member Data Documentation

gsl_rng* pddRandGen [protected]

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