The remnants of Spanish vineyards dating back more than 1,000 years have been discovered in the terraced fields of a medieval village, a new archaeological study says.