The file Weath.asm contains a system that executes at 18hz to smoothly make average_visibility_filtered = average_visibility. That is, the weather system automatically changes average_visibility when visibility conditions change. The average_visibility_filtered function changes slowly toward that value to give the "fog rolling in" effect.
The following example illustrates what happens when the system is executed (at 18hz).
average_visibility_filtered=average_visibility + (average_visibility_filtered-average_visibility)/16