; ; SUMMATIONS Phir=dPhi/dr,Phith=dPhi/dth,and Phiph=dPhi/dphi ; Hr & dHr include the effect of various models ; NOTE: apar is useless 10May2000 ; pro brtp,Nmax,apar,r,sthi,Hr,dHr,Pi,dPi,Gfj,dGfj,Br,Bt,Bp Phir = double(0.0) Phith = double(0.0) Phiph = double(0.0) for n=0, Nmax do begin for m=0, n do begin Phir= Phir + dHr(n)*Pi(n,m)*Gfj(n,m) Phith= Phith + Hr(n)*dPi(n,m)*Gfj(n,m) Phiph= Phiph + Hr(n)*Pi(n,m)*dGfj(n,m) endfor endfor ;Br = -1.* (1 + apar/r)^2 * Phir Br = -1.* Phir ; corrected on Apr. 3, 1998 Bt = -1.* Phith/r Bp = -1.* Phiph/r/sthi end