The King has thanked Royal Navy submariners for their service to the country while on a visit to a base in Argyll and Bute.