In this example we have a simple Fortran77 program in the file gammaTest.f (you can see the listing of this file below). It is a modified version of the example program from NAG to test the Gamma Function evaluation program s14aaf. With this file in the current directory this example consists of the following the steps.
The output from a sample terminal session is shown below, followed by a discussion of the steps.
The nagshell alias and environment variables used below are available if you have made the suggested UNIX configuration changes described elsewhere.
<100>% nagshell
<1>% make gammaTest
f77 -o gammaTest gammaTest.f -L/opt/lib/nagfl16df -lnag
gammaTest.f:
MAIN:
<2>% gammaTest
5.000D+00 2.400D+01 0
<3>% exit
exit
<101>%
f77 -o gammaTest gammaTest.f $LINK_NAG
* 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, 2000.