Silicon Power Computer & comm SILICON GRAPHICS (IRIX 6) DOUBLE PRECISION FLSG620DA User Manual

Page 5

Advertising
background image

FLSG620DA Users' Note

http://www.csar.cfs.ac.uk/test/software/maths/nag/mark20...

5 of 10

18/08/2004 12:11

their use is recommended in preference to writing your own declarations.

The NAG Fortran Library Interface Block files are organised by Library chapter. The module
names are:

nag_f77_a_chapter

nag_f77_c_chapter

nag_f77_d_chapter

nag_f77_e_chapter

nag_f77_f_chapter

nag_f77_g_chapter

nag_f77_h_chapter

nag_f77_m_chapter

nag_f77_p_chapter

nag_f77_s_chapter

nag_f77_x_chapter

These are supplied in pre-compiled form (.mod files) and they can be accessed by specifying the

-I

"pathname" option on each f90 invocation, where "pathname" is the path of the directory

containing the .mod files.

In order to make use of these modules from existing Fortran 77 code the following changes need
to be made:

Add a USE statement for each of the module files for the chapters of the NAG Fortran
Library that your program calls directly. Often only one USE statement will be required.
Delete all EXTERNAL statements for NAG Fortran Library routines. These are now
declared in the module(s).
Delete the type declarations for any NAG Fortran Library functions. These are now
declared in the module(s).

These changes are illustrated by showing the conversion of the Fortran 77 version of the
example program for NAG Fortran Library routine S18DEF. Please note that this is not exactly
the same as the example program that is distributed with this implementation. Each change is
surrounded by comments boxed with asterisks.

* S18DEF Example Program Text

* Mark 14 Revised. NAG Copyright 1989.

*******************************************************************

* Add USE statement for relevant chapters *

USE NAG_F77_S_CHAPTER

* *

*******************************************************************

* .. Parameters ..

INTEGER NIN, NOUT

PARAMETER (NIN=5,NOUT=6)

INTEGER N

PARAMETER (N=2)

* .. Local Scalars ..

COMPLEX*16 Z

DOUBLE PRECISION FNU

INTEGER IFAIL, NZ

CHARACTER*1 SCALE

* .. Local Arrays ..

COMPLEX*16 CY(N)

* .. External Subroutines ..

*******************************************************************

* EXTERNAL declarations need to be removed (and type declarations *

* for functions). *

C EXTERNAL S18DEF

* *

Advertising