program test * * File: ~/numerical/test_nag.f * * Author: Chuck Gartland (6-99) * * Fortran test program for using NAG Library on the HP-UX 10.*, * Linux, and SunOS 4.1 machines on the Kent Math/CS Network. * * Library locations: * * HP-UX: /local/opt/fortran/lib/libnag.a * Linux, Sun: /usr/local/lib/libnag.a * * Compiling alternatives: * * HP-UX: * ----- * 1) directing the loader to search extra directory * * % fort77 test_nag.f -L/local/opt/fortran/lib -lnag * * 2) using full path name or link to the library archive * * % f77 test_nag.f /local/opt/fortran/lib/libnag.a * * or * * % ln -s /local/opt/fortran/lib/libnag.a nag.a * % f77 test_nag.f nag.a * * See man pages for "f77/fort77", "ld", and "ln". * * Linux, Sun: * ---------- * % f77 test_nag.f -lnag * * Test prob: [ 1 2 3 ][x] [ 6] , w/ true sol'n [1] * [ 4 5 6 ][y] = [15] [1] * [ 7 8 0 ][z] [15] [1] * implicit double precision ( a-h, o-z ) dimension A(4,5), b(3), wkspce(3) ! deliberately chosen larger ! dimensions to illustrate role ! of 'ia' data A / 1., 4., 7., 0., 2., 5., 8., 0., 3., 6., 0., 0., 8*0. / data b / 6., 15., 15. / data ia, n, ifail / 4, 3, 0 / call F04ARF( A, ia, b, n, b, wkspce, ifail ) ! solve Ax=b system print *, ' ifail, b = ', ifail, b stop end * * Appended sample output: * * ifail, b = 0 .9999999999999996 1.0 1.0 *