*
*     ---------------
*     PROGRAMME EPVEQ
*     ---------------
*
*     Earth Equatorial Position and Velocity J2000.
*     Heliocentric and Barycentric rectangular coordinates.
*     Call subroutine EPV.
*     Results in file EPVEQ.R (logical unit 10).
*     Initial Julian date : 2415000.5.
*     Number of dates : 21.
*     Step : 3650 days.
*
      implicit double precision (a-h,o-z)
*
      dimension dj(2),v1(3,2),v2(3,2),iv1(3),iv2(3)
*
      t0=2415000.5d0
      ndat=21
      pas=3650.d0
*
      nul=10
      open (nul,file='EPVEQ.R')
*
      t=t0
*
      do n=1,ndat
*
         dj(1)=t
         dj(2)=0.d0
*
         call EPV (dj,v1,v2)
*
         do i=1,3
            iv1(i)=v1(i,1)
            iv2(i)=v2(i,1)
         enddo
*
         write (nul,1001) t
         write (nul,1002) iv1,(v1(i,2),i=1,3)
         write (nul,1003) iv2,(v2(i,2),i=1,3)
*
         write (*,1001) t
         write (*,1002) iv1,(v1(i,2),i=1,3)
         write (*,1003) iv2,(v2(i,2),i=1,3)
         write (*,1004)
         read (*,*)
*
         t=t+pas
*
      enddo
*
      stop
*
1001  format (/2x,'Julian date',f11.1)
1002  format (2x,'Earth heliocentric equatorial coordinates J2000'/
     .        2x,'Position (km) ',
     .        4x,'X : ',i10,4x,'Y : ',i10,4x,'Z : ',i10/
     .        2x,'Velocity (m/s)',
     .        4x,'XP: ',f10.3,4x,'YP: ',f10.3,4x,'ZP: ',f10.3)
1003  format (2x,'Earth barycentric equatorial coordinates J2000'/
     .        2x,'Position (km) ',
     .        4x,'X : ',i10,4x,'Y : ',i10,4x,'Z : ',i10/
     .        2x,'Velocity (m/s)',
     .        4x,'XP: ',f10.3,4x,'YP: ',f10.3,4x,'ZP: ',f10.3)
1004  format (/2x,'Press Enter')
*
      end
*
*
*
      subroutine EPV (dj,xyzhel,xyzbar)
*------------------------------------------------------------------------------
*
*     - - -
*     E P V     Dec 1997
*     - - -
*
*     Earth Position and Velocity, heliocentric and barycentric,
*     with respect to the J2000 equatorial triad.
*
*     Given:
*
*     dj       d(2)      epoch: dj(1)+dj(2) = Julian date, TDB
*
*     Returned:
*
*     xyzhel   d(3,2)    heliocentric Earth position/velocity
*     xyzbar   d(3,2)    barycentric Earth position/velocity
*
*     Notes:
*
*     1 The epoch is Julian date (TDB), apportioned in any convenient
*       way between the array elements dj(1)+dj(2).  For example,
*       Jd(TDB)=2450123.7 could be expressed in any of the these
*       ways, among others:
*
*              dj(1)          dj(2)
*
*           2450123.7d0        0d0        (Jd method)
*            2451545d0      -1421.3d0     (J2000 method)
*           2400000.5d0     50123.2d0     (mJd method)
*            2450123d0        0.7d0       (date & time method)
*
*       The Jd method is the most natural and convenient to use in
*       cases where the loss of several decimal digits of resolution
*       is acceptable.  The J2000 method is best matched to the way
*       the argument is handled internally and will deliver the
*       optimum resolution.  The mJd method and the date & time methods
*       are both good compromises between resolution and convenience.
*
*     2 Elements (1-3,1) of the result vectors are the J2000
*       equatorial x,y,z components of the positions, in kilometers;
*       Elements (1-3,2) are the components of the velocities, in
*       meters per second.
*
*     3 The routine is a simplified solution from the planetary
*       theory VSOP87 (P. Bretagnon, G. Francou, 1988, AA 202, 309)
*       and is an adaptation of original fortran code supplied by
*       P. Bretagnon.  the present formulation produces identical
*       results to the original Bretagnon code.
*
*     4 EPV calculates, for the given epoch dj (Jd, TDB), the cartesian
*       coordinates xyzhel of the heliocentric position and velocity
*       vectors of the Earth and the coordinates xyzbar of the
*       barycentric position and velocity vectors of the Earth, referred
*       to the J2000 mean equator and equinox.
*
*     5 Comparisons over the time span 1900-2100 with the complete
*       VSOP87 and the JPL ephemerides DE200, DE403 and DE405 give
*       differences always smaller than 417 km for the heliocentric
*       position and 0.046 m/s for the speed.  In the case of the
*       barycentric predictions, the differences are more important,
*       owing to the different planetary masses used in the four
*       solutions:
*
*           Ephemeris     DeltaP       DeltaV
*                           <            <
*            VSOP87        399         0.046
*            DE200         878         0.046
*            DE403        1569         0.045
*            DE405        1572         0.045
*                          km           m/s
*
*     This draft by P.T.Wallace, 1997 december 22.
*
*------------------------------------------------------------------------------

      double precision dj(2),xyzhel(3,2),xyzbar(3,2)

      double precision t,t2,xyz,xyzd,a,b,c,ct,p,cp,
     .                 ph(3),vh(3),pb(3),vb(3),x,y,z
      integer i,j,k

*     astronomical unit, kilometers
      double precision au
      parameter (au=149597870d0)

*     au/jy to m/s
      double precision vms
      parameter (vms=au*1000d0/86400d0/365.25d0)

*     reference epoch (J2000), Jd
      double precision dj0
      parameter (dj0=2451545.d0)

*     sine and cosine of obliquity, 23d 26' 21.409" (Bretagnon values)
      double precision sine,cose
      parameter (sine=0.397776982457d0,
     .           cose=0.917482137280d0)

*     ----------------------
*     Ephemeris coefficients
*     ----------------------
*
*     The coefficients are stored in blocks, where each block is an array
*     of dimension (3,n,3).  There are separate sets of arrays for (i) the
*     Sun to Earth vector and (ii) the Solar-System Barycenter to Sun
*     vector.  Each of these two sets contains separate arrays for the terms
*     (n in number) in each power of time: t^0, t^1 and t^2.  Within each
*     array, all the cartesian x-components, elements (i,j,1), appear first,
*     followed by all the y-components, elements (i,j,2) and finally all the
*     z-components, elements (i,j,3).  At the lowest level are groups of three
*     coefficients.  The first coefficient in each group, element (1,j,k),
*     is the amplitude of the term, the second, element (2,j,k), is the
*     phase and the third, element (3,j,k), is the frequency.
*
*     The naming scheme is such that a block
*
*     double precision bn(3,mbn,3)
*
*     applies to body b and time exponent n:
*
*     . b can be either e (Earth with respect to Sun) or s (Sun with
*       respect to Solar-System Barycenter)
*
*     . n can be 0, 1 or 2, for t^0, t^1 or t^2
*
*     For example, array e2(3,me2,3) contains the coefficients for
*     the t^2 terms for the Sun-to-Earth vector.
*
*     There is no requirement for the x, y and z models for a particular
*     block to use the same number of coefficients.  The number actually
*     used is parameterized, the number of terms being used called nbnx,
*     nbny, and nbnz respectively.  The parameter mbn is the biggest of
*     the three, and defines the array size.  Unused elements are not
*     initialized (and are never accessed).
*

      integer ne0(3),ne0x,ne0y,ne0z,me0,
     .        ne1(3),ne1x,ne1y,ne1z,me1,
     .        ne2(3),ne2x,ne2y,ne2z,me2,
     .        ns0(3),ns0x,ns0y,ns0z,ms0,
     .        ns1(3),ns1x,ns1y,ns1z,ms1
      parameter (ne0x=148,ne0y=150,ne0z=22,me0=ne0y,
     .           ne1x=7,ne1y=7,ne1z=4,me1=7,
     .           ne2x=2,ne2y=2,ne2z=1,me2=2,
     .           ns0x=77,ns0y=78,ns0z=25,ms0=78,
     .           ns1x=11,ns1y=10,ns1z=3,ms1=11)
      double precision e0(3,me0,3),e1(3,me1,3),e2(3,me2,3),
     .                 s0(3,ms0,3),s1(3,ms1,3)
      data ne0/ne0x,ne0y,ne0z/
      data ne1/ne1x,ne1y,ne1z/
      data ne2/ne2x,ne2y,ne2z/
      data ns0/ns0x,ns0y,ns0z/
      data ns1/ns1x,ns1y,ns1z/

