C+ C NAME: C HOSOrbID C PURPOSE: C Identifies spacecraft and year which best fits a given combination of C time, heliocentric distance and ecliptic longitude C CATEGORY: C Celestial mechanics C CALLING SEQUENCE: subroutine HOSOrbID(TT,R,L,iSc,iYr, dRMin) C INPUTS: C TT real day of year (print result if < 0) C R real heliocentric distance of spacecraft C L real ecliptic longitude of spacecraft C OUTPUTS: C iSc integer spacecraft ID (1 for Helios A; 2 for Helios B) C iYr integer year ID C dRMin real C CALLS: C HOSOrbit, cFlt2Str, cInt2Str, iwhitespace, Say, pInfR4 C PROCEDURE: C The Helios A position is calculated for the given day of year in years C 1974-1985; the same for Helios B in years 1976-1980. The resulting C distance-longitude coordinates are compared with the input coordinates. C The spacecraft-year combination giving the closest match (i.e. closest C in absolute distance) are presented as ouput. C MODIFICATION HISTORY: C 1990, Paul Hick (UCSD) C- real TT real R real L integer iSc integer iYr real dRMin real Z(6) character cStr*80 character cInt2Str*14 character cFlt2Str*14 character cSay*8 /'HOSOrbID'/ T = abs(TT) if (TT .lt. 0) then cStr = 'Doy '//cFlt2Str(T,3)//' R = '//cFlt2Str(R,5)//' AU, L = '//cFlt2Str(mod(L,360.),3)//' degrees' I = iwhitespace(cStr) call Say(cSay,'I','Match',cStr) write (*,'(15X,A,35X,A,/,2X,A,8X,A)') 'Helios 1','Helios 2', & 'Year dR (AU) dLng (deg) dRvec','Year dR (AU) dLng (deg) dRvec' end if dRMin = pInfR4() do I=1974,1985 do J=1,2 if (J .eq. 1 .or. (1976 .le. I .and. I .le. 1980) ) then call HOSOrbit(J,I,T,Z(J),Z(J+2),VR,VT) dR = sqrt(max(0., R*R+Z(J)*Z(J)-2*Z(J)*R*cosd(Z(J+2)-L)) ) if (dR .eq. 0) dR = abs(R-Z(J)) if (dR .lt. dRMin) then iSc = J iYr = I dRMin = dR end if Z(J+4) = dR end if end do if (TT .lt. 0) then if (1976 .le. I .and. I .le. 1980) then write (*,'(I6,F10.4,F12.4,F10.4, 5X,I6,F10.4,F12.4,F10.4)') & I,R-Z(1),mod(L,360.)-Z(3),Z(5), I,R-Z(2),mod(L,360.)-Z(4),Z(6) else write (*,'(I6,F10.4,F12.4,F10.4)') I,R-Z(1),mod(L,360.)-Z(3),Z(5) end if end if end do if (TT .lt. 0) then cStr = 'Spacecraft is Helios '//cInt2Str(iSc)//' in year '//cInt2Str(iYr)//', doy '//cFlt2Str(T,3) I = iwhitespace(cStr) call Say(cSay,'I','Match',cStr) end if return end