ALMODOVAR DEL RIO: The ramparts make clear that the principal function of a castle was defense.