William Napier, 9th Lord Napier — Royal Navy officer