There are two elements that are hard-coded that will fail:
- mb_max_loss divides by 12
- t2_idx uses year and month as opposed to considering daily data
Suggested fix:
- use gdir.mbdata['nyears'] instead of hard-coding dividing by 12
- t2_idx can use the same format but instead of grabbing the value by the list using position [0] use position [-1] to ensure you get the last day of the month