@@ -43,7 +43,8 @@ def run_dynamic_spinup(gdir, init_model_filesuffix=None, init_model_yr=None,
4343 store_model_evolution = True , ignore_errors = False ,
4444 return_t_spinup_best = False , ye = None ,
4545 model_flowline_filesuffix = '' ,
46- add_fixed_geometry_spinup = False , ** kwargs ):
46+ add_fixed_geometry_spinup = False , allow_calving = False ,
47+ ** kwargs ):
4748 """Dynamically spinup the glacier to match area or volume at the RGI date.
4849
4950 This task allows to do simulations in the recent past (before the glacier
@@ -195,6 +196,10 @@ def run_dynamic_spinup(gdir, init_model_filesuffix=None, init_model_yr=None,
195196 defined start year (could be defined through spinup_period or
196197 spinup_start_yr). Only has an effect if store_model_evolution is True.
197198 Default is False
199+ allow_calving : bool
200+ If True you can use the dynamic spinup with calving. So far this is not
201+ tested and you need to know what you are doing when switching it on.
202+ Default is False
198203 kwargs : dict
199204 kwargs to pass to the evolution_model instance
200205
@@ -301,8 +306,14 @@ def run_dynamic_spinup(gdir, init_model_filesuffix=None, init_model_yr=None,
301306 'dynamic spinup function!' )
302307
303308 if cfg .PARAMS ['use_kcalving_for_run' ]:
304- raise InvalidParamsError ('Dynamic spinup not tested with '
305- "cfg.PARAMS['use_kcalving_for_run'] is `True`!" )
309+ if allow_calving :
310+ log .warning ("You are using the dynamic spinup with calving, this "
311+ "is experimental and not tested!" )
312+ else :
313+ raise InvalidParamsError ('Dynamic spinup not tested with '
314+ "cfg.PARAMS['use_kcalving_for_run'] is "
315+ "`True`! If you know what you are doing "
316+ "you can set allow_calving=True!')" )
306317
307318 # this function saves a model without conducting a dynamic spinup, but with
308319 # the provided output_filesuffix, so following tasks can find it.
0 commit comments