Since your water is not clear, you're going to want to follow the
SLAM Process. For your CYA of 40, SLAM level chlorine is 16ppm, as shown on the
FC/CYA Levels. That means you're going to want to dose manually with chlorine to get your pool up to 16ppm, and test as often as practical (but at least a few times each day) to ensure you're keeping the level there. When the pool looks clear and you think you're winning the battle, then it's time to do an
Overnight Chlorine Loss Test to confirm that the algae/organics are 100% defeated. Once you confirm that, you can let the chlorine drift back down to 5-7ppm, and then maintain in there with your (hopefully working!) SWG.