X04 Chapter Contents
X04 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentX04ABF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

## 1  Purpose

X04ABF returns the value of the current advisory message unit number, or sets the current advisory message unit number to a new value.

## 3  Description

X04ABF enables those library routines which output advisory messages to determine the number of the output unit to which the advisory messages are to be sent; in this case X04ABF is called with ${\mathbf{IFLAG}}=0$. X04ABF may also be called with ${\mathbf{IFLAG}}=1$ to set the unit number to a specified value. Otherwise a default value (stated in the Users' Note for your implementation) is returned.
Records written to this output unit by other library routines are at most $120$ characters long (including a line-printer carriage control character), unless those library routines allow you to specify longer records.
Note that if the unit number is set $\text{}<0$, no messages will be output.

None.

## 5  Arguments

1:     $\mathrm{IFLAG}$ – INTEGERInput
On entry: the action to be taken (see NADV).
Constraint: ${\mathbf{IFLAG}}=0$ or $1$.
2:     $\mathrm{NADV}$ – INTEGERInput/Output
On entry: if ${\mathbf{IFLAG}}=0$, NADV need not be set.
If ${\mathbf{IFLAG}}=1$, NADV must specify the new advisory message unit number.
On exit: if ${\mathbf{IFLAG}}=0$, NADV is set to the current advisory message unit number.
If ${\mathbf{IFLAG}}=1$, NADV is unchanged.
Note that Fortran unit numbers must be positive or zero. If NADV is set $\text{}<0$, output of advisory messages is totally suppressed. It is important to note that if you supply an illegal value for NADV (such as a unit number associated with a file opened for reading instead of writing) then X04ABF cannot detect that fact, but any output sent to the unit by later calls of NAG routines may have undesirable consequences, such as program crashes.

None.

Not applicable.

## 8  Parallelism and Performance

X04ABF is not thread safe and should not be called from a multithreaded user program. Please see Section 3.12.1 in How to Use the NAG Library and its Documentation for more information on thread safety.
X04ABF is not threaded in any implementation.

The time taken by X04ABF is negligible.

## 10  Example

In this example X04ABF is called by your main program to make the advisory message from the routine DUMMY appear on the same unit as the rest of the output (unit $6$). Normally a NAG Library routine with an IFAIL argument (see Section 3.4.2 in How to Use the NAG Library and its Documentation) would take the place of DUMMY.

### 10.1  Program Text

Program Text (x04abfe.f90)

None.

### 10.3  Program Results

Program Results (x04abfe.r)