C+
C NAME:
C	Time2Round
C PURPOSE:
C	Round time
C CATEGORY:
C	gen/for/lib
C CALLING SEQUENCE:
	subroutine Time2Round(hms,t,u)
C INPUTS:
C	hms(4)		integer
C	t(2)		integer		2-element standard time
C OUTPUTS:
C	u(2)		integer		rounded 2-element standard time
C CALLS:
C	Time2YDoy, Time2Units, Time2HMS
C MODIFICATION HISTORY:
C	JAN-2004, Paul Hick (pphick@ucsd.edu)
C-
	    integer	hms(4)
	    integer	t(2)
	    integer	u(2)

	integer		dt(2)
	integer		yr
	integer		doy(2)
	integer		Time2Units

	call Time2HMS(1,dt,hms)

	call Time2YDoy(0,t,yr,doy)

	if (dt(1) .eq. 0) then

	    doy(2) = nint(dble(doy(2))/dble(dt(2)))*dt(2)

	else if (dt(2) .eq. 0) then

	    doy(1) = nint( (doy(1)+dble(doy(2))/dble(Time2Units()))/dble(dt(1)) )*dt(1)
	    doy(2) = 0

	end if

	call Time2YDoy(1,u,yr,doy)

	return
	end
