The dream of submariners during World War II was to slip into a harbor to easily sink moored ships. This was difficult as harbor entrances were protected by anti-submarine nets and closely patrolled by ships. Subs that managed to slip into a harbor under a friendly ship or through a hole in the net caused great damage. However, they were usually sunk before they could escape the harbor. The first fighting at Pearl Harbor occurred when an American destroyer sunk a Japanese midget submarine attempting to slip into the harbor, although another made it through and torpedoed the USS Arizona. Harbors will be more secure in future wars since entrances are likely to be monitored by sonobuoys listening for submarines.
Submariners need not undertake such missions if they have "harbor torpedoes." These would look identical to current heavyweight torpedoes, but operate differently. They have a small engine and greater fuel capacity to allow greater range at a much slower speed, only around ten knots rather than forty. They can be programmable to make specific turns at specific times. For example, a harbor torpedo can be programmed to make a right 31 degree turn 1832 seconds after launch, then turn 24 degrees left 843 seconds later, then explode 925 seconds later. This allows a submarine to launch several preprogrammed torpedoes at known targets inside a harbor from outside its entrance, then depart. The captain may program two torpedoes to strike a dry dock, two an oil terminal, two at the main pier where ships are berthed, and have two homing torpedoes circle about listening for moving ships that they can attack. After a leisurely firing routine from outside the harbor entrance the submarine will have an hour to safely escape before the torpedoes explode.
Submariners will adjust programming to compensate for known currents while torpedoes may have an inertial navigation system to keep precisely on course. The use of GPS is an option. The torpedoes may have acoustic sensors for terminal guidance like today's homing torpedoes or they may be cheap, dumb torpedoes. Homing torpedoes may not function well in a harbor where most ships are moored. However, ships are not their only target; refineries, dockyards, and busy ship piers are valuable and rather large targets. Bridge piers may be struck if the torpedo begins a tight zigzag maneuver as it nears a bridge.
Harbor torpedoes will not arm themselves until several minutes after launch so they do not explode prematurely should they bump into a submarine net or other unexpected object along the way. This ensures the submarine has ample time to flee. They will have a contact fuze, however, it may not explode due to the torpedo's slow velocity or if it punches into a soft skinned boat. In such cases, its timed fuze will ensure eventual detonation. Harbor torpedoes need not strike their intended target to be effective. For example, one may miss its mark and explode 50 meters from a dry dock full of civilian workers. They will flee and all work halted for several hours as everyone is unsure if an accident occurred, enemy commandos are about, a missile has struck, or a submarine is in the harbor.
Harbor torpedoes are also useful against any coastal target open to the sea. A submarine captain may not want to approach close to shore because of ASW patrolling, sonobouys, or because the water is shallow. Therefore, submariners can fire slow, long-range harbor torpedoes from a safe distance and then depart the area. This is a good tactic against a fleet of ships near shore, like those offloading troops protected by destroyers. Rather than evading the destroyers for a traditional close-in attack, the submarine can fire several harbor torpedoes toward the ships far from the destroyers and depart the area long before they explode. These will cause confusion since destroyer sonar operators may be unable to hear slow and quieter harbor torpedoes swimming in the water.
Submarines can also fire Tomahawk missiles at targets ashore, assuming GPS satellites have not been destroyed and the system is not jammed locally. However, those can be shot down and launching Tomahawks creates a spectacle on the surface, so submariners are reluctant to fire them if enemy ships or aircraft patrol that area. Many harbor torpedoes will miss their target, however, just one hit can cause major damage. On their way to a target ashore, some may collide with a ship unintentionally and explode. Moreover, the risk for a billion-dollar submarine launching these torpedoes is minor since they will be far away when their torpedoes explode. Harbor torpedoes are an excellent strike warfare weapon and will cause damage and much confusion with mysterious explosions within the safety of a "secure" harbor.