Germany has agreed to give South Africa a 200 million euro ($234 million) concessional climate loan to support investment in its power grid and renewable energy capacity.