Cogeneration of cooling energy and fresh water