S-40 (SS-145) was laid down on 5 March 1919 by the Bethlehem Shipbuilding Corp., San Francisco, Calif.; launched on 5 January 1921; sponsored by Mrs. John H. Rosseter; and commissioned on 20 November 1923, Lt. Comdr. E. F. Morrissey in command.
Assigned to Submarine Division 17 on commissioning, S-40 operated off southern California until January 1924, when she proceeded to Panama, thence continued into the Caribbean. Engaging in Fleet Problems II, III, and IV en route to and during her stay there, she returned to San Diego in late March. In May, she completed her final trial runs at San Francisco, then prepared for transfer to the Asiatic Fleet.
S-40 departed San Francisco, with her division, on 17 September and arrived at Manila on 5 November. During the winter of 1925, she conducted exercises in sound and target approaches, crash dives, and torpedo firing in the waters off Luzon. In May, she moved north with her division to Tsingtao, China, and, through the summer, engaged in operations off the China coast. In September, she returned to the Philippines; and, for the next fifteen years, maintained a schedule of overhaul, exercises, and patrols in the Philippines during the winter and operations off China during the summer.
During the summer of 1940, however, hostilities on the Asiatic mainland brought a change in her schedule and she conducted increasingly extended "familiarization" cruises among the Philippine Islands and in adjacent waters. With 1941, joint Army-Navy exercises were conducted at Corregidor, and patrols off likely invasion beaches were stepped up.
On 8 December, 7 December east of the International Date Line, S-40 was anchored off Sangley Point alongside the tender Canopus. With the receipt of the news of the Japanese attack on Pearl Harbor, she was ordered out on patrol. Underway on the 9th, she anchored off Boaya Point, Veradero Bay, on the 10th, and, with a lookout stationed on a nearby hill, watched the approaches to the Verde Island passage between Mindoro and Luzon. On the 12th, she shifted to an area off Batangas, and, on the 14th, returned to Veradero Bay. On the 18th, she was back at Manila, only to depart again on the 19th to patrol between Botolan Point and Subic Bay. On the 21st, she headed north to intercept a Japanese force reportedly bound for the Lingayen area.
Early on the 23d, S-40 sighted the enemy; fired four torpedos, unsuccessfully, at a transport; then, for much of the remainder of the day, remained submerged, avoiding depth charges dropped by the Japanese screening forces. After dark, she anchored in Agno Bay; made temporary repairs to her hull, engines, pumping system, and port air compressor; then patrolled off Bolinao. On the 29th, she was ordered to head south. Manila and Cavite had become untenable.
On the 30th, three days before Manila and Cavite fell, S-40 departed Luzon and pointed her bow toward the Netherlands East Indies. By midnight on 8 January 1942, she was off Makassar, whence she was ordered to Balikpapan for repairs, fuel, and supplies. There, enemy air attacks increased, but repairs were accomplished, fuel was taken on, and limited supplies were received. On the 14th, she took up patrol duties on the North Watcher-Mangkalihat line. By the 19th, her food supplies were again low, but she continued her efforts to impede the Japanese envelopment of the East Indies. On the 20th, she took up patrol off Balikpapan. On the 25th, she was ordered back to Makassar. Thence, on the 28th, she headed for Soerabaja to join the ABDA forces operating from that still Allied base.
She arrived at Soerabaja on the north coast of Java on 2 February, her crew frustrated by their attempts to intercept enemy shipping, but with information on tides, currents, navigational aids, and Japanese tactics. Nine days later, she got underway to patrol the northern approaches to Makassar City and intercept Japanese reinforcements expected to move through Makassar Strait and the Flores Sea. Arriving on the 15th, she patrolled initially between De Bril bank and the reefs to the south, then shifted to other areas. Her hunting remained unsuccessful.
By the 26th, she was again in need of repairs and was ordered to Exmouth Gulf on the Western Australia coast. There she took on needed supplies and continued on to Fremantle. On 6 March, she sighted a Japanese submarine, but was able neither to attack nor to transmit a message concerning its presence.
On the 9th, S-40 reached Fremantle. During the next month and a half, she underwent overhaul and shifted her base to Brisbane. On 4 May, she departed the Queensland coast for her fourth war patrol. Ordered into the New Britain-New Ireland area, she reconnoitered Deboyne en route and arrived on station on the 16th. On 3 June, she returned to Brisbane, again with information, but still scoreless.
At the end of the month, she was underway again. Initially assigned to intercept enemy traffic into the Salamaua-Lae area of New Guinea, she was ordered to the Solomons on 2 July to relieve S-38, which had been forced to vacate her position off Tulagi. S-40 patrolled between Tulagi and Lunga Roads and off Save Island; fired on a maru, but did not score; then shifted to the New Georgia-Santa Isabel area to intercept Rabaul shipping. Failing to directly impede Japanese traffic there, she returned to Australia on 29 July.
On 28 August, S-40 again cleared Moreton Bay and moved north. By 4 September, she was off the Gizo Island anchorage. Thence, she crossed the Solomon Sea to the D'Entrecasteaux group off Papua to impede the movement of enemy reinforcements into Milne Bay. Poor weather and mechanical problems inhibited her hunting; and, still scoreless, she returned to Brisbane on 25 September.
Repairs to S-40's deteriorating main motor cables and attempts to correct fuel leaks into the after battery occupied the next three weeks. On 19 October, she got underway for San Diego and an extensive overhaul. Patrolling in the Gilberts en route, she arrived at Pearl Harbor on 19 November; exchanged her 4-inch gun for a 3-inch gun from Whale, and continued on to the west coast, arriving on 7 December. Delays in the delivery of needed equipment slowed the yard work; but, on 4 June 1943, she emerged with air conditioning and more up to date electronic equipment. On the 7th, she moved north, toward the Aleutians, with 60% of her crew new to the Navy and to submarines. She trained en route to Dutch Harbor, whence she departed on her 8th war patrol on the 24th. Further training exercises were carried out prior to reaching Attu, where she topped off and departed again on the 30th, heading for the Kurils. Despite dense fog and heavy seas, she reached the Kamchatka peninsula on 3 July and stood down the coast toward Paramushiro.
Japanese fishermen, with their innumerable nets and set lines, hindered her freedom of movement. Dense fog impeded her hunting. On the 12th, she suffered a steering casualty which was temporarily repaired by the crew; and, on the 31st, she put back into Dutch Harbor.
S-40's ninth war patrol, 12 August-10 September, was again conducted in the fog and heavy swells of the northern Kuriles, but was cut short by repeated material failures which included the seemingly ever present problems of deterioration of the main power cables and fuel oil leaks into the after battery.
After voyage repairs, the S-boat was ordered to San Diego and training duty. Reporting to Commander Submarine Squadron 45 on arrival on 3 October, she conducted training operations for the West Coast Sound School and for Fleet Air, West Coast for the remainder of World War II. Then ordered inactivated, she shifted to San Francisco where she was stripped and decommissioned on 29 October 1945. Struck from the Navy list on 13 November 1945, she was sold to the Salco Iron and Metal Co., San Francisco, in November 1946 and was scrapped in July 1947.
S-40 earned one battle star during World War II.