C+ C NAME: C Time2ConvertUnits C PURPOSE: C Change fract-day units C CATEGORY: C gen/for/lib C CALLING SEQUENCE: subroutine Time2ConvertUnits(units,new_units,t,u) C INPUTS: C units integer # current units in day C new_units integer # new units in day C t(2) integer 2-element standard time C OUTPUTS: C u(2) integer modified 2-element standard time C PROCEDURE: C Typically this routine is used to convert to smaller frac-day units, C e.g. from hours to seconds. In this case the conversion is exact C When converting to larger units (new_units smaller than units) C then round-off will usually occur, i.e. the conversion is not exact. C MODIFICATION HISTORY: C JAN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C- integer units integer new_units integer t(2) integer u(2) u(1) = t(1) u(2) = t(2) if (units .ne. new_units) then if (new_units/units*units .eq. new_units) then u(2) = u(2)*(new_units/units) ! Exact conversion else u(2) = nint( dble(u(2))/dble(units)*dble(new_units) ) end if end if return end