;routine to calculate coupling functions ;here reduced to just one ;Patrick Newell, JHU/APL November 13, 2006 ;calling routine supplies IMF bx, by, bz, v, n, and Ec ;preferably after weighted average, such as inter_sol routine ;return is coupling function Ec ;density (n) is not actually used for this coupling function pro sol_coup,bx,by,bz,v,n,Ec Ec = 0. ;magic coupling function B = sqrt(bx*bx + by*by + bz*bz) if( (n*B*v) eq 0. )then begin return endif pi = 3.14159265 BT = sqrt(by*by + bz*bz) bztemp = bz if( bz eq 0. ) then begin bztemp = 0.001 endif tc = atan(by,bztemp) if( BT*cos(tc)*bz lt 0 ) then begin tc = tc + 3.14159265 endif sintc = abs(sin(tc/2.)) Ec = (v^1.33333)*(sintc^2.66667)*(BT^0.66667) return end