From May 13th, passport renewals for those of us living in Spain (and elsewhere) will be handled by the Identity and Passport Service (IPS) in Belfast instead of the regional hub in Madrid. Click here for the link.
At the site you will find the downloadable application form, guidelines for filling it in along with guidelines for acceptable photographs.
What you will find is that the service takes 4 weeks to complete and the cost of a renewal (including courier fee) is £147.86 for a 32 page ten year passport.
The advice is not to wait until your current passport expires because you can apply up to 9 months before and have the time added on.
Even if you do not intend to travel, it is important to have a passport as a form of identity especially since the new cards issued in Spain for foreigners do not include a photograph. If you do intend to travel by plane, even if it is within the country, you will of course need a valid passport.