C+ C NAME: C Time2Day8 C PURPOSE: C Convert standard times to double precision day C (with fraction for time of day) and v.v. C CATEGORY: C gen/for/lib C CALLING SEQUENCE: subroutine Time2Day8(id,t,day) C INPUTS: C id integer 0: convert from standard time to day C 1: convert from day to standard time C t(2) integer id=0: 2-element standard times C day double precision id=1: day with time of day as fraction C OUTPUTS C day double precision id=0: day with time of day as fraction C t(2) integer id=1: 2-element standard times C CALLS: C Time2Units C PROCEDURE: C The conversion id=0 is not exact, but rounds to the nearest C fract-day unit. C MODIFICATION HISTORY: C OCT-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C- integer id double precision day integer t(2) integer units_in_day integer Time2Units units_in_day = Time2Units() if (id .eq. 1) then t(1) = int( day ) t(2) = nint( (day-t(1))*units_in_day ) else day = t(1)+t(2)/dble(units_in_day) end if return end