*     Sun-to-Earth, t^0, x
      data ((e0(i,j,1),i=1,3),j=1,10) /
     .        0.99982928844d+00, 0.17534856847d+01, 0.62830758500d+01,
     .        0.83525730007d-02, 0.17103453945d+01, 0.12566151700d+02,
     .        0.56114420586d-02, 0.62831851909d+01, 0.00000000000d+00,
     .        0.10466627967d-03, 0.16672264522d+01, 0.18849227550d+02,
     .        0.31108383566d-04, 0.66875219801d+00, 0.83996847318d+02,
     .        0.25524979592d-04, 0.58310207301d+00, 0.52969096509d+00,
     .        0.21372562585d-04, 0.10923518967d+01, 0.15773435424d+01,
     .        0.17091028079d-04, 0.49540223397d+00, 0.62795527316d+01,
     .        0.17078815351d-04, 0.13002983234d+00,-0.62865989683d+01,
     .        0.14452415265d-04, 0.28104574696d+01,-0.23528661538d+01 /
      data ((e0(i,j,1),i=1,3),j=11,20) /
     .        0.10910055154d-04, 0.36898478246d+01, 0.52236939198d+01,
     .        0.93442917275d-05, 0.60738992258d+01, 0.12036460735d+02,
     .        0.89914395871d-05, 0.31757195052d+01, 0.10213285546d+02,
     .        0.56651421138d-05, 0.21526203402d+01, 0.10593819302d+01,
     .        0.68441618018d-05, 0.13069902123d+01, 0.57533848849d+01,
     .        0.73445528365d-05, 0.19281833419d+01,-0.39814900341d+00,
     .        0.68143711966d-05, 0.40649699603d+01,-0.47057323075d+01,
     .        0.61123806735d-05, 0.53847923432d+01, 0.68127668151d+01,
     .        0.45183632689d-05, 0.60876828087d+01, 0.58849268466d+01,
     .        0.45195305024d-05, 0.50038480236d+01,-0.62567775302d+01 /
      data ((e0(i,j,1),i=1,3),j=21,30) /
     .        0.44951710160d-05, 0.53692383171d+01, 0.63093741698d+01,
     .        0.40624794595d-05, 0.54361367084d+00, 0.66812248534d+01,
     .        0.54095684229d-05, 0.54964116606d+01,-0.77552261132d+00,
     .        0.54700354630d-05, 0.14614665038d+01, 0.14143495242d+02,
     .        0.52048413261d-05, 0.44329579998d+01, 0.78604193924d+01,
     .        0.21495960907d-05, 0.45021384457d+01, 0.11506769770d+02,
     .        0.22789216233d-05, 0.50437704792d+01,-0.70585984613d+01,
     .        0.22587756344d-05, 0.32724430621d+01, 0.46940029547d+01,
     .        0.25582030323d-05, 0.22655627725d+01, 0.12168002697d+02,
     .        0.25618194635d-05, 0.14547415078d+01, 0.70993304836d+00 /
      data ((e0(i,j,1),i=1,3),j=31,40) /
     .        0.17811951119d-05, 0.33211310651d+01,-0.79629800682d+00,
     .        0.16120500561d-05, 0.14733771896d+01, 0.54867778432d+01,
     .        0.17832490444d-05, 0.62437470460d+01, 0.62831431603d+01,
     .        0.17832490444d-05, 0.58785205985d+01,-0.62830085397d+01,
     .        0.15548739382d-05, 0.16240930952d+01, 0.25132303400d+02,
     .        0.20902445258d-05, 0.58520752807d+01, 0.11790629089d+02,
     .        0.19997062438d-05, 0.40720993825d+01, 0.17789845620d+02,
     .        0.12893341678d-05, 0.10662521657d+01,-0.70793738568d+01,
     .        0.12809933774d-05, 0.14813564849d+01,-0.37387614301d+01,
     .        0.15169134491d-05, 0.86921639327d+00, 0.21329909544d+00 /
      data ((e0(i,j,1),i=1,3),j=41,50) /
     .        0.94483099644d-06, 0.46018762073d+01, 0.10977078805d+02,
     .        0.77800770996d-06, 0.18444479720d+01, 0.88273902699d+01,
     .        0.77277265245d-06, 0.35839602733d+01, 0.55075532387d+01,
     .        0.73493119486d-06, 0.26952239258d+01, 0.15890728953d+01,
     .        0.65358907339d-06, 0.36515634797d+01, 0.11769853693d+02,
     .        0.63239688526d-06, 0.40419439977d+01,-0.62623004545d+01,
     .        0.62961483175d-06, 0.44072938194d+01, 0.63038512455d+01,
     .        0.85870286082d-06, 0.30243080773d+01, 0.16728376159d+03,
     .        0.82957196050d-06, 0.61925490884d+01, 0.33406124267d+01,
     .        0.79201216041d-06, 0.24936671652d+01, 0.60697767546d+01 /
      data ((e0(i,j,1),i=1,3),j=51,60) /
     .        0.60047690729d-06, 0.28836672474d+01,-0.41369104335d+01,
     .        0.75600863368d-06, 0.41595602378d+01, 0.64963749454d+01,
     .        0.67770599418d-06, 0.40341628367d+01, 0.94377629349d+01,
     .        0.53714679654d-06, 0.47209582468d+01,-0.11944470102d+01,
     .        0.57574048972d-06, 0.26788176695d+01, 0.62820955289d+01,
     .        0.57574048972d-06, 0.23134694040d+01,-0.62840561711d+01,
     .        0.51128922017d-06, 0.13125552235d+01, 0.62901893970d+01,
     .        0.50528874628d-06, 0.53482765065d+01, 0.62759623030d+01,
     .        0.49613059938d-06, 0.36394845923d+01,-0.61276554506d+01,
     .        0.48084757524d-06, 0.40088619738d+01, 0.64384962494d+01 /
      data ((e0(i,j,1),i=1,3),j=61,70) /
     .        0.57339850289d-06, 0.37945997910d+01, 0.31546870849d+01,
     .        0.47377647918d-06, 0.17613355156d+00,-0.31283887651d+01,
     .        0.41148838872d-06, 0.33272630219d+01, 0.84292412665d+01,
     .        0.52308739943d-06, 0.53057159987d+01, 0.13367972631d+02,
     .        0.51320670203d-06, 0.57845002663d+01, 0.12352852605d+02,
     .        0.50648274077d-06, 0.20520651741d+01, 0.11856218652d+02,
     .        0.43380811720d-06, 0.36450174952d+01, 0.17260154655d+02,
     .        0.39554333866d-06, 0.13529613833d+01,-0.54812549189d+01,
     .        0.48968582704d-06, 0.45418080759d+00, 0.92255392733d+01,
     .        0.47568482763d-06, 0.31612358600d+01, 0.58564776591d+01 /
      data ((e0(i,j,1),i=1,3),j=71,80) /
     .        0.47270791451d-06, 0.62147119447d+00, 0.25443144199d+01,
     .        0.32480892132d-06, 0.80957263520d+00, 0.39302096962d+01,
     .        0.32558648537d-06, 0.19742786477d+01, 0.21461654165d+01,
     .        0.32520898756d-06, 0.28456687134d+01, 0.41643119896d+01,
     .        0.32545731451d-06, 0.30179680831d+01, 0.50886288398d+01,
     .        0.28514707542d-06, 0.17385509447d+00,-0.12569674818d+02,
     .        0.36898084939d-06, 0.29109713418d+01, 0.18073704939d+02,
     .        0.30322209377d-06, 0.42897819994d+01,-0.45350594369d+01,
     .        0.28166291803d-06, 0.48127325250d+00, 0.12562628582d+02,
     .        0.21880447981d-06, 0.51263508859d+01, 0.11371704690d+02 /
      data ((e0(i,j,1),i=1,3),j=81,90) /
     .        0.21641591894d-06, 0.46352415648d+01, 0.12559038153d+02,
     .        0.20480287805d-06, 0.14671366021d+01, 0.70848967811d+01,
     .        0.26112053430d-06, 0.59787138727d+01,-0.71430695618d+02,
     .        0.22866661191d-06, 0.47643739940d+01, 0.80310922631d+01,
     .        0.23249867691d-06, 0.61903031141d+01, 0.18319536585d+02,
     .        0.17104465750d-06, 0.56963366371d+01,-0.49332084403d+01,
     .        0.21687139829d-06, 0.43034890145d+01, 0.10447387840d+02,
     .        0.21064592110d-06, 0.24829044193d+01,-0.74775228602d+01,
     .        0.13898428128d-06, 0.16914657211d+01,-0.86359420038d+01,
     .        0.19219688733d-06, 0.49428010004d+00, 0.17298182327d+02 /
      data ((e0(i,j,1),i=1,3),j=91,100) /
     .        0.18884386332d-06, 0.24269451859d+01, 0.15613747598d+03,
     .        0.13604593844d-06, 0.51972105563d+01, 0.13095842665d+02,
     .        0.15049111219d-06, 0.31208409605d+01, 0.16496361396d+02,
     .        0.13852415434d-06, 0.61624302742d+01, 0.76329432597d+01,
     .        0.14420805452d-06, 0.14379185141d+01, 0.20426571092d+02,
     .        0.13246713375d-06, 0.36076817465d+01, 0.12139553509d+02,
     .        0.11583479718d-06, 0.82242504473d+00,-0.53313574437d+01,
     .        0.14328536364d-06, 0.60279195813d+01, 0.73424577802d+01,
     .        0.12375116902d-06, 0.31737660745d+01,-0.62794854213d+01,
     .        0.12366042738d-06, 0.35391144643d+01, 0.62866662786d+01 /
      data ((e0(i,j,1),i=1,3),j=101,110) /
     .        0.99512963770d-07, 0.12573591660d+01, 0.72347942562d+01,
     .        0.12424750422d-06, 0.10639656305d+01, 0.15110466120d+02,
     .        0.11004264596d-06, 0.40904180748d+01,-0.10988808158d+02,
     .        0.11583064795d-06, 0.22306232433d+01,-0.57295064471d+01,
     .        0.90455517463d-07, 0.54301664584d+01, 0.96236882767d+01,
     .        0.88686946502d-07, 0.50469094181d+01, 0.61480107700d+01,
     .        0.10507000331d-06, 0.26275802506d+01, 0.68366452528d+01,
     .        0.11128671340d-06, 0.41772806317d+01, 0.15720838785d+02,
     .        0.86135957175d-07, 0.46815735380d+01,-0.64181409300d+01,
     .        0.85319148121d-07, 0.24619838497d+01, 0.14712317116d+02 /
      data ((e0(i,j,1),i=1,3),j=111,120) /
     .        0.10480041316d-06, 0.33302962194d+01,-0.59992165311d+01,
     .        0.98197419052d-07, 0.36955619424d+01, 0.65669351689d+01,
     .        0.91710284213d-07, 0.39221643965d+01, 0.56431785637d+01,
     .        0.97968025364d-07, 0.19195182276d+01, 0.21228392024d+02,
     .        0.75454356713d-07, 0.50471398149d+01,-0.12539853380d+02,
     .        0.82274617411d-07, 0.32929613711d+00, 0.10973555686d+02,
     .        0.74117835149d-07, 0.50319729087d+01, 0.23543230505d+02,
     .        0.61595106654d-07, 0.94570829909d+00, 0.12964300703d+02,
     .        0.63934168351d-07, 0.39754339145d+01, 0.24072921470d+02,
     .        0.77934521335d-07, 0.43041186497d+01, 0.22003914635d+02 /
      data ((e0(i,j,1),i=1,3),j=121,130) /
     .        0.75342656532d-07, 0.35145713502d+01, 0.18422629359d+02,
     .        0.62238153022d-07, 0.22441672323d+01, 0.18451078547d+02,
     .        0.47367494343d-07, 0.37421099779d+01, 0.14314168113d+02,
     .        0.62627064688d-07, 0.43952939616d+01, 0.26087903142d+02,
     .        0.61959271367d-07, 0.36961429623d+01,-0.84672475845d+02,
     .        0.61599889501d-07, 0.47825005414d+01, 0.23942439025d+03,
     .        0.49876849670d-07, 0.73122610959d+00, 0.77713771468d+02,
     .        0.48634555784d-07, 0.37672237507d+01, 0.90279923168d+02,
     .        0.53045360834d-07, 0.33435917292d+01, 0.25158601720d+02,
     .        0.39806090772d-07, 0.50863333541d+01,-0.13341674311d+02 /
      data ((e0(i,j,1),i=1,3),j=131,140) /
     .        0.30249996806d-07, 0.31862010183d+01, 0.18052929543d+02,
     .        0.25354258761d-07, 0.15831069320d+01, 0.31415379250d+02,
     .        0.35197839547d-07, 0.53798639866d+01, 0.25057067586d+03,
     .        0.33828890106d-07, 0.17474848944d+01, 0.14945316174d+02,
     .        0.30142123396d-07, 0.47664087717d+01, 0.29088811416d+02,
     .        0.24362315282d-07, 0.44077210649d+01, 0.95143132921d+02,
     .        0.18418023111d-07, 0.59364330276d+01,-0.65147619768d+02,
     .        0.18001174487d-07, 0.61890801427d+01, 0.33019021112d+02,
     .        0.12114624712d-07, 0.22416408469d+01,-0.82576981221d+02,
     .        0.91688913730d-08, 0.24701513809d+01, 0.14985440013d+03 /
      data ((e0(i,j,1),i=1,3),j=141,ne0x) /
     .        0.72321863362d-08, 0.30675528210d+01, 0.16100068574d+03,
     .        0.53537979938d-08, 0.61227726082d+01, 0.17356683744d+03,
     .        0.60294640752d-08, 0.85487187240d+00, 0.32271130452d+03,
     .        0.56943747338d-08, 0.29523675684d+01, 0.97238627545d+02,
     .        0.43877166335d-08, 0.48255826542d+01, 0.23314131440d+03,
     .        0.49924837837d-08, 0.27256341976d+01, 0.16171061879d+03,
     .        0.31876102726d-08, 0.47106256342d+01, 0.16937925621d+03,
     .        0.17024468441d-08, 0.14522345051d+01, 0.33385759013d+03 /

