Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libmtime
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
icon-libraries
libmtime
Commits
5dff8c1b
Commit
5dff8c1b
authored
6 years ago
by
Jan Frederik Engels
Browse files
Options
Downloads
Patches
Plain Diff
Fixup examples_hl.f90
parent
80c32927
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/example_hl.f90
+3
-28
3 additions, 28 deletions
examples/example_hl.f90
with
3 additions
and
28 deletions
examples/example_hl.f90
+
3
−
28
View file @
5dff8c1b
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_timedelta
FromMilliseconds
(
360000
)
WRITE
(
0
,
*
)
"interval assignment with milliseconds: "
,
td
%
to_string
()
END
PROGRAM
example
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment