subroutine orb_save c c----------------------------------------------------------------------| c | c save the orbit parameters for the time specified. | c | c----------------------------------------------------------------------| c written by r. l. west bcss 3-dec-1987 | c----------------------------------------------------------------------| c modified by r. l. west bcss 7-nov-1991 | c incorporated the use of iwindow in determining when to | c collect the orbital parameters | c----------------------------------------------------------------------| c | c variable meaning | c *** *** | c | c----------------------------------------------------------------------| c | c common purpose | c *** *** | c | c----------------------------------------------------------------------| c | c sub/func purpose | c *** *** | c | c----------------------------------------------------------------------| c | c warning: | c | c does not check for year crossing!!! | c | c----------------------------------------------------------------------| c | c note: | c | c to be used in conjuction with the routine orboftr | c | c----------------------------------------------------------------------| c logical igot_orbit, in_inc c c integer*2 header(24), i, in, jdat(2812) integer*2 header(24), i, jdat(2812) c integer*4 in integer*4 ifirst(2), iflag1, iflag2, ims, iorbyd, iorboft, * iorbtime, irb_ms, irb_yd, ire_ms, ire_yd, * itime(2,13), iwb_ms,iwb_yd, iwe_ms, iwe_yd, iwindow, * iyd c real orbs(4,13), r c equivalence (jdat(1),header(1)) c data igot_orbit/.false./, * in_inc/.false./ c common /blktim/iyd,ims, * /maf1/jdat, * /orbdat/itime,orbs, * /orbit/iorboft,iwindow,iorbyd,iorbtime,in,ifirst c c----------------------------------------------------------------------- c *** calculate begin and end time of current record *** c----------------------------------------------------------------------- c irb_yd = iyd ire_yd = iyd irb_ms = ims ire_ms = irb_ms + 7999 if (ire_ms .ge. 86400000) then ire_ms = ire_ms - 86400000 ire_yd = ire_yd + 1 end if c c----------------------------------------------------------------------- c *** calculate search time interval *** c----------------------------------------------------------------------- c iwb_yd = iorbyd iwb_ms = iorbtime - iwindow if (iwb_ms .lt. 0) then iwb_ms = iwb_ms + 86400000 iwb_yd = iwb_yd - 1 end if iwe_yd = iorbyd iwe_ms = iorbtime + iwindow if (iwe_ms .ge. 86400000) then iwe_ms = iwe_ms - 86400000 iwe_yd = iwe_yd + 1 end if c* type *, iwb_ms,iorbtime,iwe_ms,irb_ms,ire_ms c c----------------------------------------------------------------------- c----------------------------------------------------------------------- c call cmptm2 (ire_yd, ire_ms, iwb_yd, iwb_ms, iflag1) call cmptm2 (irb_yd, irb_ms, iwe_yd, iwe_ms, iflag2) if (iflag1 .lt. 0) then ! record prior to orbit c* type *, 'before' return else if (iflag2 .gt. 0) then ! record after orbit c* type *, 'after' if (igot_orbit) then igot_orbit = .false. in_inc = .false. return end if in = in + 1 itime(1,in) = iorbyd itime(2,in) = iorbtime iorbtime = iorbtime + iorboft if (iorbtime .ge. 86400000) then iorbtime = iorbtime - 86400000 iorbyd = iorbyd + 1 end if return else ! record within interval call cmptm2 (irb_yd, irb_ms, iorbyd, iorbtime, iflag1) if (iflag1 .lt. 1) then c* type *, 'during before' if (.not. in_inc) then in = in + 1 in_inc = .true. end if c* type *, in itime(1,in) = irb_yd itime(2,in) = irb_ms r = 0.0 do i =1, 3 r = r + float(header(i+8)) * float(header(i+8)) * 1e-6 end do r = sqrt(r) orbs(1,in) = r orbs(2,in) = float(header(15)) * 0.01 orbs(3,in) = float(header(19)) * 0.01 orbs(4,in) = float(header(17)) * 0.01 igot_orbit = .true. else c* type *, 'during after' if (igot_orbit) then iorbtime = iorbtime + iorboft if (iorbtime .ge. 86400000) then iorbtime = iorbtime - 86400000 iorbyd = iorbyd + 1 end if igot_ornit = .false. in_inc = .false. return end if if (.not. in_inc) then in = in + 1 in_inc = .true. end if c* type *, in itime(1,in) = irb_yd itime(2,in) = irb_ms r = 0.0 do i =1, 3 r = r + float(header(i+8)) * float(header(i+8)) * 1e-6 end do r = sqrt(r) orbs(1,in) = r orbs(2,in) = float(header(15)) * 0.01 orbs(3,in) = float(header(19)) * 0.01 orbs(4,in) = float(header(17)) * 0.01 igot_orbit = .true. end if end if c c----------------------------------------------------------------------- c----------------------------------------------------------------------- c return end