| 1 |
module circle |
| 2 |
implicit none |
| 3 |
|
| 4 |
integer :: x |
| 5 |
real :: radius |
| 6 |
|
| 7 |
interface default |
| 8 |
module procedure timestwo |
| 9 |
end interface |
| 10 |
|
| 11 |
contains |
| 12 |
|
| 13 |
elemental integer function timestwo(x) result(y) |
| 14 |
integer, intent(in) :: x |
| 15 |
y = 2*x |
| 16 |
end function |
| 17 |
end module circle |
| 18 |
|
| 19 |
program prog |
| 20 |
|
| 21 |
use, non_intrinsic :: circle, only: timestwo, x |
| 22 |
|
| 23 |
implicit none |
| 24 |
|
| 25 |
x = 3 |
| 26 |
|
| 27 |
if (timestwo(x) /= 6) error stop 'fortran module procedure problem' |
| 28 |
|
| 29 |
print *,'OK: Fortran module procedure' |
| 30 |
|
| 31 |
end program prog |