diff --git a/src/libmtime_hl.f90 b/src/libmtime_hl.f90 index 3d37c4ef9a2f76085b8d927339c15332933e193f..e8514283e6bc98c7d1f57bd42f535a5df388acab 100644 --- a/src/libmtime_hl.f90 +++ b/src/libmtime_hl.f90 @@ -194,7 +194,7 @@ MODULE mtime_hl ! thrown. PROCEDURE :: toMilliSeconds => t_timedelta_toMilliSeconds - PROCEDURE :: divideInSecondsBy => t_timedelta_divideInSecondsBy + PROCEDURE :: divideBy => t_timedelta_divideBy ! --- overloaded operators diff --git a/src/mtime_t_timedelta.inc b/src/mtime_t_timedelta.inc index 139d14766f2e574364fd06ff1999583781ad1456..83c6ef86b420adf8d75b73c97554ba8d609dfa94 100644 --- a/src/mtime_t_timedelta.inc +++ b/src/mtime_t_timedelta.inc @@ -217,7 +217,7 @@ CALL my_deallocatetimedelta(c_pointer) !deallocate timedelta END FUNCTION t_timedelta_toString - FUNCTION t_timedelta_divideInSecondsBy (this, divisor, referenceDateTime) RESULT(quotient) + FUNCTION t_timedelta_divideBy (this, divisor, referenceDateTime) RESULT(quotient) CLASS(t_timedelta), INTENT(in), target :: this TYPE(t_timedelta), INTENT(in), target :: divisor TYPE(t_datetime), INTENT(IN), target :: referenceDateTime @@ -225,20 +225,12 @@ TYPE(t_datetime), target :: dt_tmp type(c_ptr) :: dummy_ptr - dummy_ptr = my_divideTimeDeltaInSeconds(c_loc(this%td), c_loc(divisor%td), & + dummy_ptr = my_divideTimeDelta(c_loc(this%td), c_loc(divisor%td), & & c_loc(referenceDateTime%dt), c_loc(quotient)) - IF (.NOT. c_associated(dummy_ptr)) THEN - dt_tmp = referenceDateTime + this - dummy_ptr = my_dividedatetimedifferenceinseconds(c_loc(dt_tmp%dt), & - & c_loc(referenceDateTime%dt), & - & c_loc(divisor%td), c_loc(quotient)) - - CALL handle_errno(.not. c_associated(dummy_ptr), general_arithmetic_error, & - __FILE__, & - __LINE__) - END IF - END FUNCTION t_timedelta_divideInSecondsBy + CALL handle_errno(.not. c_associated(dummy_ptr), general_arithmetic_error, & + __FILE__, __LINE__) + END FUNCTION t_timedelta_divideBy FUNCTION t_timedelta_toSeconds (this, td) RESULT(seconds) CLASS(t_timedelta), INTENT(in) :: this