diff --git a/src/modules/mo_test_submodule.f90 b/src/modules/mo_test_submodule.f90 index 11ae05f..dff083f 100644 --- a/src/modules/mo_test_submodule.f90 +++ b/src/modules/mo_test_submodule.f90 @@ -9,10 +9,14 @@ end subroutine print_hello_subroutine module function print_hello_function() integer :: print_hello_function end function print_hello_function + + module function print_hello_function2() + integer :: print_hello_function2 + end function print_hello_function2 end interface contains subroutine print_hello() - print *, "Hello from submodule test (parent module)." + print *, "Hello from submodule test (ancestor module)." end subroutine print_hello end module mo_test_submodule diff --git a/src/modules/submo_submo_test_submodule.f90 b/src/modules/submo_submo_test_submodule.f90 deleted file mode 100644 index 87e6261..0000000 --- a/src/modules/submo_submo_test_submodule.f90 +++ /dev/null @@ -1,9 +0,0 @@ -submodule (mo_test_submodule:submo_test_submodule) submo_submo_test_submodule - implicit none -contains - module function print_hello_function() - integer :: print_hello_function - print_hello_function = res - print *, "Hello from submodule test (submodule function)." - end function print_hello_function -end submodule submo_submo_test_submodule diff --git a/src/modules/submo_test_submodule.f90 b/src/modules/submo_test_submodule.f90 deleted file mode 100644 index 78336fd..0000000 --- a/src/modules/submo_test_submodule.f90 +++ /dev/null @@ -1,10 +0,0 @@ -submodule (mo_test_submodule) submo_test_submodule - implicit none - - integer, parameter :: res = 0 - -contains - module subroutine print_hello_subroutine() - print *, "Hello from submodule test (submodule subroutine)." - end subroutine print_hello_subroutine -end submodule submo_test_submodule diff --git a/src/program/main.f90 b/src/program/main.f90 index 7104dfb..2253f51 100644 --- a/src/program/main.f90 +++ b/src/program/main.f90 @@ -6,7 +6,8 @@ program main use mo_test_submodule, only: & & print_test_submodule_parent => print_hello, & & print_test_submodule_subroutine => print_hello_subroutine, & - & print_test_submodule_function => print_hello_function + & print_test_submodule_function => print_hello_function, & + & print_test_submodule_function2 => print_hello_function2 use mo_threaded_hello, only: print_threaded_hello => print_hello use mo_delayed, only: print_delayed_hello => print_hello use mo_cmake_based, only: print_cmake_based_hello => print_hello @@ -89,6 +90,7 @@ program main call print_test_submodule_parent() call print_test_submodule_subroutine() retval = print_test_submodule_function() + retval = print_test_submodule_function2() print *, "Running threaded bundled library..." retval = print_threaded_hello() diff --git a/src/submodules/smo_smo_test_submodule.f90 b/src/submodules/smo_smo_test_submodule.f90 new file mode 100644 index 0000000..faf2ac8 --- /dev/null +++ b/src/submodules/smo_smo_test_submodule.f90 @@ -0,0 +1,9 @@ +submodule (mo_test_submodule:smo_test_submodule) smo_smo_test_submodule + implicit none +contains + module function print_hello_function() + integer :: print_hello_function + print_hello_function = res + print *, "Hello from submodule test (submodule of submodule)." + end function print_hello_function +end submodule smo_smo_test_submodule diff --git a/src/submodules/smo_test_submodule.f90 b/src/submodules/smo_test_submodule.f90 new file mode 100644 index 0000000..b347959 --- /dev/null +++ b/src/submodules/smo_test_submodule.f90 @@ -0,0 +1,10 @@ +submodule (mo_test_submodule) smo_test_submodule + implicit none + + integer, parameter :: res = 0 + +contains + module subroutine print_hello_subroutine() + print *, "Hello from submodule test (parentless submodule)." + end subroutine print_hello_subroutine +end submodule smo_test_submodule diff --git a/src/submodules/smo_test_submodule2.f90 b/src/submodules/smo_test_submodule2.f90 new file mode 100644 index 0000000..32573b8 --- /dev/null +++ b/src/submodules/smo_test_submodule2.f90 @@ -0,0 +1,8 @@ +submodule (mo_test_submodule) smo_test_submodule2 + implicit none +contains + integer module function print_hello_function2() + print_hello_function2 = 0 + print *, "Hello from submodule test (parentless submodule 2)." + end function print_hello_function2 +end submodule smo_test_submodule2