Skip to content

Commit

Permalink
add water_level to FileModel (#1450)
Browse files Browse the repository at this point in the history
* add water_level to FileModel

* PEP8 correction

* Also add fallback

Co-authored-by: Fabien Maussion <fabien.maussion@uibk.ac.at>
  • Loading branch information
juliaeis and fmaussion committed Sep 2, 2022
1 parent e09fa0d commit a60187f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions oggm/core/flowline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2137,10 +2137,12 @@ def __init__(self, path):
try:
with xr.open_dataset(path) as ds:
self._calving_m3_since_y0 = ds.calving_m3.values
self.water_level = ds.water_level
self.do_calving = True
except AttributeError:
self._calving_m3_since_y0 = 0
self.do_calving = False
self.water_level = 0

# time
self.reset_y0()
Expand Down

0 comments on commit a60187f

Please sign in to comment.