| 1 |
module wrapper |
| 2 |
implicit none |
| 3 |
integer, parameter :: jprb = selected_real_kind(13,300) |
| 4 |
|
| 5 |
contains |
| 6 |
|
| 7 |
subroutine mult_add_external(a, b, c, sum) |
| 8 |
implicit none |
| 9 |
|
| 10 |
interface |
| 11 |
subroutine mult_add_fc(a, b, c, sum) & |
| 12 |
& bind(c, name='mult_add_c') |
| 13 |
use iso_c_binding, only: c_double |
| 14 |
implicit none |
| 15 |
|
| 16 |
! Pass values in by value, out by reference |
| 17 |
real(kind=c_double), value :: a, b, c |
| 18 |
real(kind=c_double) :: sum |
| 19 |
end subroutine mult_add_fc |
| 20 |
end interface |
| 21 |
|
| 22 |
real(kind=jprb), intent(in) :: a, b, c |
| 23 |
real(kind=jprb), intent(out) :: sum |
| 24 |
|
| 25 |
call mult_add_fc(a, b, c, sum) |
| 26 |
end subroutine mult_add_external |
| 27 |
|
| 28 |
end module wrapper |