Skip to content

Commit

Permalink
make sure that melt_f limits are not exceeded in dynamic calibration (O…
Browse files Browse the repository at this point in the history
  • Loading branch information
pat-schmitt authored Feb 2, 2024
1 parent f899432 commit 5313d54
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions oggm/core/dynamic_spinup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1978,8 +1978,10 @@ def c_fun(melt_f):
def minimise_with_spline_fit(fct_to_minimise, melt_f_guess, mismatch):
# defines limits of melt_f in accordance to maximal allowed change
# between iterations
melt_f_limits = [melt_f_initial - melt_f_max_step_length,
melt_f_initial + melt_f_max_step_length]
melt_f_limits = [max(melt_f_initial - melt_f_max_step_length,
melt_f_min),
min(melt_f_initial + melt_f_max_step_length,
melt_f_max)]

# this two variables indicate that the limits were already adapted to
# avoid an error
Expand Down

0 comments on commit 5313d54

Please sign in to comment.