A robust and energy-conserving model of freezing variably-saturated soil