Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ! This program just uses the interface defined in the module
- program ifce
- use something
- implicit none
- real :: a
- double precision :: b
- integer :: c
- a=do_something(a)
- b=do_something(b)
- c=do_something(c)
- end program ifce
- module something
- interface do_something
- module procedure do_something_i
- module procedure do_something_r
- module procedure do_something_d
- end interface do_something
- contains
- function do_something_i(i) result(ii)
- integer :: i, ii
- print *, "I'm an integer"
- end function do_something_i
- function do_something_r(r) result(rr)
- real :: r, rr
- print *, "I'm a real"
- end function do_something_r
- function do_something_d(d) result(dd)
- double precision :: d, dd
- print *, "I'm a double"
- end function do_something_d
- end module something
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement