OGGM / massbalance-sandbox

New generation of OGGM mass-balance models
BSD 3-Clause "New" or "Revised" License
6 stars 11 forks source link

Update test_hydro.py #11

Closed sarah-hanus closed 3 years ago

sarah-hanus commented 3 years ago

I added some tests, for example to test whether massbalance closes at each time step and not only at the end. Other tests are more difficult to provide for different glaciers as glacier behaviour differed. I ran the test for some other glaciers in the Alps than HEF and some tests failed (I commented these out and provided a comment). I added some test to check whether the overall behaviour seems correct when glacier area is declining. For the monthly run I added a test to see whether melt and liquid precipitation is larger in summer months than winter months. This is specific to European Alps.

Do you normally run the test in OGGM only with HEF and assume that then it is correct for other glaciers as well or do you run the tests for a set of different glaciers worldwide?

All tests pass for HEF, for some other glaciers assertions l.162, 163, 310 do not pass (e.g. RGI60-11.01346). So I am not sure whether these should maybe be omitted.

fmaussion commented 3 years ago

Do you normally run the test in OGGM only with HEF and assume that then it is correct for other glaciers as well or do you run the tests for a set of different glaciers worldwide?

This is a very tricky question, because the tests are a combination of what's feasible (time and data contraints) and completeness.

You may have found bugs in OGGM's run_with_hydro routine which can be reported upstream - if we need to add a glacier to the test suite to detect (and correct) a bug we should do it.

lilianschuster commented 3 years ago

Thanks a lot @sarah-hanus . It is very good that you added some tests for other glaciers. I will have a closer look at those tests that did not work and see if it is a bug in my code or if it is "ok" that they don't pass !

sarah-hanus commented 3 years ago

I think it is probably okay that they don't pass because, it is a more qualitative assessment, e.g. if the glacier is smaller at the end than at the beginning, also the melt on glacier at the end should be smaller than at the beginning. But these assessments are always tricky because they also depend on the precipitation and temperature input and are more difficult to generalize. It isnothing that has to be strictly fullfilled (like the massbalance). All the "strict" tests pass on the glaciers I tried.

fmaussion commented 3 years ago

I have seen issues in my regional runs, with some isolated months having negative off glacier melt contributions (small but still). It might be worth exploring, I haven't had the time to do so yet.