Upvote:1
This visa does allow you to travel to other Schengen countries and is still valid. In the somewhat unlikely event that you are checked at the border (not seen any enforcement on a trip last week), there could be some questions about your intent to leave Spain and the Schengen area in time but you have got that covered convincingly with your German studies and visa appointment.