The effects of thermal pollution on river ice conditions. I, a general method of calculation