In this example, we have a simple Fortran 77 program in the file gammaTest.f. You can see the listing of this file below. It is a modified version of NAG's example program from NAG that tests the gamma function s14aaf. With this file in the current directory this example consists of the following steps.
The output from a sample terminal session is shown below, followed by a discussion of the steps.
The nagshell alias and environmental variables used below will be available only if you made the UNIX configuration changes suggested elsewhere.
<100>% nagshell
<1>% make gammaTest
f77 -dalign -xtarget=ultra -mt -o gammaTest gammaTest.f \
-L/opt/nag/aslir6/flso619da -lnag-spl -xlic_lib=sunperf -lsocket -lnsl -lintl
gammaTest.f:
MAIN:
<2>% ./gammaTest
5.000D+00 2.400D+01 0
<3>% exit
exit
<101>%
* S14AAF Example Program Text
* Mark 14 Revised. NAG Copyright 1989.
* .. Parameters ..
INTEGER NIN, NOUT
PARAMETER (NIN=5,NOUT=6)
* .. Local Scalars ..
DOUBLE PRECISION X, Y
INTEGER IFAIL
* .. External Functions ..
DOUBLE PRECISION S14AAF
EXTERNAL S14AAF
* .. Executable Statements ..
X = 5.0
IFAIL = 1
*
Y = S14AAF(X,IFAIL)
*
WRITE (NOUT,99999) X, Y, IFAIL
STOP
*
99999 FORMAT (1X,1P,2D12.3,I7)
END
Last modified: March 3, 2005
This page maintained by Dean Nairn
Copyright © University of Delaware, 2005.