*     Sun-to-Earth, t^0, y
      data ((e0(i,j,2),i=1,3),j=1,10) /
     .        0.99989211030d+00, 0.18265890456d+00, 0.62830758500d+01,
     .        0.24426990365d-01, 0.31415926597d+01, 0.00000000000d+00,
     .        0.83529231352d-02, 0.13952878991d+00, 0.12566151700d+02,
     .        0.10466964940d-03, 0.96416905576d-01, 0.18849227550d+02,
     .        0.31108378230d-04, 0.53811412607d+01, 0.83996847318d+02,
     .        0.25703384611d-04, 0.53010397336d+01, 0.52969096509d+00,
     .        0.21474732013d-04, 0.26625353890d+01, 0.15773435424d+01,
     .        0.17092189532d-04, 0.52078040107d+01, 0.62795527316d+01,
     .        0.17079869619d-04, 0.17008567195d+01,-0.62865989683d+01,
     .        0.14402647698d-04, 0.43825036605d+01,-0.23528661538d+01 /
      data ((e0(i,j,2),i=1,3),j=11,20) /
     .        0.11350919213d-04, 0.52731341522d+01, 0.52236939198d+01,
     .        0.93453922442d-05, 0.45030120184d+01, 0.12036460735d+02,
     .        0.90056503941d-05, 0.16056328812d+01, 0.10213285546d+02,
     .        0.56712590253d-05, 0.58142248753d+00, 0.10593819302d+01,
     .        0.74493163854d-05, 0.34758965883d+01,-0.39814900341d+00,
     .        0.63931553824d-05, 0.60292391502d+01, 0.57533848849d+01,
     .        0.68132402878d-05, 0.56358890322d+01,-0.47057323075d+01,
     .        0.61134731523d-05, 0.38138149529d+01, 0.68127668151d+01,
     .        0.45043502751d-05, 0.45278557249d+01, 0.58849268466d+01,
     .        0.45201792750d-05, 0.29151288010d+00,-0.62567775302d+01 /
      data ((e0(i,j,2),i=1,3),j=21,30) /
     .        0.44996809750d-05, 0.37988037559d+01, 0.63093741698d+01,
     .        0.55139015394d-05, 0.39612524937d+01, 0.55075532387d+01,
     .        0.40633414236d-05, 0.52561626803d+01, 0.66812248534d+01,
     .        0.54127331998d-05, 0.78415724801d+00,-0.77552261132d+00,
     .        0.54636002870d-05, 0.61731113178d+01, 0.14143495242d+02,
     .        0.50708376130d-05, 0.28702519338d+01, 0.78604193924d+01,
     .        0.21950398546d-05, 0.29521613957d+01, 0.11506769770d+02,
     .        0.22793728551d-05, 0.33139281904d+00,-0.70585984613d+01,
     .        0.22779230003d-05, 0.48454707473d+01, 0.46940029547d+01,
     .        0.25584529888d-05, 0.69454231563d+00, 0.12168002697d+02 /
      data ((e0(i,j,2),i=1,3),j=31,40) /
     .        0.25613170431d-05, 0.61672254697d+01, 0.70993304836d+00,
     .        0.17924222159d-05, 0.48831508470d+01,-0.79629800682d+00,
     .        0.17828011624d-05, 0.11660097849d+01,-0.62830085397d+01,
     .        0.17828011624d-05, 0.46730725525d+01, 0.62831431603d+01,
     .        0.15545442986d-05, 0.53405254342d-01, 0.25132303400d+02,
     .        0.20625680432d-05, 0.42836672888d+01, 0.11790629089d+02,
     .        0.14976900150d-05, 0.60742902328d+01, 0.54867778432d+01,
     .        0.20000472907d-05, 0.25014408812d+01, 0.17789845620d+02,
     .        0.12900567999d-05, 0.26369482208d+01,-0.70793738568d+01,
     .        0.12821130677d-05, 0.30506370934d+01,-0.37387614301d+01 /
      data ((e0(i,j,2),i=1,3),j=41,50) /
     .        0.15279006978d-05, 0.55812080045d+01, 0.21329909544d+00,
     .        0.11872525654d-05, 0.54536149049d+01, 0.94377629349d+01,
     .        0.78419319323d-06, 0.28253093914d+00, 0.88273902699d+01,
     .        0.73513460026d-06, 0.11243337188d+01, 0.15890728953d+01,
     .        0.65693541864d-06, 0.20889858706d+01, 0.11769853693d+02,
     .        0.63239697265d-06, 0.56127403915d+01,-0.62623004545d+01,
     .        0.62961474439d-06, 0.28364975600d+01, 0.63038512455d+01,
     .        0.85870264027d-06, 0.14535118674d+01, 0.16728376159d+03,
     .        0.80739841312d-06, 0.92225805400d+00, 0.60697767546d+01,
     .        0.83511113517d-06, 0.46322352730d+01, 0.33406124267d+01 /
      data ((e0(i,j,2),i=1,3),j=51,60) /
     .        0.60039069386d-06, 0.44543964200d+01,-0.41369104335d+01,
     .        0.75625755758d-06, 0.25886072612d+01, 0.64963749454d+01,
     .        0.58088780203d-06, 0.55165509745d+00, 0.10977078805d+02,
     .        0.53746877932d-06, 0.76458230170d-02,-0.11944470102d+01,
     .        0.57574048972d-06, 0.11080213427d+01, 0.62820955289d+01,
     .        0.57574048972d-06, 0.38842657308d+01,-0.62840561711d+01,
     .        0.51141308279d-06, 0.60245804677d+01, 0.62901893970d+01,
     .        0.50679473350d-06, 0.37713377989d+01, 0.62759623030d+01,
     .        0.49613109658d-06, 0.52102814059d+01,-0.61276554506d+01,
     .        0.47933970505d-06, 0.24317695224d+01, 0.64384962494d+01 /
      data ((e0(i,j,2),i=1,3),j=61,70) /
     .        0.61132792761d-06, 0.53433572124d+01, 0.31546870849d+01,
     .        0.47359251037d-06, 0.17471058541d+01,-0.31283887651d+01,
     .        0.48378591572d-06, 0.25856696781d+00, 0.70848967811d+01,
     .        0.51293198594d-06, 0.42136783456d+01, 0.12352852605d+02,
     .        0.50630156588d-06, 0.48144235092d+00, 0.11856218652d+02,
     .        0.37539375633d-06, 0.16004060361d+01, 0.84292412665d+01,
     .        0.49347030164d-06, 0.21574011399d+01, 0.25443144199d+01,
     .        0.39554807822d-06, 0.29237524654d+01,-0.54812549189d+01,
     .        0.48912785217d-06, 0.51653104904d+01, 0.92255392733d+01,
     .        0.42134769540d-06, 0.20653256004d+01, 0.17260154655d+02 /
      data ((e0(i,j,2),i=1,3),j=71,80) /
     .        0.31140206986d-06, 0.36157956873d+01, 0.21461654165d+01,
     .        0.32603145651d-06, 0.44180662617d+01, 0.41643119896d+01,
     .        0.39728415415d-06, 0.47004886345d+01, 0.58564776591d+01,
     .        0.28514707330d-06, 0.17446514175d+01,-0.12569674818d+02,
     .        0.36367806684d-06, 0.13341649002d+01, 0.18073704939d+02,
     .        0.30329299618d-06, 0.58599391633d+01,-0.45350594369d+01,
     .        0.26741223383d-06, 0.59717288216d+01, 0.39302096962d+01,
     .        0.28166292015d-06, 0.51936622291d+01, 0.12562628582d+02,
     .        0.24843011031d-06, 0.10026532601d+01, 0.50886288398d+01,
     .        0.21641590715d-06, 0.30644452648d+01, 0.12559038153d+02 /
      data ((e0(i,j,2),i=1,3),j=81,90) /
     .        0.25700738641d-06, 0.75895390818d+00, 0.13367972631d+02,
     .        0.20498198282d-06, 0.34443538454d+01, 0.11371704690d+02,
     .        0.25997039229d-06, 0.44100571764d+01,-0.71430695618d+02,
     .        0.23245891123d-06, 0.46191003820d+01, 0.18319536585d+02,
     .        0.17077225442d-06, 0.98596314441d+00,-0.49332084403d+01,
     .        0.21069903247d-06, 0.40535905359d+01,-0.74775228602d+01,
     .        0.17511755755d-06, 0.61619258929d+01, 0.10447387840d+02,
     .        0.20024350457d-06, 0.29682318100d+01, 0.80310922631d+01,
     .        0.13830516983d-06, 0.32586800209d+01,-0.86359420038d+01,
     .        0.18884383185d-06, 0.85614893134d+00, 0.15613747598d+03 /
      data ((e0(i,j,2),i=1,3),j=91,100) /
     .        0.13605256584d-06, 0.36264114503d+01, 0.13095842665d+02,
     .        0.15078171898d-06, 0.15513222473d+01, 0.16496361396d+02,
     .        0.17985046534d-06, 0.20774121131d+01, 0.17298182327d+02,
     .        0.14386055754d-06, 0.61489873293d+01, 0.20426571092d+02,
     .        0.12226967104d-06, 0.43835942374d+01, 0.76329432597d+01,
     .        0.13375995041d-06, 0.20361688707d+01, 0.12139553509d+02,
     .        0.11582763431d-06, 0.23934719711d+01,-0.53313574437d+01,
     .        0.13558346021d-06, 0.14466633150d+01, 0.16730463690d+02,
     .        0.14331862480d-06, 0.44567869373d+01, 0.73424577802d+01,
     .        0.12375117188d-06, 0.47445624124d+01,-0.62794854213d+01 /
      data ((e0(i,j,2),i=1,3),j=101,110) /
     .        0.12366042453d-06, 0.19683181487d+01, 0.62866662786d+01,
     .        0.12445620486d-06, 0.57809491853d+01, 0.15110466120d+02,
     .        0.10988888699d-06, 0.56627818706d+01,-0.10988808158d+02,
     .        0.12556168105d-06, 0.25919480854d+01, 0.15720838785d+02,
     .        0.11582695314d-06, 0.38015272088d+01,-0.57295064471d+01,
     .        0.90229322158d-07, 0.38565502950d+01, 0.96236882767d+01,
     .        0.91210556914d-07, 0.58300604715d+01, 0.72347942562d+01,
     .        0.88687026604d-07, 0.34761126529d+01, 0.61480107700d+01,
     .        0.86135877040d-07, 0.62523694142d+01,-0.64181409300d+01,
     .        0.82930326317d-07, 0.85407021371d+00, 0.14712317116d+02 /
      data ((e0(i,j,2),i=1,3),j=111,120) /
     .        0.10126343247d-06, 0.99630008630d+00, 0.68366452528d+01,
     .        0.10480044570d-06, 0.49010922879d+01,-0.59992165311d+01,
     .        0.98197229675d-07, 0.21247665514d+01, 0.65669351689d+01,
     .        0.75454361076d-07, 0.33475086288d+00,-0.12539853380d+02,
     .        0.95401257321d-07, 0.34961327171d+01, 0.21228392024d+02,
     .        0.85443358348d-07, 0.18282930186d+01, 0.11015106477d+02,
     .        0.61577407712d-07, 0.56585267523d+01, 0.12964300703d+02,
     .        0.74140788861d-07, 0.34672043362d+01, 0.23543230505d+02,
     .        0.63887915020d-07, 0.24058007146d+01, 0.24072921470d+02,
     .        0.69764768996d-07, 0.47662636149d+01, 0.10973555686d+02 /
      data ((e0(i,j,2),i=1,3),j=121,130) /
     .        0.74588436316d-07, 0.27113389887d+01, 0.22003914635d+02,
     .        0.53756693831d-07, 0.23496850550d+01, 0.14314168113d+02,
     .        0.75274578592d-07, 0.19439212707d+01, 0.18422629359d+02,
     .        0.62216419365d-07, 0.67296135144d+00, 0.18451078547d+02,
     .        0.53855883876d-07, 0.54063398464d+01, 0.77713771468d+02,
     .        0.63324312172d-07, 0.28372509871d+01, 0.26087903142d+02,
     .        0.61963329193d-07, 0.21253148713d+01,-0.84672475845d+02,
     .        0.61599739773d-07, 0.32117053929d+01, 0.23942439025d+03,
     .        0.48634517039d-07, 0.21964278113d+01, 0.90279923168d+02,
     .        0.52744943754d-07, 0.49168703669d+01, 0.25158601720d+02 /
      data ((e0(i,j,2),i=1,3),j=131,140) /
     .        0.39801005407d-07, 0.37401320094d+00,-0.13341674311d+02,
     .        0.32899591913d-07, 0.95752698537d+00, 0.16200772725d+02,
     .        0.30601537929d-07, 0.16314239850d+01, 0.18052929543d+02,
     .        0.25354259854d-07, 0.12310788878d-01, 0.31415379250d+02,
     .        0.35197838835d-07, 0.38090678085d+01, 0.25057067586d+03,
     .        0.30488757625d-07, 0.52288733081d-01, 0.29088811416d+02,
     .        0.25999735644d-07, 0.39310981965d+01, 0.19651048481d+02,
     .        0.24363645369d-07, 0.28368983869d+01, 0.95143132921d+02,
     .        0.18401338810d-07, 0.43660748937d+01,-0.65147619768d+02,
     .        0.17946426070d-07, 0.14716188617d+01, 0.33019021112d+02 /
      data ((e0(i,j,2),i=1,3),j=141,ne0y) /
     .        0.12155343051d-07, 0.66921706110d+00,-0.82576981221d+02,
     .        0.91718220460d-08, 0.89920097468d+00, 0.14985440013d+03,
     .        0.72357418957d-08, 0.14965190844d+01, 0.16100068574d+03,
     .        0.53537942983d-08, 0.45519766171d+01, 0.17356683744d+03,
     .        0.60294674626d-08, 0.55672605800d+01, 0.32271130452d+03,
     .        0.56934607507d-08, 0.13816490973d+01, 0.97238627545d+02,
     .        0.43868663667d-08, 0.32548804863d+01, 0.23314131440d+03,
     .        0.49926367731d-08, 0.11548229990d+01, 0.16171061879d+03,
     .        0.31879542420d-08, 0.31397768900d+01, 0.16937925621d+03,
     .        0.17024459832d-08, 0.61646237304d+01, 0.33385759013d+03 /

*     Sun-to-Earth, t^0, z
      data ((e0(i,j,3),i=1,3),j=1,10) /
     .        0.27962033604d-05, 0.31987015602d+01, 0.84334661581d+02,
     .        0.10162537517d-05, 0.54224811060d+01, 0.55075532387d+01,
     .        0.80461395929d-06, 0.38802715791d+01, 0.52236939198d+01,
     .        0.43855309181d-06, 0.25788818300d+01,-0.23528661538d+01,
     .        0.31853475791d-06, 0.39999784099d+01, 0.15773435424d+01,
     .        0.16395122504d-06, 0.35645616252d+01, 0.58564776591d+01,
     .        0.18149502372d-06, 0.49847961332d+01, 0.62830758500d+01,
     .        0.14477270126d-06, 0.37025842346d+01, 0.94377629349d+01,
     .        0.14325029210d-06, 0.34102024693d+01, 0.10213285546d+02,
     .        0.11203921037d-06, 0.48302149910d+01, 0.14143495242d+02 /
      data ((e0(i,j,3),i=1,3),j=11,20) /
     .        0.10895639357d-06, 0.20802370832d+01, 0.68127668151d+01,
     .        0.10362653709d-06, 0.40566399727d+01, 0.71092881355d+02,
     .        0.87916828146d-07, 0.44489072928d+01, 0.57533848849d+01,
     .        0.83370731001d-07, 0.49916770605d+01, 0.70848967811d+01,
     .        0.91451614815d-07, 0.51413591869d+01,-0.66208901134d+01,
     .        0.76978522653d-07, 0.55542574588d+01, 0.16762157585d+03,
     .        0.51856872374d-07, 0.62538453313d+01, 0.18073704939d+02,
     .        0.40245999856d-07, 0.51199028562d+01, 0.13367972631d+02,
     .        0.26798688712d-07, 0.13949735929d+01, 0.22003914635d+02,
     .        0.16926245038d-07, 0.49568945446d+01, 0.15647529025d+03 /
      data ((e0(i,j,3),i=1,3),j=21,ne0z) /
     .        0.55238532921d-08, 0.10292650963d+01, 0.23976220452d+03,
     .        0.31565676251d-08, 0.16266280501d+01, 0.25090849012d+03 /

