oggm.core.massbalance.SfcTypeTIModel

oggm.core.massbalance.SfcTypeTIModel#

class oggm.core.massbalance.SfcTypeTIModel(gdir, settings_filesuffix: str = '', use_leap_years: bool = True, mb_model_class=<class 'oggm.core.massbalance.MonthlyTIModel'>, climate_resolution: str = 'monthly', aging_frequency: str = 'monthly', melt_f_ratio: float = 0.5, melt_f_change: str = 'neg_exp', tau_e: float = 1.0, ys: int = None, spinup_years: int = 6, save_spinup_mbs: bool = True, spinup_buckets: ndarray = None, fl=None, use_main_fl_from: str = 'inversion_flowlines', hbins: ArrayLike = None, store_buckets: bool = False, store_buckets_dates: ArrayLike = None, use_previous_mbs: bool = False, store_snowline: bool = False, store_snowline_start_month: str = 'Oct', snow_density: float = 300, density_change: str = 'neg_exp', **kwargs)[source]#

Temperature-Index model with surface type distinction using a bucket system.

Adapted from OGGM/massbalance-sandbox and explained in Schuster et al. 2023.

__init__(gdir, settings_filesuffix: str = '', use_leap_years: bool = True, mb_model_class=<class 'oggm.core.massbalance.MonthlyTIModel'>, climate_resolution: str = 'monthly', aging_frequency: str = 'monthly', melt_f_ratio: float = 0.5, melt_f_change: str = 'neg_exp', tau_e: float = 1.0, ys: int = None, spinup_years: int = 6, save_spinup_mbs: bool = True, spinup_buckets: ndarray = None, fl=None, use_main_fl_from: str = 'inversion_flowlines', hbins: ArrayLike = None, store_buckets: bool = False, store_buckets_dates: ArrayLike = None, use_previous_mbs: bool = False, store_snowline: bool = False, store_snowline_start_month: str = 'Oct', snow_density: float = 300, density_change: str = 'neg_exp', **kwargs)[source]#

Surface type temperature index model.

Parameters:
gdirGlacierDirectory

The glacier directory.

settings_filesuffixstr, optional

append a suffix to the settings file (useful for sensitivity runs).

use_leap_yearsbool, default True

If the calendar should use leap years.

mb_model_classMassBalanceModel, default DailyTIModel

The MassBalanceModel to use together with surface type tracking. Options are DailyTIModel and MonthlyTIModel.

climate_resolutionstr, default ‘annual’

Temporal mass balance resolution. Options are ‘annaul’, ‘monthly’ and ‘daily’, but the mb_model_class need to be able to provide this resolution.

aging_frequencystr, default “annual”

Frequency at which the buckets are moved to the next one (= getting older). Options are “annual” or “monthly”. If annual, the model uses one snow and (spinup_years-1) firn buckets. If monthly, the snow ages over the number of months * spinup_years.

melt_f_ratiofloat, default 0.5

Ratio of snow melt factor to ice melt factor. Between 0 and 1, where 1 is no surface type distinction. Default 0.5 to match GloGEM.

melt_f_changestr, default “neg_exp”

How the snow melt factor changes relative to the ice melt factor, either “linear” or “neg_exp” (see tau_e for the equation).

tau_efloat, default 1

Only used if melt_f_change is ‘neg_exp’. It describes how fast the snow melt factor approximates to the ice melt factor via melt_f=melt_f_ice+(melt_f_snow-melt_f_ice)*np.exp(-time_yr/tau_e_fold_yr) Must be larger than zero to prevent melt_f being set to NaN in the first bucket.

ysint, default None

The initial year from where we want to get mb values. This means the bucket system is spun up so that at ys for the first time ice can form. For spinup the years ys - spinup_years up to ys are used. If None (the default), ys is not fixed at initialisation. Instead it is set the first time get_annual_mb, get_monthly_mb or get_daily_mb is called, using the first requested year (rounded down to the next integer year via np.floor), and the buckets are initialised at that point. Every call to reset_state resets ys back to None again, so it is re-derived on the next call. If ys is explicitly provided here, it is fixed and unaffected by reset_state.

spinup_yearsint, default 6

