-
Notifications
You must be signed in to change notification settings - Fork 0
Cactus-proj/NSWC
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
USING THE NSWC LIBRARY ON AN IBM PC
Some PC users compile the NSWC Library and use a linker to
fetch needed routines. Others use the batch file,FCH.BAT, to fetch
needed routines from the source library. The advantages of using
FCH are that a long compilation is avoided, and the user has the option
of converting the fetched routines to double precision. For details
concerning this conversion, and for options not explained in this
document, see the file FCH.HLP.
For the purposes of this document, a library(or source file) is a
file containing one or more uncompiled Fortran routines, where a routine
is a function, subroutine, main program, or block data subprogram.
Routines may be written in small letters,capitals, or a combination of
both. FCH will recognize all ANSI 66 and ANSI 77 statements except SAVE,
ENTRY, and INQUIRE. Tab characters from Edlin and Personal Editor are
allowed but only one per line. The tab character must be in columns 1
thru 6 and the tab column must be 7.
Typing 'FCH h' will display the argument list of FCH on the terminal.
Typing 'FCH H' will display the argument list of FCH on the terminal and
give a description of the arguments and the results they produce. As the
description is displayed on the screen, it is written to the file
FCH.HLP(which can be sent to a printer). This is the only instance in
which small letters and capitals produce different results.
There are two ways to fetch: by routine name and by source file. In
either case the fetching is done from one or more libraries. The
fetching continues until all requested routines(including all supporting
routines) are obtained or it is determined that the remaining needed
routines are not in the libraries, in which case it is reported to the
user. Consequently, FCH acts like a linker or loader except that the
files and routines are in source code rather than object code.
Assume that L1 and L2 are the libraries from which the fetching is
done and OUT is the file which will contain the fetched routines.
Initial data in OUT will be lost.
1. Fetch the routines BRATIO and GRATIO.
FCH f - OUT BRATIO+ GRATIO+ L1 L2
The minus sign indicates that there is no input source file. The plus
signs indicate routine names rather than library names. Routine names
must precede library names. The number of libraries must not exceed 15.
2. Fetch all routines needed by the source file IN.
FCH f IN OUT L1 L2
Assume that IN contains: PROGRAM MAIN
CALL BRATIO
CALL GRATIO
END
Examples 1 and 2 will produce the same output file OUT. OUT will
contain BRATIO and GRATIO(provided they are in L1 or L2), and all
the routines from L1 and L2 which are used by BRATIO and GRATIO.
The two methods may be used together, for example
FCH f IN OUT RLOG+ ERF+ L1 L2 is permitted.
FCH will not fetch more than one copy of a routine having a specified
name. If 'CALL ABC' is in the input file then FCH will fetch the
first routine(main program,subroutine,function, or block data) it finds
which is named 'ABC'. The name of each routine fetched is written to
the file ERRLIS.
Error messages are written to the file ERR. When the procedure ends
ERR is listed on the terminal. If ERR is empty then 'ok' is displayed.
Libraries may be large enough so that fetching is very time
consuming. If something is known about the library then fetching will be
performed more efficiently. Example 3 illustrates the use of an index file.
3. Do examples 1 and 2 above using the index file IND.
FCH f1 - OUT BRATIO+ GRATIO+ IND
FCH f1 IN OUT IND
The first argument of FCH specifies the function to be performed:
'f' indicates to fetch without an index file
'f1' indicates to fetch with an index file
Note that using an index file is slightly different from the previous
version of FCH. This new version of FCH does not require the library
names in the argument list because the library names are in the index
file. The library names begin in line 2 of the index file, one name
per line(including the path) beginning in column 1.
The index file provided for the NSWC math library is named 'INDEX'
and contains 'C:\NSWC\NSWCLIBR' in line 2. If the library is stored
with a different path or name then change line 2 accordingly. Assuming
that the index and the library are not renamed and are both stored in
directory C:\NSWC we do example 3 using the NSWC library:
in directory C:\NSWC
FCH f1 - OUT BRATIO+ GRATIO+ INDEX
FCH f1 IN OUT INDEX
in a directory different from C:\NSWC
FCH f1 - OUT BRATIO+ GRATIO+ C:\NSWC\INDEX
FCH f1 IN OUT C:\NSWC\INDEX
In all the examples either or both of the files IN and OUT may be
prefixed with a path.
Many PC users use double precision because of the limited
accuracy on the PC. For this reason and because of the nature of
the routines SPMPAR,EXPARG, and EPSLN:
when SPMPAR is fetched DPMPAR is also fetched
when EXPARG is fetched DXPARG is also fetched
when EPSLN is fetched DEPSLN is also fetched
The NSWC Library issued on a floppy disk has the function IPMPAR
initialized for an IBM compatible PC using any of the four compilers:
RM/Fortran,Microsoft,Lahey,Professional. For other IBM PC compilers and
for compilers for other computers, see the appendix of the NSWC Math
Library manual(NSWCDD TR 92/425).
Russ Gnoffo K13 703-663-8295
�About
NSWC Library of Mathematical Functions