C+ C NAME: C ThomsonMidpointFar C CALLING SEQUENCE: function ThomsonMidpointFar(ScSun,Elo) C INCLUDE: include 'math.h' include 'thomson.h' C EXTERNAL: external ThomsonMidFar C CALLS: C BadR4, ThomsonSetupMidFar, nrZBrent C- real ScSun real Elo real nrZBrent logical nrZbrac if (Elo .lt. LOS__TINYELO) then ThomsonMidPointFar = cosd(Elo)+(32./(15*MATH__PI))**(1./3.)*sind(Elo) else if (Elo .gt. 180.-LOS__TINYELO) then ThomsonMidpointFar = cosd(Elo)+2.**(1./3.)*(1-2.**(-5./3.)*sind(Elo)**2) else ThomsonMidpointFar = BadR4() SHi = ThomsonSetupMidFar(Elo) SHi = max(0.1,cosd(Elo)) ! Distance to plane of sky if (nrZbrac(ThomsonMidFar,0.,SHi,1)) ThomsonMidpointFar = nrZBrent(ThomsonMidFar,0.,SHi,MATH__TINY) end if ThomsonMidpointFar = ScSun*ThomsonMidpointFar return end