THERMODYNAMICS OF RARE EARTH--CARBON SYSTEMS.