Number of spinup years. This defines the number of buckets we use (see aging_frequency for explanation). The minimum allowed value is 1 (corresponds to only having a snow bucket for aging_frequency=’annual’). The spinup ensures every bucket has the opportunity to be filled and ice can form at ys.

save_spinup_mbsbool, default False

If we want to safe the climatic mb and ice mb during the spinup period. This is mainly useful for testing.

spinup_bucketsnp.ndarray, default None

Instead of conducting a spinup of the buckets you can provide the initial buckets. It is assumed that these buckets are valid at the time ys.

fl: Flowline, default None

The flowline for defining the grid-points. If None, the flowline defined in use_main_fl_from is used. During all consecutive calls it is always checked the length of provided heights equals the length of the grid-points of the flowline.

use_main_fl_from: str, default ‘inversion_flowlines’

If the main flowline of ‘inversion_flowlines’ or ‘model_flowlines’ should be used. If fl is provided this is ignored.

hbins: ArrayLike, default None

Height bins for classifying surface types. Only needed for ConstantMBModel. Currently untested!

store_buckets: bool or str, default False

If buckets should be stored along the way. Options are ‘annual’, ‘monthly’, ‘daily’ or False.

store_buckets_dates: ArrayLike, default []

In addition to the frequency of when the buckets should be stored defined in store_buckets you can also provide a few selected dates where the buckets should be stored.

use_previous_mbs: bool, default False

If True, and you call get_annual_mb, get_monthly_mb or get_daily_mb it is checked if the desired year was already computed and return this values. In this case the provided heights will be ignored. This can be needed for some tasks (e.g. run_with_hydro), but the user should be aware that this behaviour is different than other mb_models work, because with surface tracking we have included a memory of the past. If False and you try to revisit a past year and error is raised.

store_snowline: bool, default False

Experimental: save the snowline in the climate_resolution. For this the lowest elevation where the bucket is not zero is set as the snowline. Older buckets are considered starting from store_snowline_start_month.

store_snowline_start_month: str, default ‘Oct’

Experimental: the start month of buckets used for the derivation of the snowline. E.g. with the default ‘Oct’, if you want to derive the snowline at Mar, all buckets starting from the previous Oct are considered.

snow_density: float, default 300

The assumed density of fresh snow.

density_change: str, default “neg_exp”

How the density from snow to firn to ice changes over time. The options “linear” or “neg_exp” (see tau_e for the equation) just mimik the implementations for melt_f (assuming a one to one relation between melt_f and density). This is currently experimental and needs further research.

**kwargs:

keyword arguments to pass to the mb_model_class

Methods

__init__(gdir, settings_filesuffix, ...[, ...])

Surface type temperature index model.

days_in_month(year)

Get the number of days of a month, with or without leap years, depending on self.use_leap_years.

days_in_year(year)

Get the number of days of a year, with or without leap years, depending on self.use_leap_years.

get_annual_mb(heights, year[, add_climate, ...])

Get annual climatic mass balance or the ice mass balance.

get_daily_mb(heights, year[, add_climate, ...])

Get daily climatic mass balance or the ice mass balance.

get_ela([year])

Get the equilibrium line altitude for a given year.

get_monthly_mb(heights, year[, add_climate, ...])

Get monthly climatic mass balance or the ice mass balance.

get_specific_mb([heights, widths, fls, ...])

Specific mass balance for a given glacier geometry.

is_year_valid(year)

Checks if a given date year be simulated by this model.

load_from_file(gdir[, filesuffix, group, ...])

Load a previously saved SfcTypeTIModel from a NetCDF file.

reset_state()

Reset any internal state of the model.

save_to_file([filesuffix])

Save the complete state of this model to a NetCDF file.

sec_in_month(year)

Get the seconds of the month, with or without leap years, depending on self.use_leap_years.

sec_in_year(year)

Get the seconds of the year, with or without leap years, depending on self.use_leap_years.

set_density_buckets()

Set the density for each bucket.

set_melt_f_buckets()

Set the melt factor for each bucket.

Attributes

buckets_thickness_m

climatic_mb

columns_mass_kg_per_sqm

columns_thickness_m

ice_mb

mb_buckets

mb_heights

melt_f

prcp_fac

Precipitation factor

snowline

snowline_year

temp_bias