I gave up on trying to read your code. All the commented out code is NOT part of the problem. So, don't post it. DELETE THE COMMENTED OUT CODE.
Try making your arrays smaller. Try getting rid of some of them.
You do NOT need to store 120 values of wind speed to calculate a 2 minute average. The value that you calculate as the average is wrong. You add up 120 values, and then divide by 119. Why?