Skip to content

Commit

Permalink
delete make_compatible in run_until_and_store
Browse files Browse the repository at this point in the history
  • Loading branch information
pat-schmitt committed Apr 7, 2023
1 parent c134c2d commit 6b133cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 29 deletions.
18 changes: 3 additions & 15 deletions oggm/core/dynamic_spinup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def run_dynamic_spinup(gdir, init_model_filesuffix=None, init_model_yr=None,
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,
model_flowline_filesuffix='',
add_fixed_geometry_spinup=False, **kwargs):
"""Dynamically spinup the glacier to match area or volume at the RGI date.
Expand Down Expand Up @@ -180,14 +180,6 @@ def run_dynamic_spinup(gdir, init_model_filesuffix=None, init_model_yr=None,
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_compatible : bool
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.
Default is False
add_fixed_geometry_spinup : bool
If True and the original spinup_period must be shortened (due to
ice-free or out-of-boundary error) a fixed geometry spinup is added at
Expand Down Expand Up @@ -326,8 +318,7 @@ def save_model_without_dynamic_spinup():
yr_run,
geom_path=geom_path,
diag_path=diag_path,
fl_diag_path=fl_diag_path,
make_compatible=make_compatible)
fl_diag_path=fl_diag_path)

return model_dynamic_spinup_end

Expand Down Expand Up @@ -425,8 +416,7 @@ def run_model_with_spinup_to_rgi_date(t_bias):
diag_path=diag_path,
fl_diag_path=fl_diag_path,
dynamic_spinup_min_ice_thick=min_ice_thickness,
fixed_geometry_spinup_yr=fixed_geometry_spinup_yr,
make_compatible=make_compatible)
fixed_geometry_spinup_yr=fixed_geometry_spinup_yr)

# now we delete the min_h variable again if it was not
# included before (inplace)
Expand Down Expand Up @@ -1186,7 +1176,6 @@ def dynamic_melt_f_run_with_dynamic_spinup(
store_model_geometry=store_model_geometry,
store_fl_diagnostics=store_fl_diagnostics,
model_flowline_filesuffix=model_flowline_filesuffix,
make_compatible=True,
add_fixed_geometry_spinup=add_fixed_geometry_spinup,
**kwargs)
# save the temperature bias which was successful in the last iteration
Expand Down Expand Up @@ -1412,7 +1401,6 @@ def dynamic_melt_f_run_with_dynamic_spinup_fallback(
store_fl_diagnostics=store_fl_diagnostics,
ignore_errors=False,
ye=ye,
make_compatible=True,
add_fixed_geometry_spinup=add_fixed_geometry_spinup,
**kwargs)

Expand Down
14 changes: 0 additions & 14 deletions oggm/core/flowline.py
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,6 @@ def run_until_and_store(self, y1,
stop_criterion=None,
fixed_geometry_spinup_yr=None,
dynamic_spinup_min_ice_thick=None,
make_compatible=False
):
"""Runs the model and returns intermediate steps in xarray datasets.
Expand Down Expand Up @@ -992,13 +991,6 @@ def run_until_and_store(self, y1,
area or the total volume. This is useful to smooth out yearly
fluctuations when matching to observations. The names of this new
variables include the suffix _min_h (e.g. 'area_m2_min_h')
make_compatible : bool
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.
Returns
-------
geom_ds : xarray.Dataset or None
Expand Down Expand Up @@ -1161,12 +1153,6 @@ def run_until_and_store(self, y1,
desc = 'Part of the series which are spinup'
diag_ds['is_fixed_geometry_spinup'].attrs['description'] = desc
diag_ds['is_fixed_geometry_spinup'].attrs['unit'] = '-'
elif make_compatible:
is_spinup_time = np.full(len(monthly_time), False, dtype=bool)
diag_ds['is_fixed_geometry_spinup'] = ('time', is_spinup_time)
desc = 'Part of the series which are spinup'
diag_ds['is_fixed_geometry_spinup'].attrs['description'] = desc
diag_ds['is_fixed_geometry_spinup'].attrs['unit'] = '-'

fl_diag_dss = None
if do_fl_diag:
Expand Down

0 comments on commit 6b133cb

Please sign in to comment.