Summary:

The article discusses the soil and snow layer temperature calculations in the Community Land Model (CLM). The key points are:

1. Phase Change Criteria:
   - Melting occurs when the soil layer temperature is above the freezing point (T_i^(n+1) > T_f) and there is ice present (w_ice,i > 0).
   - Freezing occurs when the soil layer temperature is below the freezing point (T_i^(n+1) < T_f) and there is liquid water present (w_liq,i > 0 or w_liq,i > w_liq,max,i).

2. Supercooled Soil Water:
   - The concept of supercooled soil water is adopted, where liquid water can coexist with ice below the freezing point, as described by the freezing point depression equation.

3. Energy Balance and Phase Change:
   - The excess or deficit of energy (H_i) required to change the temperature to the freezing point is determined.
   - The ice mass, liquid water content, and temperature of the soil layers are adjusted based on the energy balance.

4. Special Case: Snow Melt
   - When there is snow present but no explicit snow layers (snl=0), snow melt can occur in the top soil layer if the soil temperature is above the freezing point.
   - The snow mass, depth, and energy balance are updated accordingly.

5. Energy Conservation:
   - The solution for snow/soil temperatures conserves energy, ensuring that the sum of the ground heat flux, phase change energy, and energy change in the soil layers equals zero.

The article provides the detailed equations and algorithms used in the CLM to handle the phase change processes in the soil and snow layers.