EXTRACT - Painless Module Extraction
EXTRACT is a simple utility that can pull a copy of a FORTRAN
block data, function, module, program or subroutine from a big file,
and save the copy in a little file. I've found this extremely useful,
as an alternative to printing out a huge library of routines, or using
an editor to extract the seven routines I need from a collection of 200.
The program can be used in command line form:
extract module file.f
which will search file.f90 for a module named module,
and, if found, write the text to the file module.f90.
The program can be invoked interactively with no arguments:
extract
in which case it will request the necessary information from the user.
Files you may copy include:
The list of routines includes:
-
EXTRACT extracts a module from a FORTRAN file.
-
C_CAP capitalizes a single character.
-
FILE_EXT determines the "extension" of a file name.
-
GET_UNIT returns a free FORTRAN unit number.
-
MODULE_FIND tries to find the first line of a given named module in a file.
-
MODULE_WRITE writes out the lines of a file until 'END' is reached.
-
S_BEFORE_SS_COPY copies a string up to a given substring.
-
S_BLANK_DELETE removes blanks from a string, left justifying the remainder.
-
S_BLANKS_DELETE replaces consecutive blanks by one blank.
-
S_CAP replaces any lowercase letters by uppercase ones in a string.
-
S_CAT concatenates two strings to make a third string.
-
S_EQI is a case insensitive comparison of two strings for equality.
-
S_INDEX_LAST finds the LAST occurrence of a given substring.
-
S_INDEXI is a case-insensitive INDEX function.
-
S_LEFT flushes a string left.
-
S_SPLIT divides a string into three parts, given the middle.
-
WORD_NEXT_READ "reads" words from a string, one at a time.
Back to the FORTRAN software page.
Last revised on 25 February 2002.