C+ C NAME: C get_scparams.f C PURPOSE: C Read STEREO A velocity data into arrays C CATEGORY: C I/O C CALLING SEQUENCE: C call get_scparams(nCar,JDCar,NCoff,NLmax,IPNL,nYR,TDOYS8,Radius,VEL, C & XDS,XLS,XLL,XDL,XCE,XE,XC,YL,RA,DEC) C C INPUTS: C get_scparams: C isc integer spacecraft/planet identifier C 1 = Mercury C 2 = Venus C 3 = Earth C 4 = Mars C 5 = Jupiter C 6 = Saturn C 7 = Uranus C 8 = Neptune C 9 = Pluto C 10 = Ulysses C 11 = Helios-1 C 12 = Helios-2 C 13 = STEREO-A C 14 = STEREO-B C 15 = Messenger C C nCar integer dimension of JDCar C JDCar(nCar) integer start times (Julian days) of Carrington rotations C NCoff integer JDCar(I) is the start of rotation NCoff+I C NLmax integer max. # points read into arrays C IPNL integer # of this array element C nYr integer The year of this observation C Doy8(NLmax) real*8 The time of this observation: day of year (incl. fraction for time of day) C C OUTPUTS: C XDS (NLmax) real Sun-spacecraft distance C XLS (NLmax) real geocentric ecliptic longitude of spacecraft C XLL (NLmax) real geocentric ecliptic lng(spacecraft)-lng(Sun) (deg) C XDL (NLmax) real geocentric ecliptic lat(spacecraft) (deg) C XCE (NLmax) real modified Carrington variable position of spacecraft C XE (NLmax) real elongation (deg) (>0: East of Sun; <0: West of Sun) (0.0 for in-situ measurments) C XC (NLmax) real modified Carrington variable spacecraft after traceback to C heliocentric distance Radius at speed VV (not used in mkpostd_ins) C YL(NLmax) real heliographic latitude of spacecraft (not used in mkpostd_ins) C RA real Spacecraft right ascention C DEC real Spacecraft declination C MODIFICATION HISTORY: C March-2014, Bernard Jackson (UCSD) C- subroutine get_scparams(isc,nCar,JDCar,NCoff,NLmax,IPNL,nYR,Doy8,XCcntr,Radius,VEL, & XDS,XLS,XLL,XDL,XCE,XE,XC,YL,SCRA,SCDEC) C real*8 JDCar(nCar), & JEpoch, & Doy8 C real*8 dLngSun, dLatSun, dDisSun C real XDS (NLmax), ! Sun-Spacecraft distance (AU) & XLS (NLmax), ! Topocentric ecliptic longitude of spacecraft & XLL (NLmax), ! Geocentric ecliptic lng(spacecraft)-lng(Sun) (deg) & XDL (NLmax), ! Geocentric ecliptic lat(spacecraft) (deg) & XCE (NLmax), ! Modified Carrington variable position of spacecraft & XE (NLmax), ! Elongation (deg) (>0: East of Sun; <0: West of Sun) (0.0 for in-situ measurments) & XC (NLmax), ! modified Carrington variable spacecraft after traceback to C heliocentric distance Radius at speed VV (not used in mkpostd_ins) & YL (NLmax) ! Heliographic latitude of spacecraft (not used in mkpostd_ins) C real RVect(3) C external EARTH8 include 'sun.h' include 'dirspec.h' C C XCcntr = 4.0 ! Not correct call ExtractPositionn8(isc,nYr,Doy8,RVect) ! Spacecraft heliographic coordinates XDS(IPNL) = RVect(3) ! Sun - STEREO A distance SCelon = RVect(1) SCelat = RVect(2) call ECLIPTIC_HELIOGRAPHIC8(1,nYr,Doy8,SCelon,SCelat) ! Convert from spacecraft heliographic to ecliptic coordinates XLS(IPNL) = SCelon + 180.0 ! Geocentric ecliptic longitude of the spacecraft call SunNewcomb8(0,nYr,Doy8,dLngSun,dLatSun,dDisSun) alongsc = SCelon - sngl(dLngSun) +180.0 ! Topocentric longitude S/C diff. with Earth-Sun line XLL(IPNL) = SCelon - (sngl(dLngSun) - 180.0) ! Topocentric ecliptic longitude S/C diff. with Earth-Sun line (0.0 for Earth) XDL(IPNL) = -SCelat ! Geocentric ecliptic latitude of the spacecraft (0.0 for Earth) C Ehlon = sngl(dLngSun) - 180.0 C Ehlat = 0.0 C call ECLIPTIC_HELIOGRAPHIC8(0,nYr,Doy8,Ehlon,Ehlat) ! Convert from ecliptic to Sun location heliographic coordinates SCME = RVect(1) if(SCME .gt. 360.0) SCME = SCME - 360.0 if(SCME .lt. 0.0) SCME = SCME + 360.0 XCsc = XMAP_OBS_POS(XCcntr,SCME) ! Modified Carrington variable of spacecraft XCE(IPNL) = XCsc ! Modified Carrington variable position of spacecraft C if(alongsc .gt. 180.0) alongsc = alongsc - 360.0 if(alongsc .gt. 180.0) alongsc = 360.0 - alongsc if(alongsc .lt.-360.0) alongsc = alongsc + 360.0 if(alongsc .lt.-180.0) alongsc = alongsc + 360.0 signalongsc = -1.0 if(alongsc .lt. 0.0) signalongsc = 1.0 ecdistsc = RVect(3)*cosd(SCelat) eceascdist = sqrt((sngl(dDisSun)*sngl(dDisSun)) + (ecdistsc*ecdistsc) -2.0*sngl(dDisSun)*ecdistsc*cosd(alongsc)) cosecalongsc = ((eceascdist*eceascdist) + (sngl(dDisSun)*sngl(dDisSun)) - (ecdistsc*ecdistsc))/(2.0*eceascdist*sngl(dDisSun)) ecscdist = RVect(3)*sind(-SCelat) sceaang = atan2d(ecscdist,eceascdist) coselong = cosecalongsc*cosd(sceaang) XE (IPNL) = acosd(coselong)*signalongsc ! Elongation (deg) of spacecraft ! (>0: East of Sun; <0: West of Sun) (elongation of spacecraft) XCobs = XCsc+(Radius-RVect(3))/VEL*SUN__SPIRAL ! spacecraft traced to Radius XC (IPNL) = XCobs ! modified Carrington variable spacecraft after traceback to C heliocentric distance Radius at speed VV (not used in mkpostd_ins) YL (IPNL) = RVect(2) ! Heliographic latitude of spacecraft (not used in mkpostd_ins) SCRA = SCelon + 180.0 SCDEC = -SCelat call ecliptic_equator8(0,nYr,Doy8,SCRA,SCDEC) ! Right ascention and declination of the spacecraft C if(IPNL.eq.4887) stop if(IPNL.eq.3685.or.IPNL.eq.4886) then print *, ' ' write (*,'(10F10.6)') signalongsc, RVect(3), ecdistsc, eceascdist, ecscdist, sceaang, acosd(coselong)*signalongsc write (*,'(2I5,11F10.4)') IPNL, nYr, Doy8, XCcntr, SCelon, sngl(dLngSun), alongsc, XLL(IPNL), SCME, Ehlon, XCsc, SCRA, SCDEC end if return end