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
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
Walter, Wolfgang
PROG-material-public
Commits
6a355e09
Commit
6a355e09
authored
1 year ago
by
Jonas Riedel
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
b7d2f46a
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Uebung/WiSe23-24/fehler2.f95
+108
-0
108 additions, 0 deletions
Uebung/WiSe23-24/fehler2.f95
with
108 additions
and
0 deletions
Uebung/WiSe23-24/fehler2.f95
0 → 100644
+
108
−
0
View file @
6a355e09
!Programm 1
program
function_test_1
implicit
none
write
(
*
,
*
)
f
(
6
)
contains
function
f
(
x
)
integer
,
intent
(
in
)
::
x
integer
::
f
f
=
x
*
x
end
function
f
end
program
function_test_1
!----------------------------------------------------------------------------------------!
!Programm 2
program
function_test_2
implicit
none
write
(
*
,
*
)
"Die Summe von x und y ist:"
,
f
(
3
,
4
)
contains
function
f
(
x
,
y
)
integer
,
intent
(
in
)
::
x
,
y
integer
::
f
f
=
x
+
y
end
function
f
end
program
function_test_2
!----------------------------------------------------------------------------------------!
!Programm 3
program
recursive_function_test
implicit
none
write
(
*
,
*
)
f
(
3
)
contains
recursive
function
f
(
x
)
result
(
res
)
integer
,
intent
(
in
)
::
x
integer
::
res
if
(
x
<=
1
.or.
x
>=
20
)
then
res
=
10
else
res
=
f
(
x
-
1
)
+
f
(
x
-
2
)
end
if
end
function
f
end
program
recursive_function_test
!----------------------------------------------------------------------------------------!
!Programm 4
module
test_module_1
implicit
none
private
public
::
g
,
n
integer
::
n
contains
function
g
()
logical
::
g
g
=
n
>
10
end
function
g
end
module
test_module_1
program
module_test_1
use
test_module_1
implicit
none
n
=
5
write
(
*
,
*
)
g
()
end
program
module_test_1
!----------------------------------------------------------------------------------------!
!Programm 5
module
test_module_2
implicit
none
private
public
::
f
,
dp
integer
,
parameter
::
dp
=
selected_real_kind
(
15
,
307
)
contains
function
f
(
x
)
real
(
dp
),
intent
(
in
)::
x
real
(
dp
)
::
f
f
=
sqrt
(
real
(
5
,
dp
))
*
sqrt
(
x
)
end
function
end
module
test_module_2
program
module_test_2
use
test_module_2
implicit
none
real
(
dp
)
::
x
x
=
5
write
(
*
,
*
)
f
(
x
)
end
program
module_test_2
!----------------------------------------------------------------------------------------!
\ 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