Feel free to comment and also correct me if I've overlooked anything
The sub is a US Balao class which was the most numerous US type in the Pacific.
SUB MOVEMENT
The surfaced sub can move 3 hexes

But it can only move 2 hexes when submerged (below). You can stretch it to 3 hexes if you like but the icons around the perimeter warn you it'll surface at the end of its move-

------------------------------------------------------------------------------------
SPOTTING
The surfaced sub moves along the blue arrow and spots a Jap destroyer (Akizuki 1943) at 4 hexes.
The destroyer can't see the sub even though it's on the surface.

If the sub was submerged (below), the spotting range drops to only 2 hexes (periscope range) limiting the subs spotting range.

The sub continues moving on the surface to within 3 hexes of the destroyer, but although the ship is pinging, it still hasn't detected the sub-

----------------------------------------------------------------------------------
DESTROYER SPOTS SUB
I move the surfaced sub to within 2 hexes of the destroyer and the sub spots it at last with a combination of pings and eyeballs, and opens up with its guns. (For the record the guns inflicted 5 damage per turn on the sub in this and subsequent tests)

In this next test I submerged the sub and moved it to within 2 hexes of the destroyer and the destroyer detected it by pings and began firing "hedgehog" type projectile depth charges at it.
(Sometimes hogs inflicted 5 damage per turn, and sometimes 3 damage, so obviously they're not as effective as guns, therefore attacking while submerged will possibly reduce damage to the sub)

----------------------------------------------------------------------
SUBMARINE ON THE ATTACK
In the previous tests I held the subs fire, but now it's payback time..
Below: I move the surfaced sub into torpedo attack range (2 hexes) and launch a torpedo attack, but the destroyer wasn't even scratched (note the very poor combat odds) because destroyers were historically much harder to hit than fat juicy tankers and supply ships etc.

In the test below I move the sub into a deck gun attack range (1 hex) with the surfaced sub but the combat odds are appallingly bad, the japs must be rofling like crazy. In both this and the previous sub attack, the sub cannot move after firing its gun and torpedoes, so it just has to sit there as the jap throws everything at it during the jap turn..















