1
+ interface function_subroutine_definitions
2
+
3
+ ! Normal subroutine
4
+ subroutine sub ( arg )
5
+ integer , intent (inout ) :: arg
6
+ end subroutine
7
+
8
+ ! Normal functions
9
+ integer function fun_integer ( arg ) result(val)
10
+ integer , intent (inout ) :: arg
11
+ end function fun_integer
12
+
13
+ real function fun_real ( arg ) result(val)
14
+ integer , intent (inout ) :: arg
15
+ end function fun_real
16
+
17
+ logical function fun_logical ( arg ) result(val)
18
+ integer , intent (inout ) :: arg
19
+ end function fun_logical
20
+
21
+ character (kind= 1 , len= 100 ) function fun_character( arg ) result(val)
22
+ integer , intent (inout ) :: arg
23
+ end function fun_character
24
+
25
+ double precision function fun_double_precision( arg ) result(val)
26
+ integer , intent (inout ) :: arg
27
+ end function fun_double_precision
28
+
29
+ double complex function fun_double_complex( arg ) result(val)
30
+ integer , intent (inout ) :: arg
31
+ end function fun_double_complex
32
+
33
+ ! Weird edge cases where the keyword function/subroutine is also used as arguments
34
+ function fun_with_fun ( function )
35
+ integer , intent (inout ) :: function
36
+ end function fun_with_fun
37
+
38
+ function fun_with_sub ( subroutine )
39
+ integer , intent (inout ) :: subroutine
40
+ end function fun_with_sub
41
+
42
+ subroutine sub_with_sub ( subroutine )
43
+ integer , intent (inout ) :: subroutine
44
+ end subroutine sub_with_sub
45
+
46
+ subroutine sub_with_fun ( function )
47
+ integer , intent (inout ) :: function
48
+ end subroutine sub_with_fun
49
+
50
+ end interface function_subroutine_definitions
0 commit comments