What I've read says a lot of the mid/late war Gatos and Balos had the 5"/25 as a deck gun rather than the old 3"/50.
http://en.wikipedia.org/wiki/5"/25_caliber_gun_(United_States)
That'd be correct- as boats came in for major refits & overhaul, they would be retrofitted with heavier deck guns were often part of the equipment upgrades, as combat experience showed that the 3"/50 was inadequate to deal with unarmed merchant ships & targets not worth a torpedo, such as sampans, junks, fishing boats, & other coastal traffic that subs would often go after on the surface, circumstances permitting.
The very first deck guns on US subs were 3"/23 guns on a pop-up mount where the breech would be stowed in a watertight structure built into the superstructure, with the barrel pointing straight up when stowed; these were used on the WW1 L & O-classes.
Later US subs had more conventional gun mountings, with easier to use wet mounts that would allow more powerful guns to be fitted, starting with the R-class, which had a 3"/50 mounted in front of the conning tower, and the S-class which had a 4"/50 in the same position, as did the later
Dolphin.
Barracuda had a 5"/51, but that gun was seen as unsuitable due to the difficulties of manhandling the separate projectile & charge without proper hoists on the deck of a submarine, as were the 6"/53s used on
Argonaut &
Narwhal, chosen because of their designed role as submarine cruisers when submarines were supposed to follow the cruiser rules in the interwar era.
However, in the interests of saving weight under the treaty regime, as well as a belief among some admirals that fitting heavier guns to submarines would encourage their captains to get into gun battles with merchant ships & small warships, starting with
Cachalot, US subs reverted to the 3"/50, over the objections of submarine officers, such as Charles Lockwood, who advocated for the development of a new lightweight 4" gun, but there was never enough money in the budget to come up with such a weapon. However, their lobbying did lead to the gun foundations of submarines from
Porpoise onwards to be built strongly enough to take a 5" gun in anticipation of future developments.
Subs through the early
Gatos continued to be built with the 3"/50, but by late 1942, combat experience showed that gun to be inadequate, so later ones were built with 4"/50s removed from S-boats retired from front-line service, as were many of the
Balaos, while the surviving earlier fleet boats were rearmed with them as they came in for overhaul during 1943, though several of the
Tambor class boats were fitted with the 5"/51s originally mounted on the
Barracudas. When the supply of former S-boat guns ran short, the shortfall was made up by converting 4"/50 guns removed from old 4-pipers that were rearmed with DP 3" guns for wet-mount operation.
However, even the 4" was seen as too light for operations against light coastal traffic, so starting in August, 1944, a light 5" gun, a wet mount version of the 5"/25 gun used as a heavy AA gun in large interwar surface ships, became available for retrofit on the newer boats, as well as being fit to new construction. By late 1944, a couple boats were fitted with what became the ultimate gun armament, 5"/25s fore & aft, as well as 40 mm Bofors mounted on platforms at both ends of the fairwater, and that proved to be so successful in operations against coastal & small craft traffic, that starting in January, 1945, that armament was authorized to be fitted to any submarine upon the request of the captain.
To make that armament even more effective, starting in February, 1945, BuOrd developed a compact fire-control system at the request of Adm. Lockwood, which had a fire control computer & stable element located in the CPO quarters, with target & own-ship's data from the tracking solution would be manually input, and a gunnery solution would be generated, which would be transmitted to the guns by remote indicator. The first such installation was made & successfully tested in late July, 1945, and 6 additional subs were so fitted by the end of the war. One of the submarine force's major procurement goals in the immediate post-war era was to acquire enough equipment to be able to fit that gun armament & fire control system to all active & reserve submarines, but that was soon overtaken by post-war developments.
However, deck guns survived in USN service through the early 1950s, both on unmodernized boats, and even a few of the early fleet snorkel conversions, such as can be seen in the attached pic of
Argonaut II, taken at Malta in July, 1953, while even into the early 1960s, some of the fleet snorkel conversions done for boats being transferred to allied countries had them.