pyissm.model.classes.timestepping
Classes
|
Adaptive time stepping configuration for ISSM transient simulations. |
|
Default fixed time stepping configuration for ISSM transient simulations. |
- class pyissm.model.classes.timestepping.adaptive(other=None)
Bases:
manage_stateAdaptive time stepping configuration for ISSM transient simulations.
This class configures adaptive time step parameters for transient ice sheet simulations. The time step size is automatically adjusted based on CFL (Courant-Friedrichs-Lewy) conditions to maintain numerical stability while optimizing computational efficiency.
- 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.
- start_time
Simulation starting time [yr].
- Type:
float, default=0.0
- final_time
Final time to stop the simulation [yr].
- Type:
float, default=100.0
- time_step_min
Minimum length of time steps [yr].
- Type:
float, default=0.01
- time_step_max
Maximum length of time steps [yr].
- Type:
float, default=10.0
- cfl_coefficient
Coefficient applied to CFL condition for time step calculation.
- Type:
float, default=0.5
- interp_forcing
Interpolate in time between requested forcing values (0 or 1).
- Type:
int, default=1
- average_forcing
Average in time if there are several forcing values between steps (0 or 1).
- Type:
int, default=0
- cycle_forcing
Cycle through forcing data (0 or 1).
- Type:
int, default=0
- coupling_time
Coupling time steps with ocean model [yr].
- Type:
float, default=0.0
- __init__(self, other=None)
Initializes the adaptive timestepping parameters, optionally inheriting from another instance.
- __repr__(self)
Returns a detailed string representation of the adaptive timestepping parameters.
- __str__(self)
Returns a short string identifying the class.
- marshall_class(self, fid, prefix, md=None)
Marshall parameters to a binary file
Notes
Adaptive time stepping automatically adjusts time step size based on the CFL condition: Δt ≤ CFL_coefficient × (grid_spacing / max_velocity)
This approach provides: - Numerical stability by respecting CFL limits - Computational efficiency by using larger steps when possible - Automatic handling of varying flow conditions
The time step is constrained between time_step_min and time_step_max to prevent excessively small or large time steps that could cause numerical issues.
CFL coefficient recommendations: - 0.5: Conservative, very stable (default) - 0.8-0.9: More aggressive, faster computation - >1.0: May cause instability
Examples
md.timestepping = pyissm.model.classes.timestepping.adaptive() md.timestepping.time_step_min = 0.001 md.timestepping.time_step_max = 5.0 md.timestepping.cfl_coefficient = 0.8
- check_consistency(md, solution, analyses)
Check consistency of the [timestepping.adaptive] 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:
- marshall_class(fid, prefix, md=None)
Marshall [timestepping.adaptive] 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
- class pyissm.model.classes.timestepping.default(other=None)
Bases:
manage_stateDefault fixed time stepping configuration for ISSM transient simulations.
This class configures fixed time step parameters for transient ice sheet simulations. It provides control over simulation duration, time step size, and forcing interpolation methods for consistent temporal evolution of the ice sheet system.
- 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.
- start_time
Simulation starting time [yr].
- Type:
float, default=0
- final_time
Final time to stop the simulation [yr].
- Type:
float, default=5
- time_step
Length of time steps [yr].
- Type:
float, default=0.5
- interp_forcing
Interpolate in time between requested forcing values (0 or 1).
- Type:
int, default=1
- average_forcing
Average in time if there are several forcing values between steps (0 or 1).
- Type:
int, default=0
- cycle_forcing
Cycle through forcing data (0 or 1).
- Type:
int, default=0
- coupling_time
Length of coupling time steps with ocean model [yr].
- Type:
float, default=0
- __init__(self, other=None)
Initializes the fixed timestepping parameters, optionally inheriting from another instance.
- __repr__(self)
Returns a detailed string representation of the timestepping parameters.
- __str__(self)
Returns a short string identifying the class.
- marshall_class(self, fid, prefix, md=None)
Marshall parameters to a binary file
Notes
Fixed time stepping uses constant time step intervals throughout the simulation. This approach provides predictable temporal resolution but may not be optimal for all simulation conditions.
Forcing interpolation options: - interp_forcing=1: Linear interpolation between forcing time points - average_forcing=1: Time averaging when multiple forcing values exist per step - cycle_forcing=1: Repeat forcing data cyclically
Examples
md.timestepping = pyissm.model.classes.timestepping.default() md.timestepping.start_time = 0 md.timestepping.final_time = 100 md.timestepping.time_step = 1.0
- check_consistency(md, solution, analyses)
Check consistency of the [timestepping.default] 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:
- marshall_class(fid, prefix, md=None)
Marshall [timestepping.default()] 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