I am creating a snow and ice height time series. Once the snow (hsnow) has completely melted, the energy is used to melt ice (hice). I may be being stupid but I can't seem to find a way to prevent the snow height falling below 0 (as the energy that causes it to decrease past 0 would be used to decrease an ice layer).
Basically once the snow height falls below 0 I want to enforce it at 0 or prevent further decrement past 0, until the snowfall increases again.
hsnow(day+1) = hsnow(day) + snowfall(day) + dh_snow;
h_ice(day+1) = hice(day) + growth(day) + dh_ice;
(dh_snow and dh_ice are the amount of ice and snow melted per day based on the energy available.)
Thanks in advance for any help!