NAG FL Interface
x04abf (set_​unit_​advisory)

Settings help

FL Name Style:

FL Specification Language:

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.

2 Specification

Fortran Interface
Subroutine x04abf ( iflag, nadv)
Integer, Intent (In) :: iflag
Integer, Intent (Inout) :: nadv
C Header Interface
#include <nag.h>
void  x04abf_ (const Integer *iflag, Integer *nadv)
The routine may be called by the names x04abf or nagf_file_set_unit_advisory.

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 iflag=0. x04abf may also be called with 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 <0, no messages will be output.

4 References


5 Arguments

1: iflag Integer Input
On entry: the action to be taken (see nadv).
Constraint: iflag=0 or 1.
2: nadv Integer Input/Output
On entry: if iflag=0, nadv need not be set.
If iflag=1, nadv must specify the new advisory message unit number.
On exit: if iflag=0, nadv is set to the current advisory message unit number.
If iflag=1, nadv is unchanged.
Note that Fortran unit numbers must be positive or zero. If nadv is set <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.

6 Error Indicators and Warnings


7 Accuracy

Not applicable.

8 Parallelism and Performance

Background information to multithreading can be found in the Multithreading documentation.
x04abf is not thread safe and should not be called from a multithreaded user program. Please see Section 1 in FL Interface Multithreading for more information on thread safety.
x04abf is not threaded in any implementation.

9 Further Comments

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 4.2 in the Introduction to the NAG Library FL Interface) would take the place of DUMMY.

10.1 Program Text

Program Text (x04abfe.f90)

10.2 Program Data


10.3 Program Results

Program Results (x04abfe.r)