Python adaption of the 3-stage glacier model (Roe and Baker, 2014)
When you first initialize a new glacier, you may need to modify the bed geometry to remove a positive slope at the top of the glacier. This may also require adjusting the initial thickness profile so the mass flux at the adjusted points is not too high in the first time steps.
Most likely, all the mass flows out of a grid cell, resulting in division by zero thickness on the next iteration. You may also have somewhere with a slope of zero that is not caught by the warnings.
- Reduce your timestep.
- Reduce it again.
- Play with some temperature values. A glacier should not melt at
T0 = 0
- Check your geometry for spots with zero slope (especially if you made modifications).
- Replace the initial thickness profile with a constant thin layer of ice.
- Find the index of the terminus in
h_init
- Use something like
h_init[:145] = 50
, where 145 is the terminus index and 50 is the thickness. Smaller values for thickness may help (you could even try growing from 0).
- Find the index of the terminus in
- Try a very short simulation (~100 yrs) with a very short timestep (e.g. 0.0125/64 or 0.0125/128).
- Disable numba on
space_loop()
and use a debugger. Place a breakpoint atreturn h, edge
and checkh
anddhdt
at each timestep.
Not enough time for mass flux. Decrease your timestep. You may be able to increase it again once you have a stable glacier profile.
If your glacier keeps retreating after reaching a specific length, check that it is not the edge of the domain.
If you have trouble getting the model to run at all for a tricky glacier but then find something that works, make sure you save the ice profile to use in the next run. Slowly adjusting parameters along with the ice profile is key to difficult initializations.
Look at the data in the model
object. You can see what is available with dir(model)
. Specifically, try looking at the thickness profile over time with a variable explorer (in Spyder or Pycharm, for example) pd.DataFrame(model.h)
. Don't forget, your temperature can be too low! Look at where the ELA is for a hint of what direction to go.
Initial calibrations using 100 or 500 year simulations can be surprisingly efficient. It does not take long to tell whether the glacier is growing or shrinking.
- Glacer length suddenly went to 0 during spike in cooling for a small glacier with a long timestep. All other metrics stayed normal. Thickness at the top of the glacier went to 0, so the entire glacier was a "detached tongue".
- Small sawtooth steps in length. During large accumulation years, area out in front of the glacier may retain enough ice to exceed the "is glacier" threshold.