A charge air cooler comprising at least one tubular element with an internal flow duct for leading compressed air between an inlet aperture and an outlet aperture. A medium at a lower temperature than the compressed air is caused to flow in contact with an outside surface of the tubular element cooling the compressed air in the tubular element when the air is led through the flow duct. A movable control element is arranged close to the inlet aperture or the outlet aperture of the flow duct. A control for the control element provides a variable flow of compressed air through the flow duct as the movable control element is placed in various positions.