Skip to content

Commit

Permalink
make sure that melt_f limits are not exceeded in dynamic calibration
Browse files Browse the repository at this point in the history
  • Loading branch information
pat-schmitt committed Feb 2, 2024
1 parent 5f8a8c5 commit 0b82ca3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions oggm/core/dynamic_spinup.py
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 0b82ca3

Please sign in to comment.