Carnot heat engine at maximum power output. Thermal exchanges with a fluid subject to periodic temperature variation