subroutine orboftr c c----------------------------------------------------------------------| c | c determines how often to save the orbit parameters, the window | c of time over which they can be saved, and the time of the first | c save. | c | c----------------------------------------------------------------------| c written by r. l. west bcss 2-dec-1987 | c----------------------------------------------------------------------| c modified by r. l. west bcss 7-nov 1991 | c added the determination of the window | c----------------------------------------------------------------------| c | c variable meaning | c *** *** | c iorboft tell how often to save the orbital parameters | c iwindow tell the delta time interval over which the orbital| c can be looked for | c iorbyd the ydoy that is to be used for searching for the | c next set of orbital parameters | c iorbtime the milliseconds of day that is to be used for | c searching for the next set of orbital parameters | c in the number of orbital parameter sets saved | c ifirst(1) the ydoy that is to be used for searching for the | c first orbital parameters | c ifirst(2) the milliseconds of day of that is to be used for | c searching for the first orbital parameters | c | c----------------------------------------------------------------------| c | c common purpose | c *** *** | c fratms contains the start and stop times of the current | c frame, also the number of collection divisions | c orbit contains the orbital collection information | c | c----------------------------------------------------------------------| c | c sub/func purpose | c *** *** | c timdif calculates the time difference between two times | c | c----------------------------------------------------------------------| c | c note: | c | c this is to be used with the orbital parameter collection routine | c orb_save | c | c----------------------------------------------------------------------| c c integer*2 in, ndiv integer*4 in, ndiv c integer*4 ftms(4), iadd, idif, ifirst(2), iorboft, iorbtime, * iorbyd, iwindow c real*8 frame_times(4) c common /fratms/frame_times,ndiv, * /orbit/iorboft,iwindow,iorbyd,iorbtime,in,ifirst c c----------------------------------------------------------------------- c *** calculate length of plot in msec *** c----------------------------------------------------------------------- c ftms(1)=frame_times(1) ftms(2)=frame_times(2)/1000.0d0 ftms(3)=frame_times(3) ftms(4)=frame_times(4)/1000.0d0 call timdif (ftms(1),ftms(2),ftms(3),ftms(4),idif) c c----------------------------------------------------------------------- c *** see how often to save orbit parameters *** c----------------------------------------------------------------------- c if (idif .le. 0) then type '('' error in start and stop times !'')' stop else if (idif .le. 600000) then ! 10 min iorboft=60000 ! 1 min iwindow=8000 ! 8 sec else if (idif .le. 1200000) then ! 20 min iorboft=120000 ! 2 min iwindow=16000 ! 16 sec else if (idif .le. 1800000) then ! 30 min iorboft=180000 ! 3 min iwindow=24000 ! 24 sec else if (idif .le. 2400000) then ! 40 min iorboft=240000 ! 4 min iwindow=32000 ! 32 sec else if (idif .le. 3600000) then ! 60 min iorboft=300000 ! 5 min iwindow=40000 ! 40 sec else if (idif .le. 7200000) then ! 2 hr iorboft=600000 ! 10 min iwindow=80000 ! 80 sec else if (idif .le. 10800000) then ! 3 hr iorboft=900000 ! 15 min iwindow=120000 ! 120 sec else if (idif .le. 14400000) then ! 4 hr iorboft=1200000 ! 20 min iwindow=160000 ! 160 sec else if (idif .le. 18000000) then ! 5 hr iorboft=1800000 ! 30 min iwindow=240000 ! 240 sec else if (idif .le. 43200000) then ! 12 hr iorboft=3600000 ! 1 hr iwindow=480000 ! 480 sec else if (idif .le. 86400000) then ! 24 hr iorboft=7200000 ! 2 hr iwindow=960000 ! 960 sec else iorboft=1440000 ! 4 hr iwindow=1920000 ! 1920 sec end if c c----------------------------------------------------------------------- c *** calculate time of first save (no check for year) *** c----------------------------------------------------------------------- c iorbyd=ftms(1) idif=mod(ftms(2),iorboft) if (idif .gt. 0) then iadd=iorboft-idif else iadd=0 end if iorbtime=ftms(2)+iadd if (iorbtime .ge. 86400000) then iorbtime=iorbtime-86400000 iorbyd=iorbyd+1 end if ifirst(1)=iorbyd ifirst(2)=iorbtime c c----------------------------------------------------------------------- c----------------------------------------------------------------------- c in=0 c c----------------------------------------------------------------------- c----------------------------------------------------------------------- c return end