Menu

#69 SOURCE keyword and overloaded functions

open
nobody
None
5
2011-09-11
2011-09-11
No

In FORTRAN I can overload a function and have multiple interfaces for the same function, for example:

INTERFACE write_data
MODULE PROCEDURE write_int
MODULE PROCEDURE write_real
END INTERFACE

SUBROUTINE write_int( InVar )
INTEGER :: Invar
END SUBROUTINE write_int
SUBROUTINE write_real( InVar )
REAL :: Invar
END SUBROUTINE write_int

Now I want to provide using the SOURCE keyword the interface for write_data, and not the source for write_int and write_real subroutines. The problem is the source interface does not exists for write_data.

It would be nice if I could do something like

!****s* H5A write_data
!
! NAME
! write_data
!
! INPUT
! Myvalue - Print value
!
! SOURCE
! SUBROUTINE write_data(Myvalue)
!*****

and have items in the SOURCE block written as source code without the "!"

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.