*     Sun-to-Earth, t^1, x
      data ((e1(i,j,1),i=1,3),j=1,ne1x) /
     .        0.12340305551d-05, 0.20143279489d-07, 0.00000000000d+00,
     .        0.51500156052d-06, 0.60026626720d+01, 0.12566151700d+02,
     .        0.12907264593d-07, 0.59594312458d+01, 0.18849227550d+02,
     .        0.10686270429d-07, 0.20155417655d+01, 0.62830758500d+01,
     .        0.21268872078d-08, 0.17338019049d+01, 0.62795527316d+01,
     .        0.21251496068d-08, 0.13682915969d+01,-0.62865989683d+01,
     .        0.28763397141d-09, 0.59161898951d+01, 0.25132303400d+02 /

*     Sun-to-Earth, t^1, y
      data ((e1(i,j,2),i=1,3),j=1,ne1y) /
     .        0.93046324140d-06, 0.62831852717d+01, 0.00000000000d+00,
     .        0.51506609338d-06, 0.44318049929d+01, 0.12566151700d+02,
     .        0.12907995597d-07, 0.43886054854d+01, 0.18849227550d+02,
     .        0.46455005679d-08, 0.58272991295d+01, 0.62830758500d+01,
     .        0.21268872564d-08, 0.16300556918d+00, 0.62795527316d+01,
     .        0.21253305418d-08, 0.29391793531d+01,-0.62865989683d+01,
     .        0.28763397124d-09, 0.43453935562d+01, 0.25132303400d+02 /

*     Sun-to-Earth, t^1, z
      data ((e1(i,j,3),i=1,3),j=1,ne1z) /
     .        0.22782244175d-05, 0.34137250428d+01, 0.62830758500d+01,
     .        0.54292815273d-07, 0.00000000000d+00, 0.00000000000d+00,
     .        0.19031830439d-07, 0.33706127096d+01, 0.12566151700d+02,
     .        0.70899759448d-10, 0.23290735258d+01, 0.83996847318d+02 /

*     Sun-to-Earth, t^2, x
      data ((e2(i,j,1),i=1,3),j=1,ne2x) /
     .        0.21756954829d-10, 0.43999984957d+01, 0.12566151700d+02,
     .        0.99523301344d-11, 0.20790847155d+00, 0.62830758500d+01 /

*     Sun-to-Earth, t^2, z
      data ((e2(i,j,2),i=1,3),j=1,ne2y) /
     .        0.21780160243d-10, 0.28295754423d+01, 0.12566151700d+02,
     .        0.10204866070d-10, 0.46374671860d+01, 0.62830758500d+01 /

*     Sun-to-Earth, t^2, z
      data ((e2(i,j,3),i=1,3),j=1,ne2z) /
     .        0.97219886588d-10, 0.51523372591d+01, 0.62830758500d+01 /

*     SSB-to-Sun, t^0, x
      data ((s0(i,j,1),i=1,3),j=1,10) /
     .        0.49567273861d-02, 0.37410735679d+01, 0.52969096509d+00,
     .        0.27180237564d-02, 0.40160114977d+01, 0.21329909544d+00,
     .        0.15543567471d-02, 0.21705205006d+01, 0.38133035638d-01,
     .        0.83792996742d-03, 0.23396798552d+01, 0.74781598567d-01,
     .        0.29374249434d-03, 0.00000000000d+00, 0.00000000000d+00,
     .        0.12013079361d-03, 0.40907322490d+01, 0.10593819302d+01,
     .        0.75772567448d-04, 0.32415189735d+01, 0.42659819088d+00,
     .        0.19413804216d-04, 0.10121947410d+01, 0.20618554844d+00,
     .        0.19406490596d-04, 0.47976996366d+01, 0.14956319713d+00,
     .        0.18888312417d-04, 0.23906572635d+01,-0.22041264244d+00 /
      data ((s0(i,j,1),i=1,3),j=11,20) /
     .        0.14342081080d-04, 0.38689536378d+01, 0.52257741809d+00,
     .        0.14063672640d-04, 0.58072019557d+01,-0.53680451210d+00,
     .        0.11858352845d-04, 0.77770585045d+00, 0.76266071276d-01,
     .        0.81368494152d-05, 0.32548361188d+01, 0.36648562930d-01,
     .        0.76707433759d-05, 0.20557479880d+01,-0.39617508346d-01,
     .        0.62481355126d-05, 0.27936466811d+00, 0.73297125859d-01,
     .        0.43663983393d-05, 0.44404465509d+01, 0.15890728953d+01,
     .        0.37914526197d-05, 0.11267765597d+01,-0.71135470008d-02,
     .        0.31539285644d-05, 0.61569985463d+01, 0.41948464388d+00,
     .        0.30878357420d-05, 0.24945665875d+01, 0.63989728631d+00 /
      data ((s0(i,j,1),i=1,3),j=21,30) /
     .        0.27879454898d-05, 0.13488666037d+01,-0.11020632122d+00,
     .        0.30399339541d-05, 0.48950784171d+01, 0.62830758500d+01,
     .        0.22718752424d-05, 0.52783981381d+01, 0.10309277422d+00,
     .        0.21616158739d-05, 0.58029803212d+01, 0.31639186966d+00,
     .        0.17676361283d-05, 0.34165250455d-01, 0.10213285546d+02,
     .        0.13579152103d-05, 0.42816750975d+01,-0.14844727083d-02,
     .        0.11699317007d-05, 0.24247525557d+01, 0.63278373931d+00,
     .        0.10541281531d-05, 0.31598631687d+01,-0.43371173788d+00,
     .        0.97988392780d-06, 0.30262646137d+01, 0.10522683832d+01,
     .        0.10910112178d-05, 0.31578128261d+01, 0.11624747044d+01 /
      data ((s0(i,j,1),i=1,3),j=31,40) /
     .        0.69587605442d-06, 0.82196495080d+00, 0.10664954772d+01,
     .        0.56881902008d-06, 0.13230457870d+01, 0.94917560897d+00,
     .        0.66119935850d-06, 0.27653561007d+00, 0.84608283475d+00,
     .        0.63189253308d-06, 0.57943668483d+01, 0.14807872443d+00,
     .        0.63138675005d-06, 0.73209797865d+00, 0.22434479570d+00,
     .        0.48978625004d-06, 0.30624442437d+01, 0.33406124267d+01,
     .        0.37824056747d-06, 0.45889170116d+01, 0.35164090221d-01,
     .        0.31150227708d-06, 0.13742968189d+01, 0.63735898303d-01,
     .        0.30681995544d-06, 0.20607161356d+01,-0.11045700264d-01,
     .        0.28741439119d-06, 0.37139882902d+01, 0.15104766984d+00 /
      data ((s0(i,j,1),i=1,3),j=41,50) /
     .        0.28579776770d-06, 0.34359654916d+01,-0.41101981054d-01,
     .        0.23781978020d-06, 0.25211117637d+01,-0.22752618944d+00,
     .        0.23267014623d-06, 0.58149142610d+01,-0.85827298831d-01,
     .        0.22743918420d-06, 0.16701253971d+01, 0.71812653151d-01,
     .        0.18817756027d-06, 0.47905653898d+01, 0.21187638604d+01,
     .        0.22286292400d-06, 0.23458396155d+01,-0.29689454166d-02,
     .        0.21992253501d-06, 0.61708634617d+01,-0.77750543984d-01,
     .        0.20026309315d-06, 0.22539533341d+01,-0.20936694217d+00,
     .        0.19681060059d-06, 0.87544248531d+00, 0.21723124870d+00,
     .        0.19075241068d-06, 0.59197392985d+01, 0.20225339517d+00 /
      data ((s0(i,j,1),i=1,3),j=51,60) /
     .        0.16571063033d-06, 0.25491133793d+01, 0.73587651353d+00,
     .        0.15737796681d-06, 0.52775452444d+01, 0.74299006053d+00,
     .        0.18319046442d-06, 0.32184568210d+01,-0.32350541666d+00,
     .        0.17359640072d-06, 0.30113766127d+01, 0.13851749687d+00,
     .        0.15487911992d-06, 0.40054222097d+01, 0.51546387109d+00,
     .        0.16367334709d-06, 0.18313788091d+01, 0.85319638175d+00,
     .        0.11229339917d-06, 0.11802936755d+01, 0.19907200144d+00,
     .        0.10835745654d-06, 0.59415715996d+01,-0.54391805910d+00,
     .        0.11586769550d-06, 0.56724278653d+01,-0.52575881183d+00,
     .        0.11447242818d-06, 0.37270425577d+01, 0.53362311836d+00 /
      data ((s0(i,j,1),i=1,3),j=61,70) /
     .        0.79204069036d-07, 0.24354795839d+01, 0.14788665741d+01,
     .        0.83219671337d-07, 0.35250362182d+01, 0.16921656695d+01,
     .        0.71851495148d-07, 0.27636302118d+01,-0.21648048918d+00,
     .        0.70148765696d-07, 0.13885521307d+01, 0.21011770170d+00,
     .        0.71202828521d-07, 0.24605585995d+01, 0.41555249061d+00,
     .        0.72255520598d-07, 0.40426725784d+01, 0.12655674786d+01,
     .        0.69545447600d-07, 0.28650195280d+01, 0.95628915597d+00,
     .        0.74934617810d-07, 0.12688798329d+01,-0.14227094002d-01,
     .        0.73797517895d-07, 0.32730220882d+01, 0.15819593483d+01,
     .        0.62332771285d-07, 0.12549046205d+01, 0.26087903142d+02 /
      data ((s0(i,j,1),i=1,3),j=71,ns0x) /
     .        0.43586693438d-07, 0.60967414268d+00, 0.13757737998d+01,
     .        0.37582416631d-07, 0.11673703200d+01, 0.15961864423d+01,
     .        0.25392470278d-07, 0.48519130038d+01, 0.12566151700d+02,
     .        0.22831127902d-07, 0.34004855060d+01, 0.66812248534d+01,
     .        0.59822651483d-08, 0.91405116799d+00, 0.20426571092d+02,
     .        0.63470986728d-08, 0.43062163571d+01, 0.52175806283d+02,
     .        0.96865370418d-09, 0.10744012940d+01, 0.78263709425d+02 /

*     SSB-to-Sun, t^0, y
      data ((s0(i,j,2),i=1,3),j=1,10) /
     .        0.49553621823d-02, 0.21704671263d+01, 0.52969096509d+00,
     .        0.27218582134d-02, 0.24444336493d+01, 0.21329909544d+00,
     .        0.15544431252d-02, 0.59927010840d+00, 0.38133035638d-01,
     .        0.83755792225d-03, 0.76880164710d+00, 0.74781598567d-01,
     .        0.33869535278d-03, 0.00000000000d+00, 0.00000000000d+00,
     .        0.12011827159d-03, 0.25200314788d+01, 0.10593819302d+01,
     .        0.75858301682d-04, 0.16699548322d+01, 0.42659819088d+00,
     .        0.19637431708d-04, 0.57077365584d+01, 0.20618554844d+00,
     .        0.18915030215d-04, 0.39622170971d+01,-0.22041264244d+00,
     .        0.19401243650d-04, 0.32268613046d+01, 0.14956319713d+00 /
      data ((s0(i,j,2),i=1,3),j=11,20) /
     .        0.14368411840d-04, 0.23016196808d+01, 0.52257741809d+00,
     .        0.14059749555d-04, 0.10945992284d+01,-0.53680451210d+00,
     .        0.11855147436d-04, 0.54896932910d+01, 0.76266071276d-01,
     .        0.81307715717d-05, 0.16839344262d+01, 0.36648562930d-01,
     .        0.76712471912d-05, 0.36269807139d+01,-0.39617508346d-01,
     .        0.62878807064d-05, 0.49929563153d+01, 0.73297125859d-01,
     .        0.43663156257d-05, 0.28696982065d+01, 0.15890728953d+01,
     .        0.38284360203d-05, 0.27110454795d+01,-0.71135470008d-02,
     .        0.31751078360d-05, 0.45353638070d+01, 0.41948464388d+00,
     .        0.30919127419d-05, 0.92301535903d+00, 0.63989728631d+00 /
      data ((s0(i,j,2),i=1,3),j=21,30) /
     .        0.28736579635d-05, 0.29200444090d+01,-0.11020632122d+00,
     .        0.30401257639d-05, 0.33242515710d+01, 0.62830758500d+01,
     .        0.26992426545d-05, 0.29178785093d+00, 0.10309277422d+00,
     .        0.21344483787d-05, 0.42209973824d+01, 0.31639186966d+00,
     .        0.17704129582d-05, 0.47473313530d+01, 0.10213285546d+02,
     .        0.13857654246d-05, 0.58527454923d+01,-0.14844727083d-02,
     .        0.11276145179d-05, 0.85382170184d+00, 0.63278373931d+00,
     .        0.10553802620d-05, 0.47313734228d+01,-0.43371173788d+00,
     .        0.98007335223d-06, 0.14596591118d+01, 0.10522683832d+01,
     .        0.10901378502d-05, 0.15873518328d+01, 0.11624747044d+01 /
      data ((s0(i,j,2),i=1,3),j=31,40) /
     .        0.69581325672d-06, 0.55344484561d+01, 0.10664954772d+01,
     .        0.56638455017d-06, 0.60306763281d+01, 0.94917560897d+00,
     .        0.66066120756d-06, 0.49895069635d+01, 0.84608283475d+00,
     .        0.63109206600d-06, 0.42232558314d+01, 0.14807872443d+00,
     .        0.63108445456d-06, 0.54440608211d+01, 0.22434479570d+00,
     .        0.48909842695d-06, 0.14905211289d+01, 0.33406124267d+01,
     .        0.34784134515d-06, 0.30311366542d+01, 0.35164090221d-01,
     .        0.30365600598d-06, 0.36309337012d+01,-0.11045700264d-01,
     .        0.28581762892d-06, 0.50071893725d+01,-0.41101981054d-01,
     .        0.28733494706d-06, 0.21431524563d+01, 0.15104766984d+00 /
      data ((s0(i,j,2),i=1,3),j=41,50) /
     .        0.27687645029d-06, 0.54443360585d+01, 0.63735898303d-01,
     .        0.23815454786d-06, 0.40926656291d+01,-0.22752618944d+00,
     .        0.23456723469d-06, 0.95763350361d-01, 0.71812653151d-01,
     .        0.23256177028d-06, 0.11026799228d+01,-0.85827298831d-01,
     .        0.18818395712d-06, 0.32197877412d+01, 0.21187638604d+01,
     .        0.22104264600d-06, 0.39166929972d+01,-0.29689454166d-02,
     .        0.21981044039d-06, 0.14583357188d+01,-0.77750543984d-01,
     .        0.20051853678d-06, 0.38268076140d+01,-0.20936694217d+00,
     .        0.19691041449d-06, 0.55871307699d+01, 0.21723124870d+00,
     .        0.15681924040d-06, 0.37080081138d+01, 0.74299006053d+00 /
      data ((s0(i,j,2),i=1,3),j=51,60) /
     .        0.18551840892d-06, 0.43106163830d+01, 0.20225339517d+00,
     .        0.18317969791d-06, 0.47884726324d+01,-0.32350541666d+00,
     .        0.17491635643d-06, 0.14513147159d+01, 0.13851749687d+00,
     .        0.15554477810d-06, 0.10680592516d+01, 0.73587651353d+00,
     .        0.15545149897d-06, 0.24424473885d+01, 0.51546387109d+00,
     .        0.16381229333d-06, 0.25980625854d+00, 0.85319638175d+00,
     .        0.11594947875d-06, 0.58345147743d+01, 0.19907200144d+00,
     .        0.10832658063d-06, 0.12289556271d+01,-0.54391805910d+00,
     .        0.11585283487d-06, 0.95982388837d+00,-0.52575881183d+00,
     .        0.11434909230d-06, 0.21557341185d+01, 0.53362311836d+00 /
      data ((s0(i,j,2),i=1,3),j=61,70) /
     .        0.79123154267d-07, 0.86429104720d+00, 0.14788665741d+01,
     .        0.83185165760d-07, 0.19543535106d+01, 0.16921656695d+01,
     .        0.71956945163d-07, 0.43351618038d+01,-0.21648048918d+00,
     .        0.70361306185d-07, 0.60974334499d+01, 0.21011770170d+00,
     .        0.71476729554d-07, 0.89057242152d+00, 0.41555249061d+00,
     .        0.72450050579d-07, 0.24816602645d+01, 0.12655674786d+01,
     .        0.69600905215d-07, 0.12929089476d+01, 0.95628915597d+00,
     .        0.75685282706d-07, 0.28557488405d+01,-0.14227094002d-01,
     .        0.73742230446d-07, 0.17051341463d+01, 0.15819593483d+01,
     .        0.70398234106d-07, 0.48482036852d+00, 0.95979227218d-01 /
      data ((s0(i,j,2),i=1,3),j=71,ns0y) /
     .        0.63003901931d-07, 0.59793756775d+01, 0.26087903142d+02,
     .        0.43611161025d-07, 0.53225397229d+01, 0.13757737998d+01,
     .        0.37579473951d-07, 0.58798692875d+01, 0.15961864423d+01,
     .        0.25395477873d-07, 0.32810732530d+01, 0.12566151700d+02,
     .        0.22808304288d-07, 0.18290707197d+01, 0.66812248534d+01,
     .        0.59916959835d-08, 0.56272640983d+01, 0.20426571092d+02,
     .        0.63989276411d-08, 0.27465054354d+01, 0.52175806283d+02,
     .        0.97437339180d-09, 0.57965816156d+01, 0.78263709425d+02 /

