pyissm.model.classes.initialization

class pyissm.model.classes.initialization(other=None)

Bases: manage_state

Initialization class for ISSM.

This class contains initial field values for various physical quantities in the ISSM framework. It provides storage for initial conditions of velocity, pressure, temperature, and other state variables that are used to initialize ice sheet model simulations.

Parameters:

other (any, optional) – Any other class object that contains common fields to inherit from. If values in other differ from default values, they will override the default values.

vx

x component of velocity [m/yr].

Type:

numpy.ndarray, default=nan

vy

y component of velocity [m/yr].

Type:

numpy.ndarray, default=nan

vz

z component of velocity [m/yr].

Type:

numpy.ndarray, default=nan

vel

velocity norm [m/yr].

Type:

numpy.ndarray, default=nan

pressure

pressure [Pa].

Type:

numpy.ndarray, default=nan

temperature

temperature [K].

Type:

numpy.ndarray, default=nan

enthalpy

enthalpy [J].

Type:

numpy.ndarray, default=nan

waterfraction

fraction of water in the ice.

Type:

numpy.ndarray, default=nan

sediment_head

sediment water head of subglacial system [m].

Type:

numpy.ndarray, default=nan

epl_head

epl water head of subglacial system [m].

Type:

numpy.ndarray, default=nan

epl_thickness

thickness of the epl [m].

Type:

numpy.ndarray, default=nan

watercolumn

thickness of subglacial water [m].

Type:

numpy.ndarray, default=nan

hydraulic_potential

Hydraulic potential (for GlaDS) [Pa].

Type:

numpy.ndarray, default=nan

channelarea

subglacial water channel area (for GlaDS) [m2].

Type:

numpy.ndarray, default=nan

sealevel

sea level [m].

Type:

numpy.ndarray, default=nan

bottompressure

bottom pressure [Pa].

Type:

numpy.ndarray, default=nan

dsl

dynamic sea level [m].

Type:

numpy.ndarray, default=nan

str

surface temperature rate [K/yr].

Type:

numpy.ndarray, default=nan

sample

Realization of a Gaussian random field.

Type:

numpy.ndarray, default=nan

debris

Surface debris layer [m].

Type:

numpy.ndarray, default=nan

age

Initial age [yr].

Type:

numpy.ndarray, default=nan

Examples

>>> md.initialization = pyissm.model.classes.initialization()
>>> md.initialization.vx = vx_initial
>>> md.initialization.vy = vy_initial
>>> md.initialization.temperature = temp_initial
__init__(other=None)

Initialize the instance with optional field inheritance.

Parameters:

other (object, optional) – Another instance to inherit field values from. If provided, any fields in the current instance that differ from the default values and exist in ‘other’ will be replaced with the values from ‘other’.

Notes

The inheritance process:

  1. Iterates through all attributes of the current instance

  2. Checks if the same attribute exists in the ‘other’ instance

  3. Compares field values using _fields_equal()

  4. If different, replaces the current value with the ‘other’ value

This enables the common ISSM pattern where classes can inherit configurations from existing instances while maintaining their default values for unspecified fields.

Methods

__init__([other])

Initialize the instance with optional field inheritance.

check_consistency(md, solution, analyses)

Check consistency of the [initialization] parameters.

issm_enum_string()

Default ISSM C++ enum string used during marshalling.

marshall_class(fid, prefix[, md])

Marshall [initialization.initialization] parameters to a binary file.

check_consistency(md, solution, analyses)

Check consistency of the [initialization] parameters.

Parameters:
  • md (pyissm.model.Model) – The model object to check.

  • solution (str) – The solution name to check.

  • analyses (list of str) – List of analyses to check consistency for.

Returns:

md – The model object with any consistency errors noted.

Return type:

pyissm.model.Model

marshall_class(fid, prefix, md=None)

Marshall [initialization.initialization] parameters to a binary file.

Parameters:
  • fid (file object) – The file object to write the binary data to.

  • prefix (str) – Prefix string used for data identification in the binary file.

  • md (pyissm.model.Model, optional) – ISSM model object needed in some cases.

Return type:

None