[comp.lang.fortran] Portability of INCLUDE

efrank@charm.hep.upenn.edu (Ed Frank) (01/08/91)

   Recently several people have said that Fortran-9X will standardize
the syntax of the INCLUDE statement, and have said that this will solve
portability problems related to INCLUDEs.  I would like to point out that
this is not realy the case since INCLUDE generaly makes reference to
the filesystem.  The point here is that different systems have different
ways to specify file identifiers. Examples:
1) VMS     something$oh.boy
2) unix    ~something/oh.boy
3) VM/CMS  OH BOY A1

Suppose that the  syntax for INCLUDE was standardized to be
			  INCLUDE 'file_id'
then the 3 examples above yield
1) VMS	  include( 'something$oh.boy')
2) unix   include( '~something/oh.boy')
3) VM/CMS include( 'OH BOY A1' )

You get different code for different machines.  I think the only way
to solve this problem is with a preprocessor.  Write your code with
some choice of file_id syntax. The preprocessor will convert this
file_id, perhaps via a lookup table which maps stuff between different
filesystems, to a real file_id for the target machine.

The concept of modules seems intrigueing.  They may solve this problem
entirely:  I look forward to learning more about it.

Ed Frank
efrank@upenn5.hep.upenn.edu