oggm.tasks.run_dynamic_spinup#

oggm.tasks.run_dynamic_spinup(gdir, init_model_filesuffix=None, init_model_yr=None, init_model_fls=None, climate_input_filesuffix='', evolution_model=<class 'oggm.core.flowline.FluxBasedModel'>, mb_model_historical=None, mb_model_spinup=None, spinup_period=20, spinup_start_yr=None, min_spinup_period=10, spinup_start_yr_max=None, yr_rgi=None, minimise_for='area', precision_percent=1, precision_absolute=1, min_ice_thickness=None, first_guess_t_bias=-2, t_bias_max_step_length=2, maxiter=30, output_filesuffix='_dynamic_spinup', store_model_geometry=True, store_fl_diagnostics=None, store_model_evolution=True, ignore_errors=False, return_t_bias_best=False, ye=None, model_flowline_filesuffix='', make_compatible=False, **kwargs)[source]#

Dynamically spinup the glacier to match area or volume at the RGI date.

This task allows to do simulations in the recent past (before the glacier inventory date), when the state of the glacier was unknown. This is a very difficult task the longer further back in time one goes (see publications by Eis et al. for a theoretical background), but can work quite well for short periods. Note that the solution is not unique.

Parameters
gdiroggm.GlacierDirectory

the glacier directory to process

init_model_filesuffixstr or None

if you want to start from a previous model run state. This state should be at time yr_rgi_date.

init_model_yrint or None

the year of the initial run you want to start from. The default is to take the last year of the simulation.

init_model_fls[]

list of flowlines to use to initialise the model (the default is the present_time_glacier file from the glacier directory). Ignored if init_model_filesuffix is set

climate_input_filesuffixstr

filesuffix for the input climate file

evolution_model:class:oggm.core.FlowlineModel

which evolution model to use. Default: FluxBasedModel

mb_model_historicalcore.MassBalanceModel

User-povided MassBalanceModel instance for the historical run. Default is to use a PastMassBalance model together with the provided parameter climate_input_filesuffix.

mb_model_spinupcore.MassBalanceModel

User-povided MassBalanceModel instance for the spinup before the historical run. Default is to use a ConstantMassBalance model together with the provided parameter climate_input_filesuffix and during the period of spinup_start_yr until rgi_year (e.g. 1979 - 2000).

spinup_periodint

The period how long the spinup should run. Start date of historical run is defined “yr_rgi - spinup_period”. Minimum allowed value is 10. If the provided climate data starts at year later than (yr_rgi - spinup_period) the spinup_period is set to (yr_rgi - yr_climate_start). Caution if spinup_start_yr is set the spinup_period is ignored. Default is 20

spinup_start_yrint or None

The start year of the dynamic spinup. If the provided year is before the provided climate data starts the year of the climate data is used. If set it overrides the spinup_period. Default is None

min_spinup_periodint

If the dynamic spinup function fails with the initial ‘spinup_period’ a shorter period is tried. Here you can define the minimum period to try. Default is 10

spinup_start_yr_maxint or None

Possibility to provide a maximum year where the dynamic spinup must start from at least. If set, this overrides the min_spinup_period if yr_rgi - spinup_start_yr_max > min_spinup_period. Default is None

yr_rgiint

The rgi date, at which we want to match area or volume. If None, gdir.rgi_date + 1 is used (the default).

minimise_forstr

The variable we want to match at yr_rgi. Options are ‘area’ or ‘volume’. Default is ‘area’

precision_percentfloat

Gives the precision we want to match in percent. The algorithm makes sure that the resulting relative mismatch is smaller than precision_percent, but also that the absolute value is smaller than precision_absolute. Default is 1., meaning the difference must be within 1% of the given value (area or volume).

precision_absolutefloat

Gives an minimum absolute value to match. The algorithm makes sure that the resulting relative mismatch is smaller than precision_percent, but also that the absolute value is smaller than precision_absolute. The unit of precision_absolute depends on minimise_for (if ‘area’ in km2, if ‘volume’ in km3) Default is 1.

min_ice_thicknessfloat

Gives an minimum ice thickness for model grid points which are counted to the total model value. This could be useful to filter out seasonal ‘glacier growth’, as OGGM do not differentiate between snow and ice in the forward model run. Therefore you could see quite fast changes (spikes) in the time-evolution (especially visible in length and area). If you set this value to 0 the filtering can be switched off. Default is 10.

first_guess_t_biasfloat

The initial guess for the temperature bias for the spinup MassBalanceModel in °C. Default is -2.

t_bias_max_step_lengthfloat

Defines the maximums allowed change of t_bias between two iterations. Is needed to avoid to large changes. Default is 2.

maxiterint

Maximum number of minimisation iterations per spinup period. If reached and ‘ignore_errors=False’ an error is raised. Default is 30

output_filesuffixstr

for the output file

store_model_geometrybool

whether to store the full model geometry run file to disk or not. Default is True

store_fl_diagnosticsbool or None

whether to store the model flowline diagnostics to disk or not. Default is None

store_model_evolutionbool

if True the complete dynamic spinup run is saved (complete evolution of the model during the dynamic spinup), if False only the final model state after the dynamic spinup run is saved. (Hint: if store_model_evolution = True and ignore_errors = True and an Error during the dynamic spinup occurs the stored model evolution is only one year long) Default is True

ignore_errorsbool

If True the function saves the model without a dynamic spinup using the ‘output_filesuffix’, if an error during the dynamic spinup occurs. This is useful if you want to keep glaciers for the following tasks. Default is True

return_t_bias_bestbool

If True the used temperature bias for the spinup is returned in addition to the final model. If an error occurs and ignore_error=True, the returned value is np.nan. Default is False

yeint

end year of the model run, must be larger than yr_rgi. If nothing is given it is set to yr_rgi. It is not recommended to use it if only data until yr_rgi is needed for calibration as this increases the run time of each iteration during the iterative minimisation. Instead use run_from_climate_data afterwards and merge both outputs using merge_consecutive_run_outputs. Default is None

model_flowline_filesuffixstr

suffix to the model_flowlines filename to use (if no other flowlines are provided with init_model_filesuffix or init_model_fls). Default is ‘’

make_compatiblebool

if set to true this will add all variables to the resulting dataset so it could be combined with any other one. This is necessary if different spinup methods are used. For example if using the dynamic spinup and setting fixed geometry spinup as fallback, the variable ‘is_fixed_geometry_spinup’ must be added to the dynamic spinup so it is possible to compile both glaciers together.

kwargsdict

kwargs to pass to the evolution_model instance

Returns
oggm.core.flowline.evolution_model

The final dynamically spined-up model. Type depends on the selected evolution_model, by default a FluxBasedModel.

Notes

Files written to the glacier directory: