1 subroutine add_elements(orbinit,cdrg,iyinit,idinit,secinit,
2 * igyr,igday,secst,tdifmax,irec)
36 real*8 orbinit(6),secinit,secst,cdrg,ge,aj2,tdifmax
37 real*8 asap(6,1500),tsap(1500),tdif,orbupd(6)
38 integer*4 igyr,igday,jd,i,j,ilast,lun,jdl
39 integer*4 iyinit,idinit,irec,iddif,nstp,li,mi,iplt,ier
42 data ge/3.9860050d5/,aj2/0.10826270e-02/
43 data li/30/,mi/15/,iplt/0/,lun/17/
45 iddif =
jd(igyr,1,igday) -
jd(iyinit,1,idinit)
46 tdif = iddif*864.d2 + secst - secinit
47 print *,
'ADD_ELEMENTS: time difference',tdif
50 filnm =
'$ELEMENTS/elements.dat'
52 open(lun,file=filnm,status=
'old',access=
'direct',err=990,
57 dowhile(tdif.gt.tdifmax)
62 if (nstp.gt.1500) nstp = 1500
63 call asaps(li,mi,iplt,orbinit,iyinit,idinit,secinit,nstp,cdrg,
70 if ((asap(3,i).gt.0.).and.(asap(3,i-1)).lt.0.)
then
74 dowhile((ier.ne.0.).and.(i.le.nstp))
76 call vec2mean(asap(1,i),ge,aj2,orbinit,orbupd,ier)
86 orbinit(1) = orbupd(1)
88 orbinit(j) = orbupd(j)
90 idinit = idinit + tsap(ilast)/864.d2
93 if (idinit.ge.365)
then
94 jdl =
jd(iyinit,1,idinit)
95 call jdate(jdl,iyinit,idinit)
97 secinit = mod(tsap(ilast),864.d2)
98 iddif =
jd(igyr,1,igday) -
jd(iyinit,1,idinit)
99 tdif = iddif*864.d2 + secst - secinit
105 990 print *,
'PUT_ELEMENTS: Error opening elements file'