Your visa is valid only to transit through an other Schengen State on your way to Spain.
To go to Portugal, you need:
- either the residence permet the Spanish authorities are supposed to issue to you (but I doubt you would get it in time)
- or a specific visa for Portugal.