Skip to content

Commit 0308cf5

Browse files
committed
Update: hello_complex example with sub directory
To demonstrate and test recursive source file discovery.
1 parent a110523 commit 0308cf5

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

test/example_packages/hello_complex/source/farewell_m.f90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module farewell_m
2+
use subdir_constants, only: FAREWELL_STR
23
implicit none
34
private
45

@@ -8,6 +9,6 @@ function make_farewell(name) result(greeting)
89
character(len=*), intent(in) :: name
910
character(len=:), allocatable :: greeting
1011

11-
greeting = "Goodbye, " // name // "!"
12+
greeting = FAREWELL_STR // name // "!"
1213
end function make_farewell
1314
end module farewell_m

test/example_packages/hello_complex/source/greet_m.f90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module greet_m
2+
use subdir_constants, only: GREET_STR
23
implicit none
34
private
45

@@ -8,6 +9,6 @@ function make_greeting(name) result(greeting)
89
character(len=*), intent(in) :: name
910
character(len=:), allocatable :: greeting
1011

11-
greeting = "Hello, " // name // "!"
12+
greeting = GREET_STR // name // "!"
1213
end function make_greeting
1314
end module greet_m
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module subdir_constants
2+
implicit none
3+
4+
character(*), parameter :: GREET_STR = 'Hello, '
5+
character(*), parameter :: FAREWELL_STR = 'Goodbye, '
6+
7+
end module subdir_constants

0 commit comments

Comments
 (0)