| 1 |
module some_module |
| 2 |
implicit none |
| 3 |
|
| 4 |
integer, parameter :: some_var=1 |
| 5 |
|
| 6 |
interface add_args |
| 7 |
procedure add_two_args |
| 8 |
procedure add_three_args |
| 9 |
end interface add_args |
| 10 |
|
| 11 |
type some_type |
| 12 |
real :: c = 1. |
| 13 |
contains |
| 14 |
procedure :: do_something => add_const |
| 15 |
end type |
| 16 |
|
| 17 |
contains |
| 18 |
|
| 19 |
function return_one() result(one) |
| 20 |
real :: one |
| 21 |
one = 1. |
| 22 |
end function return_one |
| 23 |
|
| 24 |
function add_two_args(i,j) result(res) |
| 25 |
integer, intent(in) :: i,j |
| 26 |
real :: res |
| 27 |
res = dble(i+j) |
| 28 |
end function add_two_args |
| 29 |
|
| 30 |
function add_three_args(i,j,k) result(res) |
| 31 |
integer, intent(in) :: i,j,k |
| 32 |
real :: res |
| 33 |
res = dble(i+j+k) |
| 34 |
end function add_three_args |
| 35 |
|
| 36 |
subroutine add_const(self, a) |
| 37 |
class(some_type), intent(in) :: self |
| 38 |
real, intent(inout) :: a |
| 39 |
|
| 40 |
a = a + self%c |
| 41 |
end subroutine add_const |
| 42 |
|
| 43 |
end module some_module |