# NAG FL Interfacee04zpf (handle_​opt_​set_​file)

## ▸▿ Contents

Settings help

FL Name Style:

FL Specification Language:

## 1Purpose

e04zpf is an option setting routine for all solvers from the NAG optimization modelling suite. It can set one or more optional parameters from an external file.

## 2Specification

Fortran Interface
 Subroutine e04zpf (
 Integer, Intent (In) :: infile Integer, Intent (Inout) :: ifail Type (c_ptr), Intent (In) :: handle
#include <nag.h>
 void e04zpf_ (void **handle, const Integer *infile, Integer *ifail)
The routine may be called by the names e04zpf or nagf_opt_handle_opt_set_file.

## 3Description

e04zpf may be used to supply values for optional parameters to the solver from an external file. It can only be called on handles which have been correctly initialized (e.g., by e04raf) and before the call to the solver. e04zpf looks in the file for a specific section containing the optional parameters. The section must start with a line Begin and must finish with a line End. Anything outside the section is ignored. If there is more than one section like this, only the first one is processed. Any line within the section is either blank or a comment which is ignored or defines a single optional parameter as if it had been set by e04zmf. The implied data type (character, integer or real) of each value to be set must match that expected by the corresponding optional parameter. It is only necessary to supply values for those arguments whose values are to be different from their default values. A comment begins with an asterisk (*) and all subsequent characters to the end of the line are ignored. Comments can also be placed after the optional parameter. The file is case insensitive.
Note that the optional parameters printed by the solver or by e04ryf are in the compatible format. An example of a valid options file is:
```Begin * Example options file
Print Level = 3
Monitoring Level = 5 * output all details
Monitoring File = 42 * to this file
End```
See Section 3.1 in the E04 Chapter Introduction for more details about the NAG optimization modelling suite.

None.

## 5Arguments

1: $\mathbf{handle}$Type (c_ptr) Input
On entry: the handle to the problem. It needs to be initialized (e.g., by e04raf) and must not be changed between calls to the NAG optimization modelling suite.
2: $\mathbf{infile}$Integer Input
On entry: the file identifier associated with the argument data file. Note:  that the file needs to be opened in read mode by x04acf with ${\mathbf{mode}}=0$.
Constraint: ${\mathbf{infile}}\ge 0$.
3: $\mathbf{ifail}$Integer Input/Output
On entry: ifail must be set to $0$, $-1$ or $1$ to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of $0$ causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of $-1$ means that an error message is printed while a value of $1$ means that it is not.
If halting is not appropriate, the value $-1$ or $1$ is recommended. If message printing is undesirable, then the value $1$ is recommended. Otherwise, the value $0$ is recommended. When the value $-\mathbf{1}$ or $\mathbf{1}$ is used it is essential to test the value of ifail on exit.
On exit: ${\mathbf{ifail}}={\mathbf{0}}$ unless the routine detects an error or a warning has been flagged (see Section 6).

## 6Error Indicators and Warnings

If on entry ${\mathbf{ifail}}=0$ or $-1$, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
${\mathbf{ifail}}=1$
The supplied handle does not define a valid handle to the data structure for the NAG optimization modelling suite. It has not been properly initialized or it has been corrupted.
${\mathbf{ifail}}=2$
The options cannot be modified while solver is running.
${\mathbf{ifail}}=3$
On entry, ${\mathbf{infile}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{infile}}\ge 0$.
${\mathbf{ifail}}=4$
BEGIN found, but end-of-file found before END. All optional parameters that were set from the file before this error was encountered will remain set on exit.
End-of-file or read error detected before BEGIN was found.
${\mathbf{ifail}}=11$
The $\mathit{option}$ provided on line $⟨\mathit{\text{value}}⟩$ was not recognized.
${\mathbf{ifail}}=12$
The expected delimiter ‘$=$’ was not found on line $⟨\mathit{\text{value}}⟩$.
${\mathbf{ifail}}=13$
The $\mathit{optval}$ provided on line $⟨\mathit{\text{value}}⟩$ could not be converted to the expected numerical type.
${\mathbf{ifail}}=15$
The $\mathit{optval}$ provided on line $⟨\mathit{\text{value}}⟩$ for the integer optional parameter is out of bounds.
${\mathbf{ifail}}=16$
The $\mathit{optval}$ provided on line $⟨\mathit{\text{value}}⟩$ for the real optional parameter is out of bounds.
${\mathbf{ifail}}=17$
The $\mathit{optval}$ provided on line $⟨\mathit{\text{value}}⟩$ for the character optional parameter is not valid.
${\mathbf{ifail}}=-99$
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
${\mathbf{ifail}}=-399$
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
${\mathbf{ifail}}=-999$
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

Not applicable.

## 8Parallelism and Performance

e04zpf is not threaded in any implementation.