Dear Gordon,
I am not really sure what your question is and your code is kind of difficult to decipher. Also I need to make assumption such as that your pi is actually Pi. But if I do that something like this comes out:
ae = 6378137.0 ;
eps2 = 0.00669437999014;
eps = Sqrt[eps2];
phivec = 45;
lam = 0;
h = 1000.;
phi = phivec*Pi/180 // N;
Q = ae/Sqrt[1 - eps2*Sin[phi]^2] // N
That gives the "single number": 6.38884*10^6.
Cheers,
Marco