|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
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:
extract.f90, the source code;
extract_prb.f90, a sample text file;
extract_prb.out, output from a sample run;
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.
|
|