There are a number of "operating systems support" functions that
are frequently needed in programs, for which no standard interface
is available. Examples of such functions are: access to the shell,
access to command line arguments, access to environment variables
or VMS logical names, elapsed cpu time, and so on. To have access
to such functions and still maintain portability, applications
frequently resort to conditional compilation, by various methods
such as cpp directorives.
The following NTCC modules are of interest in code porting work:
PortLib -- VMS/UNIX (Fortran) Portability Library. There are a number of
"operating systems support" functions that are frequently needed in
programs, for which no standard interface is available. Examples of such
functions are: access to the shell, access to command line arguments,
access to environment variables or VMS logical names, elapsed cpu time,
and so on. In UNIX terminology these are the fortran "3f" routines:
system, getarg, getenv, etc. Accessing these routines requires slightly
different code, depending on vendor or operating system. The portlib
library provides a standardized portable interface to these routines,
encapsulating the system to system variability, making it easier
for the applications developer to achieve portability without the
need to resort to such techniques as conditional compilation via cpp
Ftoken -- a set of fortran-77 portability conversion tools built on
a token parsing library (ftoken). These tools are:
- fgtok: table driven token substitution tool with fortran-77
- idecl: make implicit INTEGER and REAL declarations explicit,
allowing a code to be converted to compile with IMPLICIT NONE
- cpcheck: scan a named source file for presence of macros defined
in a named header file. If any of the macros occur, print
"present", otherwise print "absent".
- r8real: automatically generate a REAL*8 interface to subroutines
or functions which use single precision REAL arguments.
These tools are recommended for one time portability (and precision)
conversions of codes. Examples of conversions: (a) change REAL and
COMPLEX declarations to REAL*8 and COMPLEX*16, (b) convert all references
to fortran intrinsic functions to their generic (and portable) form, (c)
convert hard coded constants to D-exponent format. The module includes
name substitution tables and scripts enabling automated code conversions.
A set of python scripts and ".h" files for preprocessing
of Fortran 90 and Fortran 77 sources, to support conditional compilation
and macro substitution, that give methods for implementing
portable code from a single source.