what 7 night cruise line should my wife and i take to port at barcelona and madrid in spain, plus additional ports
Barcelona is a large and important sea port in Spain. There are many, many ships which use it. As for Madrid, it is in the center of the country, roughly 3 - 4, perhaps even more depending on the route, hours from the coast. The train from Barcelona makes it in about 3 hours...So, you will need land or air to get to and enjoy the capital city of Spain, Madrid....
Check out www.vacationstogo.com. I think they have the best search engine for cruises. Put in the month, Mediterranean as the region, Barcelona as the departure port (and return to the same port if that's what you're looking for), length of cruise (7 nights) and see what they have to offer. Click on the different cruises to see the exact itinerary.
It really depends on what you like. I personally like smaller ports (e.g. Palma de Mallorca, La Spezia/Cinque Terra) because they are more manageable in the typical 8-10 hour stop. Big cities are impossible to visit in one day, especially when you have to start by getting into the city (e.g. Civitavecchia to Rome or Livorno to Pisa or Florence) and back in your limited time.
Madrid isn't a cruise port. You could conceivably fly into Madrid, visit, catch a high-speed train to Barcelona, then catch a cruise from there.