It is a well known fact that the localization of a projective module over a commutative ring is free. However, I don't know anything about the dynamics of how the dimension of the resultant free module can depend on the ideal in respect to which localization is taken. The most natural starting point for an inquiry into this, would be whether or not this dimension is constant, or whether or not different ideals can give different dimensions in the first place.
The only example I have come up with dimension not constant is $R$ as a module over the ring $R\oplus R$, embedded canonically, where $R$ is any domain. Obviously, localizing by the other canonical embedding of $R$, a prime ideal, gives the zero module, while localization of the module in respect to itself is not.
I want to know whether or not this phenomenon is restricted to non-domains, or even just rings with idempotents (though that would be too good to true). If not, since it can't happen over PIDs, I would suspect that there is some other general class of rings where the localized dimension is in fact constant. Does anyone know where to look for more information about this class of ring, or if it's equivilent to anything I should be familiar with?
In my answer to your other question here https://math.stackexchange.com/a/1442596/14860 I showed that the function rank is constant on each $V(p)$ (the adherence of $p$ in the Zariski topology on the spectrum of the ring) were $p$ is a minimal prime ideal. So if the ring has finitely many of them (like if the ring is a domain or noetherian) then it is locally constant for each locally finite free module (here locally means at each point of the spectrum).