To add, regarding newer CIWS concepts, there are now very effective 40 mm gun mounts that can use programmable airburst munitions. With a FCS, this makes them effective against all types of threats, surface or aerial, close to the ship, maybe about 4 km. And they are small enough to be the main gun of patrol boats.