Royal Navy officer during the American War of Independence and the French Revolutionary and Napoleonic Wars.