FTNSPLIT(1) Last changed: 7-24-97
ftnsplit - Invokes the Fortran file splitter
ftnsplit [-a] [-d] [-k] [-m] [-o] [-r] [-s] [-u] [-x] [files]
UNICOS, UNICOS/mk, and IRIX systems
The ftnsplit utility splits named Fortran files into separate files,
with one unit per file, and lists the resultant files. Each unit
includes the following program segments: blockdata, function, main
program, module, and subroutine. If you do not specify files, data is
read from standard input (stdin).
The following naming conventions apply:
* The segment X is put in file X.f or file X.f90. ftnsplit preserves
the file extension of the original file.
* Duplicate segments X are put into file Xn.f[90], where n represents
a unique integer value for each duplicate file that exists. The -r
option overrides this convention and replaces the file X.f[90].
* Unnamed blockdata segments are put into files blockdataN.f.
The ftnsplit utility accepts the following options:
-a Lists file-based dependencies, that is, those external module
files and include files, which if modified would require
recompilation of the current file.
-d Creates a subdirectory (inputfile.d) for each input file and
creates the required output files within that subdirectory.
-k Keeps any created CIFs.
-m Lists include files referenced and modules used. See the
EXAMPLES section of this man page for sample output produced by
using the -m option.
-o Specifies compiler options for creating compiler information
files (CIFs).
-r Replaces existing .f files as required. Creates a file named
unit001.f if file unit.f already exists.
-s Strips trailing blanks from the generated output files.
-u Specifies that make unit file names are in uppercase characters.
Default is lowercase characters.
-x Lists units; source is not expanded.
files
Specifies names of files to be split. Default is stdin.
The .f suffix is used to name files generated by ftnsplit. If a #
character appears in column one of an input file, the suffix used to
name the output file will be .F, indicating that the preprocessor must
be executed on the output file.
The ftnsplit utility uses the Fortran 90 compiler to produce CIFs in
order to generate output.
The operation of ftnsplit may be verified using cat(1) to send the
output files to wc(1) and comparing the result to the size of the
input file to ftnsplit.
If you use the !dir$ free directive to indicate free-source format
within the body of the source code, then this directive will have to
be hand duplicated into each of the split-out files. For example:
file.f
!dir$ free
program main
print *, "main"
end program main
subroutine test
print *, "test"
end subroutine test
When ftnsplit is used, compiling the resulting test.f file will
produce compilation errors unless !dir$ free is added to the top of
the file. Alternatively, you can use ftnmgen -f"-freeform" (on IRIX
systems) or ftnmgen -f"-ffree" (on UNICOS systems) to instruct the
compiler to assume free-form source.
The following example shows sample program fred and the output
returned when the -m option is used as an argument to the ftnsplit
command:
program fred
include "abc.h"
...
end program fred
subroutine jim
use harry
...
end subroutine jim
% ftnsplit -m file.f
fred
abc.h
jim
module harry
file*.[fF][90] Fortran source code files of a named program
segment
blockdata*.[fF] Source code files of a blockdata segment
cat(1), csplit(1), expand(1), f90(1), split(1), wc(1)
This man page is available only online.
[ Back ]
|