Harpoon gun would probably have an exception for that, like the underwater crossbow. The two would probably be the same, actually.
The problem is that submerged targets have total cover against attacks from above water. No, wait, actually, all the cover that water grants is only against attacks from land. If you're on a ship, you're not on land, and thus water offers no cover, so you can harpoon whales!