An energy-conserving model of freezing variably-saturated soil