*     SSB-to-Sun, t^0, z
      data ((s0(i,j,3),i=1,3),j=1,10) /
     .        0.11810647963d-03, 0.46078690233d+00, 0.21329909544d+00,
     .        0.11277700020d-03, 0.41689943638d+00, 0.52969096509d+00,
     .        0.48020482632d-04, 0.45826472337d+01, 0.38133035638d-01,
     .        0.11310462973d-04, 0.57587713904d+01, 0.74781598567d-01,
     .        0.11526559766d-04, 0.31415926536d+01, 0.00000000000d+00,
     .        0.32982012007d-05, 0.59787974711d+01, 0.42659819088d+00,
     .        0.27333494156d-05, 0.76652182727d+00, 0.10593819302d+01,
     .        0.94247212510d-06, 0.37101755287d+01, 0.20618554844d+00,
     .        0.81858592901d-06, 0.59440957117d+01,-0.22041264244d+00,
     .        0.40793205637d-06, 0.45519444489d+00, 0.52257741809d+00 /
      data ((s0(i,j,3),i=1,3),j=11,20) /
     .        0.31695148091d-06, 0.28377966780d+01,-0.53680451210d+00,
     .        0.24533531728d-06, 0.56649183190d+01, 0.36648562930d-01,
     .        0.26056723731d-06, 0.19317862873d+01, 0.14956319713d+00,
     .        0.23290769885d-06, 0.59167171366d+01,-0.39617508346d-01,
     .        0.19729703864d-06, 0.31678273124d+01, 0.76266071276d-01,
     .        0.21801076313d-06, 0.47388063647d+01,-0.71135470008d-02,
     .        0.14511501338d-06, 0.46994326144d+01,-0.11020632122d+00,
     .        0.13582158668d-06, 0.52399298995d+01, 0.63989728631d+00,
     .        0.10503670049d-06, 0.22669497952d+01, 0.31639186966d+00,
     .        0.10498428500d-06, 0.27114903360d+01, 0.41948464388d+00 /
      data ((s0(i,j,3),i=1,3),j=21,ns0z) /
     .        0.99348773315d-07, 0.11162028975d+01, 0.15890728953d+01,
     .        0.10483283525d-06, 0.34086510261d+01, 0.10213285546d+02,
     .        0.80404325528d-07, 0.37701074117d+01, 0.73297125859d-01,
     .        0.15813108056d-07, 0.62529460112d+00, 0.33406124267d+01,
     .        0.76391022850d-08, 0.51345434733d+01, 0.26087903142d+02 /

*     SSB-to-Sun, t^1, x
      data ((s1(i,j,1),i=1,3),j=1,10) /
     .        0.12960734909d-07, 0.31415926536d+01, 0.00000000000d+00,
     .        0.89741933793d-08, 0.11289200545d+01, 0.42659819088d+00,
     .        0.77691146026d-08, 0.27060039641d+01, 0.20618554844d+00,
     .        0.75363625845d-08, 0.40918675098d+01,-0.22041264244d+00,
     .        0.60603401798d-08, 0.32481567970d+01, 0.10593819302d+01,
     .        0.57256706428d-08, 0.55699450613d+01, 0.52257741809d+00,
     .        0.56151962904d-08, 0.12257631631d+01,-0.53680451210d+00,
     .        0.10107512079d-08, 0.28095550479d+01,-0.71135470008d-02,
     .        0.72583690860d-09, 0.36521293891d+00, 0.63989728631d+00,
     .        0.87529511334d-09, 0.16627929556d+01, 0.41948464388d+00 /
      data ((s1(i,j,1),i=1,3),j=11,ns1x) /
     .        0.44073484950d-09, 0.35987399368d+01, 0.15890728953d+01 /

*     SSB-to-Sun, t^1, y
      data ((s1(i,j,2),i=1,3),j=1,ns1y) /
     .        0.89874668416d-08, 0.58406215769d+01, 0.42659819088d+00,
     .        0.78139228513d-08, 0.11296279712d+01, 0.20618554844d+00,
     .        0.75489813068d-08, 0.56634909194d+01,-0.22041264244d+00,
     .        0.60555143025d-08, 0.16774843161d+01, 0.10593819302d+01,
     .        0.57328165067d-08, 0.40008843350d+01, 0.52257741809d+00,
     .        0.56130448242d-08, 0.27964266516d+01,-0.53680451210d+00,
     .        0.10284714140d-08, 0.44060165598d+01,-0.71135470008d-02,
     .        0.72695309970d-09, 0.50771890727d+01, 0.63989728631d+00,
     .        0.87320079217d-09, 0.90652803198d-01, 0.41948464388d+00,
     .        0.44061217699d-09, 0.20279583077d+01, 0.15890728953d+01 /

*     SSB-to-Sun, t^1, z
      data ((s1(i,j,3),i=1,3),j=1,ns1z) /
     .        0.54434326078d-08, 0.18038371698d+01, 0.21329909544d+00,
     .        0.38823423192d-08, 0.46685522117d+01, 0.52969096509d+00,
     .        0.13339814285d-08, 0.00000000000d+00, 0.00000000000d+00 /


*     Time since reference epoch, days.
      t=((dj(1)-dj0)+dj(2))/365.25d0
      t2=t*t

*     X then Y then Z
      do k=1,3

*        Initialize position and velocity component.
         xyz=0d0
         xyzd=0d0

*        ------------------------------------------------
*        Obtain component of Sun to Earth ecliptic vector
*        ------------------------------------------------

*        Sun to Earth, t^0 terms.
         do i=1,ne0(k)
            a=e0(1,i,k)
            b=e0(2,i,k)
            c=e0(3,i,k)
            p=b+c*t
            xyz=xyz+a*cos(p)
            xyzd=xyzd-a*c*sin(p)
         end do

*        Sun to Earth, t^1 terms.
         do i=1,ne1(k)
            a=e1(1,i,k)
            b=e1(2,i,k)
            c=e1(3,i,k)
            ct=c*t
            p=b+ct
            cp=cos(p)
            xyz=xyz+a*t*cp
            xyzd=xyzd+a*(cp-ct*sin(p))
         end do

*        Sun to Earth, t^2 terms.
         do i=1,ne2(k)
            a=e2(1,i,k)
            b=e2(2,i,k)
            c=e2(3,i,k)
            ct=c*t
            p=b+ct
            cp=cos(p)
            xyz=xyz+a*t2*cp
            xyzd=xyzd+a*t*(2d0*cp-ct*sin(p))
         end do

*        Heliocentric Earth position and velocity component.
         ph(k)=xyz*au
         vh(k)=xyzd*vms

*        --------------------------------------------------------------------
*        Obtain component of Solar-System Barycenter to Earth ecliptic vector
*        --------------------------------------------------------------------

*        SSB to Sun, t^0 terms.
         do i=1,ns0(k)
            a=s0(1,i,k)
            b=s0(2,i,k)
            c=s0(3,i,k)
            p=b+c*t
            xyz=xyz+a*cos(p)
            xyzd=xyzd-a*c*sin(p)
         end do

*        SSB to Sun, t^1 terms.
         do i=1,ns1(k)
            a=s1(1,i,k)
            b=s1(2,i,k)
            c=s1(3,i,k)
            ct=c*t
            p=b+ct
            cp=cos(p)
            xyz=xyz+a*t*cp
            xyzd=xyzd+a*(cp-ct*sin(p))
         end do

*        Barycentric Earth position and velocity component.
         pb(k)=xyz*au
         vb(k)=xyzd*vms

*        Next cartesian component.
      end do

*     ---------------------------------------------------------------------
*     Rotate from ecliptic to equatorial coordinates and return the results
*     ---------------------------------------------------------------------

      x=ph(1)
      y=ph(2)
      z=ph(3)
      xyzhel(1,1)=x
      xyzhel(2,1)=y*cose-z*sine
      xyzhel(3,1)=y*sine+z*cose

      x=vh(1)
      y=vh(2)
      z=vh(3)
      xyzhel(1,2)=x
      xyzhel(2,2)=y*cose-z*sine
      xyzhel(3,2)=y*sine+z*cose

      x=pb(1)
      y=pb(2)
      z=pb(3)
      xyzbar(1,1)=x
      xyzbar(2,1)=y*cose-z*sine
      xyzbar(3,1)=y*sine+z*cose

      x=vb(1)
      y=vb(2)
      z=vb(3)
      xyzbar(1,2)=x
      xyzbar(2,2)=y*cose-z*sine
      xyzbar(3,2)=y*sine+z*cose

      return
      end
