| 1 |
module math_operations |
| 2 |
implicit none |
| 3 |
|
| 4 |
public :: add, subtract, multiply |
| 5 |
|
| 6 |
contains |
| 7 |
|
| 8 |
|
| 9 |
subroutine add(x, y, result) |
| 10 |
real, intent(in) :: x, y |
| 11 |
real, intent(out) :: result |
| 12 |
result = x + y |
| 13 |
end subroutine add |
| 14 |
|
| 15 |
|
| 16 |
subroutine subtract(x, y, result) |
| 17 |
real, intent(in) :: x, y |
| 18 |
real, intent(out) :: result |
| 19 |
result = x - y |
| 20 |
end subroutine subtract |
| 21 |
|
| 22 |
|
| 23 |
subroutine multiply(x, y, result) |
| 24 |
real, intent(in) :: x, y |
| 25 |
real, intent(out) :: result |
| 26 |
result = x * y |
| 27 |
end subroutine multiply |
| 28 |
|
| 29 |
end module math_operations |