pyissm.model.classes.thermal

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

Bases: manage_state

Thermal solution parameters class for ISSM.

This class encapsulates parameters for configuring thermal simulations in the ISSM (Ice Sheet System Model) framework. It allows users to configure temperature constraints, stabilization methods, convergence criteria, and enthalpy formulations for solving the thermal evolution of ice sheets including temperate ice behavior.

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.

spctemperature

Temperature constraints (NaN means no constraint) [K].

Type:

ndarray, default=nan

penalty_threshold

Threshold to declare convergence of thermal solution.

Type:

float, default=0

stabilization

Stabilization method: 0=no, 1=artificial_diffusivity, 2=SUPG.

Type:

int, default=1

reltol

Relative tolerance criterion for convergence.

Type:

float, default=0.01

maxiter

Maximum number of non-linear iterations.

Type:

int, default=100

penalty_lock

Stabilize unstable thermal constraints that keep zigzagging after n iterations (0=no stabilization).

Type:

int, default=0

penalty_factor

Penalty factor for constraint stabilization.

Type:

int, default=3

isenthalpy

Use an enthalpy formulation to include temperate ice.

Type:

int, default=0

isdynamicbasalspc

Enable dynamic setting of basal forcing. Required for enthalpy formulation.

Type:

int, default=0

isdrainicecolumn

Whether waterfraction drainage is enabled for enthalpy formulation.

Type:

int, default=1

watercolumn_upperlimit

Upper limit of basal watercolumn for enthalpy formulation [m].

Type:

float, default=1000

fe

Finite Element type: ‘P1’ (default), ‘P1xP2’.

Type:

str, default=’P1’

requested_outputs

Additional outputs requested.

Type:

list, default=[‘default’]

__init__(self, other=None)

Initializes the thermal parameters, optionally inheriting from another instance.

__repr__(self)

Returns a detailed string representation of the thermal parameters.

__str__(self)

Returns a short string identifying the class.

process_outputs(self, md=None, return_default_outputs=False)

Process requested outputs, expanding ‘default’ to appropriate outputs.

marshall_class(self, fid, prefix, md=None)

Marshall parameters to a binary file

Examples

md.thermal = pyissm.model.classes.thermal() md.thermal.isenthalpy = 1 md.thermal.stabilization = 2 md.thermal.maxiter = 200 md.thermal.reltol = 0.001

__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 [thermal.thermal] parameters.

issm_enum_string()

Default ISSM C++ enum string used during marshalling.

marshall_class(fid, prefix[, md])

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

check_consistency(md, solution, analyses)

Check consistency of the [thermal.thermal] 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 [thermal.thermal] 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 (ISSM model object, optional.) – ISSM model object needed in some cases.

Return type:

None