I suspect that you just didn't keep your Chlorine up high enough during the rains--with a CYA of 40, you need to keep your Cl above 3 all the time. Shocking it is the right course to take--you need to get your Cl up to about 15 ppm and keep it there, while running your filter 24/7, and it will clear, probably within a couple of days.

Janet