Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PROG-material-public
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Yue Wu
PROG-material-public
Commits
a3bfacd4
Commit
a3bfacd4
authored
1 year ago
by
dali662d
Browse files
Options
Downloads
Patches
Plain Diff
Delete 03_zeitmodul.f95
parent
a0384336
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Sonderuebung/WiSe23-24/SU08_2023_12_12/03_zeitmodul.f95
+0
-117
0 additions, 117 deletions
Sonderuebung/WiSe23-24/SU08_2023_12_12/03_zeitmodul.f95
with
0 additions
and
117 deletions
Sonderuebung/WiSe23-24/SU08_2023_12_12/03_zeitmodul.f95
deleted
100644 → 0
+
0
−
117
View file @
a0384336
module
zeit_mod
implicit
none
private
public
::
zeit
,
GET
,
operator
(
<
),
operator
(
+
),
zeit_string
type
zeit
private
integer
::
h
integer
::
m
real
::
s
end
type
interface
GET
module
procedure
zeit_einlesen
end
interface
interface
operator
(
<
)
module
procedure
zeit_vgl
end
interface
interface
operator
(
+
)
module
procedure
zeit_add
end
interface
contains
subroutine
zeit_einlesen
(
time
)
type
(
zeit
),
intent
(
out
)
::
time
do
read
(
*
,
*
)
time
if
(
time
%
h
>=
0
.and.
time
%
m
>=
0
.and.
time
%
m
<
60
.and.
time
%
s
>=
0
.and.
time
%
s
<
60
)
exit
write
(
*
,
*
)
"Eingabe fehlerhaft. Gebe die Stunden, Minuten und Sekunden erneut ein."
end
do
end
subroutine
zeit_einlesen
function
zeit_string
(
time
)
! gibt die time als string (character) in der form hh:mm:ss zurück
type
(
zeit
),
intent
(
in
)
::
time
character
(
len
=
8
)
::
zeit_string
character
(
len
=
2
)
::
help
! trage stunden in string ein
write
(
help
,
'(I2)'
)
time
%
h
if
(
time
%
h
*
0.1
<
1
)
help
(
1
:
1
)
=
"0"
zeit_string
(
1
:
3
)
=
help
//
":"
! trage minuten in string ein
write
(
help
,
'(I2)'
)
time
%
m
if
(
time
%
m
*
0.1
<
1
)
help
(
1
:
1
)
=
"0"
zeit_string
(
4
:
6
)
=
help
//
":"
! trage sekunden in string ein
write
(
help
,
'(I2)'
)
nint
(
time
%
s
)
if
(
time
%
s
*
0.1
<
1
)
help
(
1
:
1
)
=
"0"
zeit_string
(
7
:
8
)
=
help
end
function
function
zeit_vgl
(
time1
,
time2
)
result
(
kleiner
)
type
(
zeit
),
intent
(
in
)
::
time1
,
time2
logical
::
kleiner
!rückgabevariable
kleiner
=
.false.
if
(
time1
%
h
<
time2
%
h
)
then
! vgl stunden
kleiner
=
.true.
elseif
(
time1
%
h
==
time2
%
h
)
then
if
(
time1
%
m
<
time2
%
m
)
then
kleiner
=
.true.
elseif
(
time1
%
m
==
time2
%
m
)
then
if
(
time1
%
s
<
time2
%
s
)
kleiner
=
.true.
end
if
end
if
end
function
zeit_vgl
function
zeit_add
(
time1
,
time2
)
result
(
sum
)
type
(
zeit
),
intent
(
in
)
::
time1
,
time2
type
(
zeit
)
::
sum
! rückgabewert
sum
=
zeit
(
0
,
0
,
0
)
sum
%
s
=
time1
%
s
+
time2
%
s
if
(
sum
%
s
>=
60
)
then
sum
%
s
=
sum
%
s
-
60
sum
%
m
=
1
end
if
sum
%
m
=
sum
%
m
+
time1
%
m
+
time2
%
m
if
(
sum
%
m
>=
60
)
then
sum
%
m
=
sum
%
m
-
60
sum
%
h
=
1
end
if
sum
%
h
=
sum
%
h
+
time1
%
h
+
time2
%
h
end
function
zeit_add
end
module
zeit_mod
program
test
use
zeit_mod
implicit
none
type
(
zeit
)
::
time1
,
time2
call
get
(
time1
)
call
get
(
time2
)
write
(
*
,
*
)
zeit_string
(
time1
+
time2
)
end
program
test
\ No newline at end of file
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