Well, thats something I can live with. Its unrealistic (yeah NF, I see you hop for joy about that word REALISM)

, but acceptable.
So the formulas you would then use is:
GNS = global nutrition stockpile
LNS = local nutrition stockpile
LNR = local nutrition reduction
LNM = local nutrion multiplier (standard = 1, +1 for each granary stage)
Without granaries:
LNS = GNS * (LNR / SUMM(LNR(x)))
With granaries:
LNS = GNS * (LNR * LNM / SUMM(LNR(x) * LNM(x)))
An example:
Planet A produces 10 N, uses 1 N, and has no granary.
Planet B produces 1 N, uses 5 N and has a stage 2 granary.
GNS is 60
Without granaries:
LNS(A) = 60 * (1 / SUMM(1 + 5)) = 10
LNS(B) = 60 * (5 / SUMM(1 + 5)) = 50
So without granaries planet A can withstand an unlimited amount of time (it produces more food then it uses). Planet B would start to starve after 12 turns (it uses 4 NU more then it produces).
LNS(A) = 60 * (1 * 1 / SUMM((1 * 1) + (5 * 3)) = 3,75
LNS(B) = 60 * (5 * 3 / SUMM((1 * 1) + (5 * 3)) = 56,25
In this case the farm planet has a stockpile of 4 NUs only, thus again will never run out, as it produces more food then it uses. The industry planet has 56 NU in its granary, thus starting to starve after 14 turns. the two granaries allow them to survive for 2 more turns.
Honestly, it doesnt seem worth the aditionell book keeping to have granaries. If my simple formulaes are "too difficult" lets go as simple as possible:
LNS = GNS * (LNR / SUMM(LNR(x)))