blob: 0ad216ac519ffcce2bbb647212e38f9f47a13ce6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
! The program units in this file consist of a
! module/submodule tree represented by the following
! graph:
!
! parent
! |
! / \
! / \
! child sibling
! |
! grandchild
!
! where the parent node is a module and all other
! nodes are submodules.
module parent
implicit none
interface
! Test Fortran 2008 "module function" syntax
module function child_function() result(child_stuff)
logical :: child_stuff
end function
! Test Fortran 2008 "module subroutine" syntax
module subroutine grandchild_subroutine()
end subroutine
end interface
end module parent
! Test the notation for a 1st-generation direct
! descendant of a parent module
submodule ( parent ) child
implicit none
contains
module function child_function() result(child_stuff)
logical :: child_stuff
child_stuff=.true.
end function
end submodule child
! Empty submodule for checking disambiguation of
! nodes at the same vertical level in the tree
submodule ( parent ) sibling
end submodule sibling
! Test the notation for an Nth-generation descendant
! for N>1, which necessitates the colon.
submodule ( parent : child ) grandchild
contains
module subroutine grandchild_subroutine()
print *,"Test passed."
end subroutine
end submodule grandchild
|