Skip to content
Snippets Groups Projects
Commit 5dff8c1b authored by Jan Frederik Engels's avatar Jan Frederik Engels :new_moon:
Browse files

Fixup examples_hl.f90

parent 80c32927
No related branches found
No related tags found
No related merge requests found
MODULE mo_example
IMPLICIT NONE
CONTAINS
INTEGER FUNCTION division(number1, number2, ifail)
INTEGER, INTENT(IN) :: number1, number2
TYPE(t_error), INTENT(INOUT) :: ifail
division = 0
IF (number2 == 0) THEN
CALL create_error(ifail, t_arithmetic_error("Division by zero!"))
ELSE IF ((number1 < 0) .OR. (number2 < 0)) THEN
CALL create_error(ifail, t_invalid_input_error("Only positive numbers allowed!"))
ELSE
division = number1 / number2
END IF
END FUNCTION division
END MODULE mo_example
PROGRAM example
USE mo_example
USE mtime, ONLY: setCalendar, PROLEPTIC_GREGORIAN
USE mtime_hl, ONLY: t_datetime, t_timedelta, min, max
USE mtime_hl, ONLY: t_datetime, t_timedelta, min, max, &
& t_timedeltaFromMilliseconds
IMPLICIT NONE
......@@ -34,8 +11,6 @@ PROGRAM example
TYPE(t_timedelta) :: td
INTEGER :: test_number1, test_number2, test_result
TYPE(t_error) :: ifail
WRITE (0,*) "example_hl : test example"
......@@ -92,7 +67,7 @@ PROGRAM example
WRITE (0,*) "MAX(", dt2%to_string(), ", ", dt3%to_string(), "): ", dt4%to_string()
! interval assignment with milliseconds
td = t_timedelta(360000)
td = t_timedeltaFromMilliseconds(360000)
WRITE (0,*) "interval assignment with milliseconds: ", td%to_string()
END PROGRAM example
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment