function ESMF_Times_Equal(timeu, timev) result(tval)
type(ESMF_Time), intent(in) :: timeu, timev
logical :: tval
integer :: uyy, umm, udd, uh, um, us, usN, usD
integer :: vyy, vmm, vdd, vh, vm, vs, vsN, vsD
integer :: status
tval = .FALSE.
call ESMF_TimeGet(timeu, yy=uyy, mm=umm, dd=udd, h=uh, m=um, d=us, sN=usN, sD=usD, rc = status)
if(status /= _SUCCESS) return
call ESMF_TimeGet(timev, yy=vyy, mm=vmm, dd=vdd, h=vh, m=vm, d=vs, sN=vsN, sD=vsD, rc = status)
if(status /= _SUCCESS) return
tval = ( (uyy == vyy) .and. (umm == vmm) .and. (udd == vdd) &
.and. (uh == vh) .and. (um == vm) .and. (us == vs) &
.and. rational_equals([usN, usD], [vsN, vsD]) )
end function ESMF_Times_Equal