NAG FL Interface
X04 (File)
Input/Output Utilities

1 Scope of the Chapter

This chapter contains utility routines concerned with input and output to or from an external file.

2 Background to the Problems

2.1 Output from NAG Library Routines

Output from NAG Library routines to an external file falls into two categories.
  1. (a)Error messages
    which are always associated with an error exit from a routine, that is, with a nonzero value of ifail as specified in Section 6 of the routine document.
  2. (b)Advisory messages
    which include output of final results, output of intermediate results to monitor the course of a computation, and various warning or informative messages.
Each category of output is written to its own Fortran output unit – the error message unit or the advisory message unit. In practice these may be the same unit number. Default unit numbers are provided for each implementation of the Library (see the Users' Note for your implementation); they may be changed by users. Output of error messages may be controlled by the setting of ifail (see Section 4.2 in the Introduction to the NAG Library FL Interface). Output of advisory messages may usually be controlled by the setting of some other argument (e.g., MSGLVL) (or in some routines also by ifail). An alternative mechanism for completely suppressing output is to set the relevant unit number <0.
At present only formatted records are output from the Library. All formatted output to an external file from within the Library is performed by x04baf. Similarly, all formatted input from an external file is performed by x04bbf.
When the Library is being called from another language, such as C or Visual Basic, the routines x04acf and x04adf may be especially useful: x04acf connects a file to a FORTRAN unit; x04adf disconnects a file from a FORTRAN unit.

2.2 Matrix Printing Routines

Routines are provided to allow formatted output of
  1. (a)general matrices stored in a two-dimensional array (real, complex and integer data types);
  2. (b)triangular matrices stored in a packed one-dimensional array (real and complex data types);
  3. (c)band matrices stored in a packed two-dimensional array (real and complex data types).
Routines in (b) and (c) allow printing of matrices stored in formats used in particular by Chapters F06 and F07 of the Library.
By appropriate choice of arguments you can specify titles, labels, maximum output record length, and the format of individual matrix elements. All output is directed to the advisory messages unit, which may be altered by a call to x04abf.

3 Recommendations on Choice and Use of Available Routines

Apart from the obvious utility of the matrix printing routines, users of the Library may need to call routines in Chapter X04 for the following purposes.
If the default error message unit (given in the Users' Note for your implementation) is not satisfactory, it may be changed to a new value nerr by the statement
Call x04aaf(1,nerr)
Similarly the advisory message unit may be changed to a new value nadv by the statement
Call x04abf(1,nadv)
Note that both x04aaf and x04abf use a Fortran SAVE statement to retain the value of the unit number and so neither routine is safe to use in a multithreaded environment.

4 Functionality Index

Accessing external formatted file,  
reading a record   x04bbf
writing a record   x04baf
Accessing unit number,  
of advisory message unit   x04abf
of error message unit   x04aaf
Connecting an external file   x04acf
Disconnecting an external file   x04adf
Printing matrices,  
comprehensive routines,  
general complex matrix   x04dbf
general integer matrix   x04ebf
general real matrix   x04cbf
packed complex band matrix   x04dff
packed complex triangular matrix   x04ddf
packed real band matrix   x04cff
packed real triangular matrix   x04cdf
easy-to-use routines,  
general complex matrix   x04daf
general integer matrix   x04eaf
general real matrix   x04caf
packed complex band matrix   x04def
packed complex triangular matrix   x04dcf
packed real band matrix   x04cef
packed real triangular matrix   x04ccf

5 Auxiliary Routines Associated with Library Routine Arguments


6 Withdrawn or Deprecated Routines