As Lemmon and Nelson are training the crew in how to unfurl the mainsail, you can see the stern of the USS Fletcher in the background. The Fletcher earned 15 battle stars in WWII and Korea. She was one of the most decorated destroyers to serve in the South Pacific. She was scrapped in 1972.
The original name of the boat in the movie was the "Fiesta". She was built in Hong Kong in 1932 entirely of teakwood. She was a 72 foot gaff-rigged schooner and came with a 165hp auxiliary diesel engine, weighed 28 net tons, drew 8 feet of water and could make 7.5 knots under power. She was also equipped with 3 tiled heads (bathrooms), two of them with showers, 1400 gallon fresh water tank, a 19 cubic foot deep freezer, and a 24 cubic foot refrigerator. Prior to the movie the Fiesta was owned by Martin J. Vitousek and his wife the former Beatrice Leiseder. (Source: The San Francisco Chronicle Sept. 14, 1952).
The movie is loosely based upon an actual commissioned Navy ship, the USS Echo (IX-95). As in the movie, the Echo was a scow loaned to the Navy from New Zealand in 1942, but was used for carrying cargo and supplies to Army bases in the South Pacific, earning her an Army commendation. She was decommissioned in 1944 and returned to New Zealand. After a lengthy and varied career, she ended her days as a museum in Picton New Zealand. Unfortunately, her condition had deteriorated to a dangerous state and she was beyond repair. She was demolished in 2015, 100 years after her launching in 1905.
I believe the ship shown through the window when Jack Lemmon was in the commanders office is the USS CHILTON. The number on the bow is PA 38. The configuration of the ship also appears to be the same as the CHILTON.