RepairPal Certified shops can diagnose and repair your 2011 Mazda CX-7. They provide transparent pricing with a minimum 12-month or 12,000-mile warranty on repairs and services.
Sounds like an intermittent clutch or coil issue on the compressor; could be a cycle switch issue. These are guesses, but a hands on diagnosis to see what is malfunctioning when the problem occurs is in order.