If you put your routines in the module and place the PRIVATE statement at the beginning of the module, then PUBLIC :: name1, name2, only the procedures name1 and name2 will be visible outside the module. This should go through the library into which you put the object code containing the module. This is supported with Fortran 90.
As @janneb already answered, you can use the bind (C, name = X) approach to fully control the externally visible name of the procedure by overriding the name of this procedure in Fortran. This is part of Fortran 2003 and has been supported by many compilers for many years. A possible problem with the bind (C) approach is that it indicates that the calling convention of the routine should be equal to C. If this is different from this Fortran and you want to call these routines from Fortran, the complexity increases. Then you will need to specify an interface to inform the Fortran calling routines that they are calling, which is similar to routine C. Since people rarely care about the name visible to the linker, unless they call from C, may you need a C-call convention?
Examples in Private Function in Fortran and C / C ++, FORTRAN, Underscore, and GNU Autotools
source share