1 subroutine put_elements(lun,orbupd,cdrg,iyr,iday,sec,irec,init)
36 #include "nav_cnst.fin"
38 real*8 orbupd(6),cdrg,sec
39 real*8 orb1(6),orb2(6),secorb,secin
40 integer*4 iyr,iday,iyorb,idorb,idin,irec,lun,spare
41 integer*4 jd,jdr,jdo,i,nrecs
45 read(lun,err=990,rec=1) nrecs
52 if (irec.le.nrecs)
read (lun,rec=irec,err=990) iyorb,idorb,
53 * secorb,orb1,orb2,cdrg,forb,spare
61 idorb = iday + sec/864.d2
65 if (idorb.ge.365)
then
66 jdr =
jd(iyorb,1,idorb)
67 call jdate(jdr,iyorb,idorb)
69 secorb = mod(sec,864.d2)
70 print *,
'PUT_ELEMENTS:',irec,iyorb,idorb,secorb
71 print *,orb1,cdrg,forb
72 write (lun,rec=irec,err=991) iyorb,idorb,secorb,orb1,orb2,
76 if (irec.gt.nrecs)
then
78 write(lun,rec=1,err=991) nrecs
86 read (lun,rec=irec,err=990) iyorb,idorb,secorb,orb1,orb2,
88 idin = iday + sec/864.d2
89 secin = mod(sec,864.d2)
90 jdo =
jd(iyorb,1,idorb)
92 if ((jdo.ne.jdr).or.(secorb.ne.secin))
then
93 print *,
'PUT_ELEMENTS: Input time does not match record',
102 print *,
'PUT_ELEMENTS:',irec,iyorb,idorb,secorb
103 print *,orb2,cdrg,forb
104 write (lun,rec=irec,err=991) iyorb,idorb,secorb,orb1,orb2,
111 990 print *,
'PUT_ELEMENTS: Error reading elements file'
115 991 print *,
'PUT_ELEMENTS: Error writing elements file'