oggm.tasks.run_from_climate_data#
- oggm.tasks.run_from_climate_data(gdir, settings_filesuffix='', ys=None, ye=None, min_ys=None, max_ys=None, fixed_geometry_spinup_yr=None, store_monthly_step=False, store_model_geometry=None, store_fl_diagnostics=None, climate_filename='climate_historical', mb_model=None, mb_model_class=<class 'oggm.core.massbalance.MonthlyTIModel'>, climate_input_filesuffix=None, output_filesuffix=None, init_model_filesuffix=None, init_model_yr=None, init_model_fls=None, zero_initial_glacier=False, bias=0, temperature_bias=None, precipitation_factor=None, mb_diagnostics_filesuffix=None, save_mb_diagnostics_filesuffix=None, **kwargs)[source]#
Runs a glacier with climate input from e.g. CRU or a GCM.
This will initialize a
oggm.core.massbalance.MultipleFlowlineMassBalance, and run aoggm.core.flowline.flowline_model_run().- Parameters:
- gdir
oggm.GlacierDirectory the glacier directory to process
- settings_filesuffix: str
You can use a different set of settings by providing a filesuffix. This is useful for sensitivity experiments. Code-wise the settings_filesuffix is set in the @entity-task decorater.
- ysint
start year of the model run (default: from the glacier geometry date if init_model_filesuffix is None, else init_model_yr)
- yeint
end year of the model run (default: last year of the provided climate file)
- min_ysint
if you want to impose a minimum start year, regardless if the glacier inventory date is earlier (e.g. if climate data does not reach).
- max_ysint
if you want to impose a maximum start year, regardless if the glacier inventory date is later (e.g. if climate data does not reach).
- store_monthly_stepbool
whether to store the diagnostic data at a monthly time step or not (default is yearly)
- store_model_geometrybool
whether to store the full model geometry run file to disk or not. (new in OGGM v1.4.1: default is to follow cfg.PARAMS[‘store_model_geometry’])
- store_fl_diagnosticsbool
whether to store the model flowline diagnostics to disk or not. (default is to follow cfg.PARAMS[‘store_fl_diagnostics’])
- climate_filenamestr
name of the climate file, e.g. ‘climate_historical’ (default) or ‘gcm_data’
- mb_model
core.MassBalanceModel User-povided MassBalanceModel instance. Default is to use a mb_model_class instance (default MonthlyTIModel) together with the provided parameters climate_filename, bias and climate_input_filesuffix.
- mb_model_classMassBalanceModel class
the MassBalanceModel class to use, default is MonthlyTIModel
- climate_input_filesuffix: str
filesuffix for the input climate file
- output_filesuffixstr
for the output file
- init_model_filesuffixstr
if you want to start from a previous model run state. Can be combined with init_model_yr
- init_model_yrint
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
- zero_initial_glacierbool
if true, the ice thickness is set to zero before the simulation
- biasfloat
bias of the mb model (offset to add to the MB). Default is zero.
- temperature_biasfloat
add a bias to the temperature timeseries (note that this is added to any bias that the calibration decided is needed)
- precipitation_factor: float
multiply a factor to the precipitation time series (note that this factor is multiplied to any factor that was decided during calibration or by global parameters)
- fixed_geometry_spinup_yrint
if set to an integer, the model will artificially prolongate all outputs of run_until_and_store to encompass all time stamps starting from the chosen year. The only output affected are the glacier wide diagnostic files - all other outputs are set to constants during “spinup”
- mb_diagnostics_filesuffixstr, optional
if provided, the mass balance model is loaded from a previously saved
mb_diagnostics{mb_diagnostics_filesuffix}.ncfile viaMultipleFlowlineMassBalance.load_from_file()instead of being constructed from scratch.climate_filenameandclimate_input_filesuffixare forwarded so you can branch from a historical state into a new scenario. Ignored whenmb_modelis also provided.- save_mb_diagnostics_filesuffixstr, optional
if provided, the mass balance model state is saved to
mb_diagnostics{save_mb_diagnostics_filesuffix}.ncafter the run completes, viaMultipleFlowlineMassBalance.save_to_file(). Useful for saving a historical run before branching into multiple projection scenarios.- kwargsdict
kwargs to pass to the flowline_model_run task
- gdir
Notes
Files written to the glacier directory: