; ; SUMMATIONS Phir=dPhi/dr,Phith=dPhi/dth,and Phiph=dPhi/dphi ; Hr & dHr include the effect of various models ; pro zbrtp,r,sthi,Hr,dHr,Pi,dPi,Gfj,dGfj,Br,Bt,Bp,N0=n0 if not keyword_set(n0) then n0=1 else n0=0 nmax=n_elements(Hr)-1 Phir = 0. Phith = 0. Phiph = 0. for n=n0, 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.* Phir Bt = -1.* Phith/r Bp = -1.* Phiph/r/sthi end