Major-General Sir William Green, Royal Engineers (Chief Engineer during the Siege of Gibraltar 1779-83)