The diesel submarine used in the movie is the USS Pampanito (SS 383), a WWII submarine currently (2024) on public display at Pier 45 in San Francisco, California.
Commander Dodge makes a snarky comment before meeting his crew, if they're leftovers from World War II. His Chief Engineer, Howard, is played by Harry Dean Stanton. Stanton served as a cook on board the USS LST-970 during the Okinawa Campaign in World War II.
The USS Pampanito could not move under her own power. The underwater shots were scale models. The surface shots actually were the Pampanito; however, she was being towed, as evidenced by the surface wake preceding the boat.
(at around 1h 19 mins) Chief Engineer CPO Howard says at one point "This is what I live for, DBF!." DBF stands for Diesel Boats Forever.
While the movie has been criticized for some of its concepts, many of the underlying ideas of the movie are accurate. Modern diesel submarines (not a retired World War II submarine) using their electric batteries are capable of being notably quieter than nuclear submarines. Many navies operate modern diesel submarines, and the vessels are quite effective in their roles. Experts have criticized the U.S. Navy at various times for not employing a few diesel submarines in the U.S. naval force.